mirror of
https://github.com/NVIDIA/TensorRT-LLM.git
synced 2026-01-13 22:18:36 +08:00
[TRTLLM-9197][infra] Move thirdparty stuff to it's own listfile (#8986)
Signed-off-by: Josh Bialkowski <1309820+cheshirekow@users.noreply.github.com> Co-authored-by: Josh Bialkowski <1309820+cheshirekow@users.noreply.github.com>
This commit is contained in:
parent
b1c9936c36
commit
1379cfac3a
35
.gitmodules
vendored
35
.gitmodules
vendored
@ -1,35 +0,0 @@
|
||||
[submodule "3rdparty/cutlass"]
|
||||
path = 3rdparty/cutlass
|
||||
url = https://github.com/NVIDIA/cutlass.git
|
||||
[submodule "3rdparty/json"]
|
||||
path = 3rdparty/json
|
||||
url = https://github.com/nlohmann/json.git
|
||||
[submodule "3rdparty/cxxopts"]
|
||||
path = 3rdparty/cxxopts
|
||||
url = https://github.com/jarro2783/cxxopts
|
||||
branch = v3.1.1
|
||||
[submodule "3rdparty/NVTX"]
|
||||
path = 3rdparty/NVTX
|
||||
url = https://github.com/NVIDIA/NVTX.git
|
||||
[submodule "3rdparty/ucxx"]
|
||||
path = 3rdparty/ucxx
|
||||
url = https://github.com/rapidsai/ucxx.git
|
||||
[submodule "3rdparty/pybind11"]
|
||||
path = 3rdparty/pybind11
|
||||
url = https://github.com/pybind/pybind11.git
|
||||
[submodule "3rdparty/xgrammar"]
|
||||
path = 3rdparty/xgrammar
|
||||
url = https://github.com/mlc-ai/xgrammar.git
|
||||
[submodule "3rdparty/nanobind"]
|
||||
path = 3rdparty/nanobind
|
||||
url = https://github.com/wjakob/nanobind
|
||||
[submodule "3rdparty/cppzmq"]
|
||||
path = 3rdparty/cppzmq
|
||||
url = https://github.com/zeromq/cppzmq.git
|
||||
[submodule "3rdparty/DeepGEMM"]
|
||||
path = 3rdparty/DeepGEMM
|
||||
url = https://github.com/ruoqianguo/DeepGEMM.git
|
||||
branch = swapab_sm100
|
||||
[submodule "3rdparty/flash-mla"]
|
||||
path = 3rdparty/flash-mla
|
||||
url = https://github.com/deepseek-ai/FlashMLA.git
|
||||
114
3rdparty/CMakeLists.txt
vendored
Normal file
114
3rdparty/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,114 @@
|
||||
include(ExternalProject)
|
||||
include(FetchContent)
|
||||
|
||||
if(DEFINED ENV{GITHUB_MIRROR} AND NOT "$ENV{GITHUB_MIRROR}" STREQUAL "")
|
||||
set(github_base_url "$ENV{GITHUB_MIRROR}")
|
||||
else()
|
||||
set(github_base_url "https://github.com")
|
||||
endif()
|
||||
|
||||
FetchContent_Declare(
|
||||
cppzmq
|
||||
GIT_REPOSITORY https://github.com/zeromq/cppzmq
|
||||
GIT_TAG v4.10.0 # c94c20743ed7d4aa37835a5c46567ab0790d4acc
|
||||
GIT_SHALLOW TRUE
|
||||
# NOTE: TensorRT-LLM only uses the headers
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
cutlass
|
||||
GIT_REPOSITORY https://github.com/NVIDIA/cutlass
|
||||
GIT_TAG v4.2.1 # f3fde58372d33e9a5650ba7b80fc48b3b49d40c8
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
cxxopts
|
||||
GIT_REPOSITORY https://github.com/jarro2783/cxxopts
|
||||
GIT_TAG v3.1.1 # eb787304d67ec22f7c3a184ee8b4c481d04357fd
|
||||
GIT_SHALLOW TRUE)
|
||||
|
||||
set(deep_ep_commit 5be51b228a7c82dbdb213ea58e77bffd12b38af8)
|
||||
set_property(GLOBAL PROPERTY DEEP_EP_COMMIT "${deep_ep_commit}")
|
||||
FetchContent_Declare(
|
||||
deep_ep_download
|
||||
URL ${github_base_url}/deepseek-ai/DeepEP/archive/${deep_ep_commit}.tar.gz)
|
||||
|
||||
FetchContent_Declare(
|
||||
deepgemm
|
||||
GIT_REPOSITORY https://github.com/ruoqianguo/DeepGEMM
|
||||
GIT_TAG 9fa5965e265e27995f539e0dd73a06351a8a9eaf
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
eigen
|
||||
GIT_REPOSITORY https://github.com/libeigen/eigen
|
||||
GIT_TAG 3.4.0
|
||||
GIT_SHALLOW TRUE)
|
||||
|
||||
FetchContent_Declare(
|
||||
flashmla
|
||||
GIT_REPOSITORY https://github.com/deepseek-ai/FlashMLA.git
|
||||
GIT_TAG 1408756a88e52a25196b759eaf8db89d2b51b5a1
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
googlebenchmark
|
||||
GIT_REPOSITORY https://github.com/google/benchmark
|
||||
GIT_TAG v1.8.3
|
||||
GIT_SHALLOW TRUE)
|
||||
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest
|
||||
GIT_TAG v1.15.2
|
||||
GIT_SHALLOW TRUE)
|
||||
|
||||
FetchContent_Declare(
|
||||
json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json
|
||||
GIT_TAG v3.12.0 # 55f93686c01528224f448c19128836e7df245f72
|
||||
GIT_SHALLOW TRUE
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
nanobind
|
||||
GIT_REPOSITORY https://github.com/wjakob/nanobind
|
||||
GIT_TAG a0ed2587f1089ef7657e2ed49ad6756b01c74e9f)
|
||||
|
||||
FetchContent_Declare(
|
||||
nvtx
|
||||
GIT_REPOSITORY https://github.com/NVIDIA/NVTX
|
||||
GIT_TAG v3.1.0-c-cpp # a1ceb0677f67371ed29a2b1c022794f077db5fe7
|
||||
GIT_SHALLOW TRUE
|
||||
# NOTE: TensorRT-LLM only uses the headers
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
pybind11
|
||||
GIT_REPOSITORY https://github.com/pybind/pybind11
|
||||
GIT_TAG f99ffd7e03001810a3e722bf48ad1a9e08415d7d)
|
||||
|
||||
FetchContent_Declare(
|
||||
ucxx
|
||||
GIT_REPOSITORY https://github.com/rapidsai/ucxx
|
||||
GIT_TAG 16eaa57c8d98c8ef54d666a2d2b11e76cfa565f5
|
||||
# NOTE: See the notes in cpp/CMakeList.txt where this project is build at
|
||||
# configure time and then included via find_package
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
|
||||
FetchContent_Declare(
|
||||
xgrammar
|
||||
GIT_REPOSITORY https://github.com/mlc-ai/xgrammar
|
||||
GIT_TAG v0.1.25 # e4e816f5f0fe39f5b1601a17a4552307fa3b70ff
|
||||
GIT_SHALLOW TRUE
|
||||
# NOTE: TensorRT-LLM only uses the headers
|
||||
SOURCE_SUBDIR
|
||||
dont-add-this-project-with-add-subdirectory)
|
||||
1
3rdparty/DeepGEMM
vendored
1
3rdparty/DeepGEMM
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 9fa5965e265e27995f539e0dd73a06351a8a9eaf
|
||||
1
3rdparty/NVTX
vendored
1
3rdparty/NVTX
vendored
@ -1 +0,0 @@
|
||||
Subproject commit a1ceb0677f67371ed29a2b1c022794f077db5fe7
|
||||
1
3rdparty/cppzmq
vendored
1
3rdparty/cppzmq
vendored
@ -1 +0,0 @@
|
||||
Subproject commit c94c20743ed7d4aa37835a5c46567ab0790d4acc
|
||||
1
3rdparty/cutlass
vendored
1
3rdparty/cutlass
vendored
@ -1 +0,0 @@
|
||||
Subproject commit f3fde58372d33e9a5650ba7b80fc48b3b49d40c8
|
||||
1
3rdparty/cxxopts
vendored
1
3rdparty/cxxopts
vendored
@ -1 +0,0 @@
|
||||
Subproject commit eb787304d67ec22f7c3a184ee8b4c481d04357fd
|
||||
1
3rdparty/flash-mla
vendored
1
3rdparty/flash-mla
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 1408756a88e52a25196b759eaf8db89d2b51b5a1
|
||||
1
3rdparty/json
vendored
1
3rdparty/json
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 55f93686c01528224f448c19128836e7df245f72
|
||||
1
3rdparty/nanobind
vendored
1
3rdparty/nanobind
vendored
@ -1 +0,0 @@
|
||||
Subproject commit a0ed2587f1089ef7657e2ed49ad6756b01c74e9f
|
||||
1
3rdparty/pybind11
vendored
1
3rdparty/pybind11
vendored
@ -1 +0,0 @@
|
||||
Subproject commit f99ffd7e03001810a3e722bf48ad1a9e08415d7d
|
||||
1
3rdparty/ucxx
vendored
1
3rdparty/ucxx
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 16eaa57c8d98c8ef54d666a2d2b11e76cfa565f5
|
||||
1
3rdparty/xgrammar
vendored
1
3rdparty/xgrammar
vendored
@ -1 +0,0 @@
|
||||
Subproject commit e4e816f5f0fe39f5b1601a17a4552307fa3b70ff
|
||||
@ -20,8 +20,8 @@ set(TOP_LEVEL_DIR "${PROJECT_SOURCE_DIR}/..")
|
||||
add_custom_target(benchmarks)
|
||||
|
||||
if(NOT TARGET cxxopts::cxxopts)
|
||||
set(CXXOPTS_SRC_DIR ${PROJECT_SOURCE_DIR}/../3rdparty/cxxopts)
|
||||
add_subdirectory(${CXXOPTS_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/cxxopts)
|
||||
add_subdirectory(${CMAKE_BINARY_DIR}/_deps/cxxopts-src
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cxxopts)
|
||||
endif()
|
||||
|
||||
function(add_benchmark test_name test_src)
|
||||
|
||||
@ -243,15 +243,31 @@ set(TRT_LIB TensorRT::NvInfer)
|
||||
get_filename_component(TRT_LLM_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH)
|
||||
|
||||
set(3RDPARTY_DIR ${TRT_LLM_ROOT_DIR}/3rdparty)
|
||||
add_subdirectory(${3RDPARTY_DIR} 3rdparty)
|
||||
|
||||
if(BINDING_TYPE STREQUAL "pybind"
|
||||
OR BUILD_DEEP_EP
|
||||
OR BUILD_DEEP_GEMM)
|
||||
add_subdirectory(${3RDPARTY_DIR}/pybind11
|
||||
${CMAKE_CURRENT_BINARY_DIR}/pybind11)
|
||||
FetchContent_MakeAvailable(pybind11)
|
||||
include_directories(${CMAKE_BINARY_DIR}/_deps/pybind11-src/include)
|
||||
endif()
|
||||
if(BINDING_TYPE STREQUAL "nanobind")
|
||||
add_subdirectory(${3RDPARTY_DIR}/nanobind
|
||||
${CMAKE_CURRENT_BINARY_DIR}/nanobind)
|
||||
FetchContent_MakeAvailable(nanobind)
|
||||
include_directories(${CMAKE_BINARY_DIR}/_deps/nanobind-src/include)
|
||||
endif()
|
||||
|
||||
FetchContent_MakeAvailable(cutlass cxxopts flashmla json xgrammar)
|
||||
|
||||
if(ENABLE_UCX)
|
||||
FetchContent_MakeAvailable(cppzmq ucxx)
|
||||
endif()
|
||||
|
||||
if(NOT NVTX_DISABLE)
|
||||
FetchContent_MakeAvailable(nvtx)
|
||||
endif()
|
||||
|
||||
if(BUILD_DEEP_GEMM)
|
||||
FetchContent_MakeAvailable(deepgemm)
|
||||
endif()
|
||||
|
||||
# include as system to suppress warnings
|
||||
@ -261,18 +277,10 @@ include_directories(
|
||||
${CUDAToolkit_INCLUDE_DIRS}/cccl
|
||||
${CUDNN_ROOT_DIR}/include
|
||||
$<TARGET_PROPERTY:TensorRT::NvInfer,INTERFACE_INCLUDE_DIRECTORIES>
|
||||
${3RDPARTY_DIR}/cutlass/include
|
||||
${3RDPARTY_DIR}/cutlass/tools/util/include
|
||||
${3RDPARTY_DIR}/NVTX/include
|
||||
${3RDPARTY_DIR}/json/include)
|
||||
if(BINDING_TYPE STREQUAL "pybind"
|
||||
OR BUILD_DEEP_EP
|
||||
OR BUILD_DEEP_GEMM)
|
||||
include_directories(${3RDPARTY_DIR}/pybind11/include)
|
||||
endif()
|
||||
if(BINDING_TYPE STREQUAL "nanobind")
|
||||
include_directories(${3RDPARTY_DIR}/nanobind/include)
|
||||
endif()
|
||||
${CMAKE_BINARY_DIR}/_deps/nvtx-src/include
|
||||
${CMAKE_BINARY_DIR}/_deps/cutlass-src/include
|
||||
${CMAKE_BINARY_DIR}/_deps/cutlass-src/tools/util/include
|
||||
${CMAKE_BINARY_DIR}/_deps/json-src/include)
|
||||
|
||||
if(${CUDAToolkit_VERSION} VERSION_GREATER_EQUAL "11")
|
||||
add_definitions("-DENABLE_BF16")
|
||||
@ -538,14 +546,15 @@ if(ENABLE_UCX)
|
||||
if(NOT ${ucx_FOUND})
|
||||
set(ENABLE_UCX 0)
|
||||
else()
|
||||
set(ucxx_source_dir ${CMAKE_BINARY_DIR}/_deps/ucxx-src)
|
||||
if(DEFINED ENV{GITHUB_MIRROR} AND NOT "$ENV{GITHUB_MIRROR}" STREQUAL "")
|
||||
if(EXISTS "${3RDPARTY_DIR}/ucxx/fetch_rapids.cmake")
|
||||
file(READ "${3RDPARTY_DIR}/ucxx/fetch_rapids.cmake" FILE_CONTENTS)
|
||||
if(EXISTS "${ucxx_source_dir}/fetch_rapids.cmake")
|
||||
file(READ "${ucxx_source_dir}/fetch_rapids.cmake" FILE_CONTENTS)
|
||||
string(
|
||||
REPLACE "https://raw.githubusercontent.com/rapidsai/rapids-cmake"
|
||||
"$ENV{GITHUB_MIRROR}/rapidsai/rapids-cmake/raw/refs/heads"
|
||||
FILE_CONTENTS "${FILE_CONTENTS}")
|
||||
file(WRITE "${3RDPARTY_DIR}/ucxx/fetch_rapids.cmake" "${FILE_CONTENTS}")
|
||||
file(WRITE "${ucxx_source_dir}/fetch_rapids.cmake" "${FILE_CONTENTS}")
|
||||
message(WARNING "Replace UCXX fetch_rapids.cmake with internal mirror")
|
||||
endif()
|
||||
endif()
|
||||
@ -556,13 +565,13 @@ if(ENABLE_UCX)
|
||||
execute_process(
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E env LIB_BUILD_DIR=${CMAKE_BINARY_DIR}/ucxx/build
|
||||
${3RDPARTY_DIR}/ucxx/build.sh libucxx -n
|
||||
${ucxx_source_dir}/build.sh libucxx -n
|
||||
--cmake-args=\"-DBUILD_SHARED_LIBS=OFF
|
||||
-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=${USE_CXX11_ABI}\"
|
||||
OUTPUT_VARIABLE UCXX_BUILD_OUTPUT
|
||||
RESULT_VARIABLE UCXX_BUILD_RESULT)
|
||||
if(UCXX_BUILD_RESULT)
|
||||
message(${UCXX_BUILD_OUTPUT})
|
||||
message("ucxx build:" ${UCXX_BUILD_OUTPUT})
|
||||
message(FATAL_ERROR "ucxx build failed")
|
||||
endif()
|
||||
find_package(ucxx REQUIRED PATHS ${CMAKE_BINARY_DIR}/ucxx/build
|
||||
|
||||
@ -93,10 +93,6 @@ if(BUILD_XQA_TESTS)
|
||||
if(NOT GTest_FOUND)
|
||||
message(STATUS "System GTest not found, fetching from repository")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG v1.15.2)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
include(GoogleTest)
|
||||
endif()
|
||||
@ -106,10 +102,6 @@ if(BUILD_XQA_TESTS)
|
||||
if(NOT Eigen3_FOUND)
|
||||
message(STATUS "System Eigen not found, fetching from repository")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
eigen
|
||||
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
|
||||
GIT_TAG 3.4.0)
|
||||
FetchContent_MakeAvailable(eigen)
|
||||
endif()
|
||||
|
||||
|
||||
@ -22,10 +22,6 @@ set(BENCHMARK_ENABLE_TESTING
|
||||
set(BENCHMARK_ENABLE_INSTALL
|
||||
OFF
|
||||
CACHE INTERNAL "Disable google-benchmark install")
|
||||
FetchContent_Declare(
|
||||
googlebenchmark
|
||||
GIT_REPOSITORY https://github.com/google/benchmark.git
|
||||
GIT_TAG v1.8.3)
|
||||
FetchContent_MakeAvailable(googlebenchmark)
|
||||
|
||||
add_custom_target(micro_benchmarks)
|
||||
|
||||
@ -60,9 +60,10 @@ set(SRCS
|
||||
evictionPolicy.cpp
|
||||
cacheTransBuffer.cpp)
|
||||
|
||||
file(GLOB_RECURSE XGRAMMAR_SRCS "${3RDPARTY_DIR}/xgrammar/cpp/*.cc")
|
||||
set(xgrammar_source_dir ${CMAKE_BINARY_DIR}/_deps/xgrammar-src)
|
||||
file(GLOB_RECURSE XGRAMMAR_SRCS "${xgrammar_source_dir}/cpp/*.cc")
|
||||
list(FILTER XGRAMMAR_SRCS EXCLUDE REGEX
|
||||
"${3RDPARTY_DIR}/xgrammar/cpp/nanobind/.*\\.cc")
|
||||
"${xgrammar_source_dir}/cpp/nanobind/.*\\.cc")
|
||||
list(APPEND SRCS ${XGRAMMAR_SRCS})
|
||||
|
||||
if(NOT WIN32)
|
||||
@ -83,9 +84,9 @@ endif()
|
||||
add_library(${BATCH_MANAGER_STATIC_TARGET} STATIC ${SRCS})
|
||||
target_include_directories(
|
||||
${BATCH_MANAGER_STATIC_TARGET}
|
||||
PUBLIC ${3RDPARTY_DIR}/xgrammar/3rdparty/picojson
|
||||
${3RDPARTY_DIR}/xgrammar/3rdparty/dlpack/include
|
||||
${3RDPARTY_DIR}/xgrammar/include)
|
||||
PUBLIC ${xgrammar_source_dir}/3rdparty/picojson
|
||||
${xgrammar_source_dir}/3rdparty/dlpack/include
|
||||
${xgrammar_source_dir}/include)
|
||||
|
||||
set_target_properties(
|
||||
${BATCH_MANAGER_STATIC_TARGET}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
set(DEEP_EP_COMMIT 5be51b228a7c82dbdb213ea58e77bffd12b38af8)
|
||||
get_property(DEEP_EP_COMMIT GLOBAL PROPERTY DEEP_EP_COMMIT)
|
||||
set(NVSHMEM_URL_HASH
|
||||
SHA256=eb2c8fb3b7084c2db86bd9fd905387909f1dfd483e7b45f7b3c3d5fcf5374b5a)
|
||||
|
||||
@ -58,15 +58,6 @@ find_library(MLX5_lib NAMES mlx5 REQUIRED)
|
||||
|
||||
# Download DeepEP
|
||||
include(FetchContent)
|
||||
if(DEFINED ENV{GITHUB_MIRROR} AND NOT "$ENV{GITHUB_MIRROR}" STREQUAL "")
|
||||
set(GITHUB_URL "$ENV{GITHUB_MIRROR}")
|
||||
else()
|
||||
set(GITHUB_URL "https://github.com")
|
||||
endif()
|
||||
set(DEEP_EP_URL
|
||||
"${GITHUB_URL}/deepseek-ai/DeepEP/archive/${DEEP_EP_COMMIT}.tar.gz")
|
||||
message(STATUS "deep_ep DEEP_EP_URL: ${DEEP_EP_URL}")
|
||||
FetchContent_Declare(deep_ep_download URL ${DEEP_EP_URL})
|
||||
FetchContent_MakeAvailable(deep_ep_download)
|
||||
set(DEEP_EP_SOURCE_DIR ${deep_ep_download_SOURCE_DIR})
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ endif()
|
||||
# =============
|
||||
|
||||
# Use DeepGEMM submodule
|
||||
set(DEEP_GEMM_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../3rdparty/DeepGEMM)
|
||||
set(DEEP_GEMM_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/deepgemm-src)
|
||||
get_filename_component(DEEP_GEMM_SOURCE_DIR ${DEEP_GEMM_SOURCE_DIR} ABSOLUTE)
|
||||
|
||||
if(NOT EXISTS ${DEEP_GEMM_SOURCE_DIR})
|
||||
|
||||
@ -5,7 +5,7 @@ if(ENABLE_UCX)
|
||||
find_package(ucxx REQUIRED)
|
||||
find_package(Torch REQUIRED)
|
||||
|
||||
include_directories(${3RDPARTY_DIR}/cppzmq)
|
||||
include_directories(${CMAKE_BINARY_DIR}/_deps/cppzmq-src)
|
||||
|
||||
# Find and link ZMQ
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
@ -8,25 +8,9 @@ endif()
|
||||
# =============
|
||||
|
||||
# Use FlashMLA submodule
|
||||
set(FLASH_MLA_SOURCE_DIR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../3rdparty/flash-mla)
|
||||
set(FLASH_MLA_SOURCE_DIR ${CMAKE_BINARY_DIR}/_deps/flashmla-src)
|
||||
get_filename_component(FLASH_MLA_SOURCE_DIR ${FLASH_MLA_SOURCE_DIR} ABSOLUTE)
|
||||
|
||||
if(NOT EXISTS ${FLASH_MLA_SOURCE_DIR})
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"FlashMLA submodule not found at ${FLASH_MLA_SOURCE_DIR}. Please run: git submodule update --init --recursive"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Check if submodules are initialized
|
||||
if(NOT EXISTS ${FLASH_MLA_SOURCE_DIR}/csrc/cutlass/include)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"FlashMLA submodules not initialized. Please run: cd ${FLASH_MLA_SOURCE_DIR} && git submodule update --init --recursive"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Compiler compatibility for SM100 inline assembly
|
||||
# =================================================
|
||||
# FlashMLA SM100 contains PTX inline assembly that Clang++ on ARM64 incorrectly
|
||||
|
||||
@ -27,16 +27,17 @@ if(NOT Python3_EXECUTABLE)
|
||||
REQUIRED)
|
||||
endif()
|
||||
|
||||
set(cutlass_source_dir ${CMAKE_BINARY_DIR}/_deps/cutlass-src)
|
||||
execute_process(
|
||||
WORKING_DIRECTORY ${3RDPARTY_DIR}/cutlass/python/
|
||||
WORKING_DIRECTORY ${cutlass_source_dir}/python/
|
||||
COMMAND ${Python3_EXECUTABLE} setup_library.py develop --user
|
||||
RESULT_VARIABLE _CUTLASS_LIBRARY_SUCCESS)
|
||||
|
||||
if(NOT _CUTLASS_LIBRARY_SUCCESS EQUAL 0)
|
||||
message(
|
||||
FATAL_ERROR
|
||||
"Failed to set up the CUTLASS library due to ${_CUTLASS_LIBRARY_SUCCESS}."
|
||||
)
|
||||
"Failed to set up the CUTLASS library in ${cutlass_source_dir} due to"
|
||||
" ${_CUTLASS_LIBRARY_SUCCESS}.")
|
||||
endif()
|
||||
|
||||
set(GENERATE_KERNELS_SCRIPT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/python)
|
||||
@ -218,7 +219,7 @@ if(USING_OSS_CUTLASS_LOW_LATENCY_GEMM)
|
||||
add_library(low_latency_gemm_src STATIC ${LOW_LATENCY_GEMM_SRC_CU})
|
||||
set_cuda_architectures(low_latency_gemm_src 90)
|
||||
target_include_directories(low_latency_gemm_src
|
||||
PRIVATE ${3RDPARTY_DIR}/cutlass/examples)
|
||||
PRIVATE ${cutlass_source_dir}/examples)
|
||||
endif()
|
||||
|
||||
if(USING_OSS_CUTLASS_FP4_GEMM)
|
||||
|
||||
@ -16,18 +16,15 @@
|
||||
# GoogleTest Preparation - Code block copied from
|
||||
# https://google.github.io/googletest/quickstart-cmake.html
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG v1.15.2)
|
||||
FetchContent_MakeAvailable(googletest)
|
||||
include(GoogleTest)
|
||||
|
||||
set(cutlass_source_dir ${CMAKE_BINARY_DIR}/_deps/cutlass-src)
|
||||
include_directories(
|
||||
${PROJECT_SOURCE_DIR}/tensorrt_llm/cutlass_extensions/include
|
||||
${PROJECT_SOURCE_DIR}/include
|
||||
${3RDPARTY_DIR}/cutlass/include
|
||||
${3RDPARTY_DIR}/cutlass/tools/util/include
|
||||
${cutlass_source_dir}/include
|
||||
${cutlass_source_dir}/tools/util/include
|
||||
${PROJECT_SOURCE_DIR}/tests/batch_manager
|
||||
${PROJECT_SOURCE_DIR}/tests/utils)
|
||||
|
||||
|
||||
@ -91,6 +91,9 @@ if(${CUDAToolkit_VERSION} VERSION_GREATER_EQUAL "11.8")
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(${TRTLLM_DIR}/3rdparty 3rdparty)
|
||||
FetchContent_MakeAvailable(cxxopts)
|
||||
|
||||
# tensorrt_llm shared lib
|
||||
add_library(tensorrt_llm SHARED IMPORTED)
|
||||
set_property(TARGET tensorrt_llm PROPERTY IMPORTED_LOCATION ${TRTLLM_LIB_PATH})
|
||||
@ -125,8 +128,8 @@ target_link_libraries(executorExampleLogitsProcessor
|
||||
|
||||
# Advanced
|
||||
if(NOT TARGET cxxopts::cxxopts)
|
||||
set(CXXOPTS_SRC_DIR ${TRTLLM_DIR}/3rdparty/cxxopts)
|
||||
add_subdirectory(${CXXOPTS_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/cxxopts)
|
||||
add_subdirectory(${CMAKE_BINARY_DIR}/_deps/cxxopts-src
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cxxopts)
|
||||
endif()
|
||||
|
||||
add_executable(executorExampleAdvanced executorExampleAdvanced.cpp)
|
||||
|
||||
@ -209,6 +209,7 @@ add_definitions("-DTRT_LLM_USE_DIM64")
|
||||
list(APPEND COMMON_HEADER_DIRS ${TORCH_INCLUDE_DIRS})
|
||||
include_directories(${COMMON_HEADER_DIRS})
|
||||
|
||||
set(cutlass_source_dir ${CMAKE_BINARY_DIR}/_deps/cutlass-src)
|
||||
target_include_directories(
|
||||
triton-tensorrt-llm-backend
|
||||
PRIVATE ${TRTLLM_DIR}/cpp
|
||||
@ -217,7 +218,7 @@ target_include_directories(
|
||||
${CUDA_INCLUDE_DIRS}
|
||||
${CUDNN_ROOT_DIR}/include
|
||||
${NCCL_INCLUDE_DIR}
|
||||
${3RDPARTY_DIR}/cutlass/include
|
||||
${cutlass_source_dir}/include
|
||||
${MPI_INCLUDE_PATH}
|
||||
${COMMON_HEADER_DIR})
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user