[split build] fix distributed problems (#134502)

Should fix the issue where USE_C10D_NCCL was not getting propagated to libtorch_python.so
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134502
Approved by: https://github.com/yifuwang
This commit is contained in:
PaliC
2024-08-27 21:12:56 +00:00
committed by PyTorch MergeBot
parent 289486d007
commit b58a0c3c4d

View File

@ -337,11 +337,17 @@ endif()
# in case of the split build we need to add compile definitions
if(BUILD_LIBTORCHLESS)
if(USE_UCC)
target_link_libraries(torch_python PRIVATE __caffe2_ucc)
target_compile_definitions(torch_python PRIVATE USE_UCC)
endif()
if(USE_UCC AND USE_C10D_UCC)
target_compile_definitions(torch_python PRIVATE USE_C10D_UCC)
endif()
if(USE_UCC AND USE_C10D_NCCL)
if(USE_NCCL AND USE_C10D_NCCL)
target_compile_definitions(torch_python PRIVATE USE_C10D_NCCL)
endif()