From 7e26fd179a3553f97992f2b879e3d575cbeb62d5 Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Fri, 27 Sep 2024 00:36:20 -0400 Subject: [PATCH] [CMake] Add NCCL/RCCL header directory to include path 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. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66ea6a07da85..1fb28c869474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) @@ -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})