Skip to content

Commit

Permalink
[CMake] Add NCCL/RCCL header directory to include path (#17422)
Browse files Browse the repository at this point in the history
This PR updates the CMakeList to include the NCCL/RCCL header
directory in the include path of tvm build.

This is necessary when the NCCL/RCCL is installed at the location
covered by the default include pathes. In such cases, TVM is not
able to find the NCCL/RCCL header and cannot have success build.
  • Loading branch information
MasterJH5574 authored Sep 27, 2024
1 parent 3f2c91a commit 42ff98b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ endif(USE_PROFILER)
if(USE_CUDA AND USE_NCCL)
message(STATUS "Build with NCCL...")
find_nccl(${USE_NCCL})
include_directories(SYSTEM ${NCCL_INCLUDE_DIR})
tvm_file_glob(GLOB RUNTIME_NCCL_SRC src/runtime/disco/nccl/*.cc src/runtime/disco/cuda_ipc/*.cc 3rdparty/tensorrt_llm/*.cu)
set_source_files_properties(src/runtime/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=0")
list(APPEND RUNTIME_SRCS ${RUNTIME_NCCL_SRC})
Expand All @@ -489,6 +490,7 @@ endif()
if(USE_ROCM AND USE_RCCL)
message(STATUS "Build with RCCL...")
find_rccl(${USE_RCCL})
include_directories(SYSTEM ${RCCL_INCLUDE_DIR})
tvm_file_glob(GLOB RUNTIME_RCCL_SRC src/runtime/disco/nccl/*.cc)
set_source_files_properties(src/runtime/disco/nccl/nccl.cc PROPERTIES COMPILE_DEFINITIONS "TVM_NCCL_RCCL_SWITCH=1")
list(APPEND RUNTIME_SRCS ${RUNTIME_RCCL_SRC})
Expand Down

0 comments on commit 42ff98b

Please sign in to comment.