mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Make Gloo depend on Caffe2 NCCL build
Summary: If Caffe2 used the packaged NCCL version then the Gloo build will try to use it as well. To make sure the NCCL build has completed we need to add an explicit dependency between the two. Another subtle change here is that we add the PROJECT_BINARY_DIR to the include path, since that is where the generated <gloo/config.h> resides. Without this path Caffe2 includes the empty config.h from the source tree. Closes https://github.com/caffe2/caffe2/pull/1170 Differential Revision: D5779002 Pulled By: pietern fbshipit-source-id: 9bc0d41f01a9b0f023d71bc4dee128a77eec1712
This commit is contained in:
committed by
Facebook Github Bot
parent
ceb13bf3fb
commit
30da84fbe1
@ -357,8 +357,16 @@ if(USE_GLOO)
|
||||
set(BUILD_BENCHMARK OFF)
|
||||
add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/gloo)
|
||||
caffe2_include_directories(${PROJECT_SOURCE_DIR}/third_party/gloo)
|
||||
caffe2_include_directories(${PROJECT_BINARY_DIR}/third_party/gloo)
|
||||
set(BUILD_TEST ${__BUILD_TEST})
|
||||
set(BUILD_BENCHMARK ${__BUILD_BENCHMARK})
|
||||
|
||||
# Add explicit dependency if NCCL is built from third_party.
|
||||
# Without dependency, make -jN with N>1 can fail if the NCCL build
|
||||
# hasn't finished when CUDA targets are linked.
|
||||
if(NCCL_EXTERNAL)
|
||||
add_dependencies(gloo_cuda nccl_external)
|
||||
endif()
|
||||
endif()
|
||||
# Pick the right dependency depending on USE_CUDA
|
||||
if(NOT USE_CUDA)
|
||||
|
Reference in New Issue
Block a user