Skip to content

Commit 293fccf

Browse files
houqipytorchmergebot
authored andcommitted
add TORCH_CUDA_CPP_API for AutoNcclGroup (pytorch#130012)
`torch::cuda::nccl` is an option for developers to depend only on torch but not nccl. But to use `torch::cuda::nccl::send`/`torch::cuda::nccl::recv`, `ncclGroupStart()`/`ncclGroupEnd()` is needed, `torch::cuda::nccl::AutoNcclGroup` can be used. but `torch::cuda::nccl::AutoNcclGroup` is not exported and is LOCAL symbol, which can't be used from outside of libtorch. <img width="1618" alt="image" src="https://github.com/pytorch/pytorch/assets/1913192/25b0bd54-2da6-480f-876d-b05acfecfe62"> Pull Request resolved: pytorch#130012 Approved by: https://github.com/kwen2501, https://github.com/eqy
1 parent 239a9ad commit 293fccf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/csrc/cuda/nccl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ enum class ncclDataType {
7575
// RAII helper class to manage NCCL group API and CUDA free mutex.
7676
// The destructor is allowed to throw since this helper class only
7777
// manages group and lock lifetimes.
78-
struct AutoNcclGroup {
78+
struct TORCH_CUDA_CPP_API AutoNcclGroup {
7979
AutoNcclGroup();
8080
AutoNcclGroup(ncclComm_t comm, bool comm_nonblocking);
8181
~AutoNcclGroup() noexcept(false);

0 commit comments

Comments
 (0)