main
cmake 87 lines 2.53 KB
Raw
1 include(FetchContent)
2
3 # If FMHA_SM100_SRC_DIR is set, fmha_sm100 is installed from that directory
4 # instead of downloading. This is useful for local MSA development.
5 if(DEFINED ENV{FMHA_SM100_SRC_DIR})
6 set(FMHA_SM100_SRC_DIR $ENV{FMHA_SM100_SRC_DIR})
7 endif()
8
9 if(FMHA_SM100_SRC_DIR)
10 FetchContent_Declare(
11 fmha_sm100
12 SOURCE_DIR ${FMHA_SM100_SRC_DIR}
13 CONFIGURE_COMMAND ""
14 BUILD_COMMAND ""
15 )
16 else()
17 FetchContent_Declare(
18 fmha_sm100
19 GIT_REPOSITORY https://github.com/vllm-project/MSA.git
20 GIT_TAG be4a52aea420b6bef73be9af1a649859964790cb
21 GIT_PROGRESS TRUE
22 CONFIGURE_COMMAND ""
23 BUILD_COMMAND ""
24 )
25 endif()
26
27 FetchContent_GetProperties(fmha_sm100)
28 if(NOT fmha_sm100_POPULATED)
29 FetchContent_Populate(fmha_sm100)
30 endif()
31 message(STATUS "fmha_sm100 is available at ${fmha_sm100_SOURCE_DIR}")
32
33 add_custom_target(fmha_sm100)
34
35 set(FMHA_SM100_PY_ROOT "${fmha_sm100_SOURCE_DIR}/python/fmha_sm100")
36
37 install(FILES
38 "${FMHA_SM100_PY_ROOT}/__init__.py"
39 "${FMHA_SM100_PY_ROOT}/api.py"
40 "${FMHA_SM100_PY_ROOT}/bench_utils.py"
41 "${FMHA_SM100_PY_ROOT}/jit.py"
42 "${FMHA_SM100_PY_ROOT}/nvfp4_kv.py"
43 "${FMHA_SM100_PY_ROOT}/q8kv4_decode_adapter.py"
44 "${FMHA_SM100_PY_ROOT}/sparse.py"
45 "${FMHA_SM100_PY_ROOT}/sparse_fmha_adapter.py"
46 DESTINATION vllm/third_party/fmha_sm100
47 COMPONENT fmha_sm100)
48
49 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/csrc/"
50 DESTINATION vllm/third_party/fmha_sm100/csrc
51 COMPONENT fmha_sm100
52 PATTERN "__pycache__" EXCLUDE
53 PATTERN "*.pyc" EXCLUDE
54 PATTERN ".git*" EXCLUDE)
55
56 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/decode_q8kv4/"
57 DESTINATION vllm/third_party/fmha_sm100/decode_q8kv4
58 COMPONENT fmha_sm100
59 PATTERN "__pycache__" EXCLUDE
60 PATTERN "*.pyc" EXCLUDE)
61
62 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/kvouter/"
63 DESTINATION vllm/third_party/fmha_sm100/kvouter
64 COMPONENT fmha_sm100
65 PATTERN "__pycache__" EXCLUDE
66 PATTERN "*.pyc" EXCLUDE)
67
68 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/cute/"
69 DESTINATION vllm/third_party/fmha_sm100/cute
70 COMPONENT fmha_sm100
71 PATTERN "__pycache__" EXCLUDE
72 PATTERN "*.pyc" EXCLUDE
73 PATTERN ".git*" EXCLUDE)
74
75 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/cutlass/include/"
76 DESTINATION vllm/third_party/fmha_sm100/cutlass/include
77 COMPONENT fmha_sm100
78 PATTERN "__pycache__" EXCLUDE
79 PATTERN "*.pyc" EXCLUDE
80 PATTERN ".git*" EXCLUDE)
81
82 install(DIRECTORY "${FMHA_SM100_PY_ROOT}/cutlass/tools/util/include/"
83 DESTINATION vllm/third_party/fmha_sm100/cutlass/tools/util/include
84 COMPONENT fmha_sm100
85 PATTERN "__pycache__" EXCLUDE
86 PATTERN "*.pyc" EXCLUDE
87 PATTERN ".git*" EXCLUDE)