Skip to content

Commit 58d37ac

Browse files
committed
fix allgather
Signed-off-by: junq <[email protected]>
1 parent 2f9d061 commit 58d37ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/tensorrt_llm/thop/allgatherOp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class AllgatherOp
7878
for (int root = 0; root < static_cast<int>(mGroup.size()); ++root)
7979
{
8080
auto split_size = sizes.value()[root];
81-
NCCLCHECK_THROW(ncclBroadcast(input.data_ptr(),
81+
NCCLCHECK_THROW(ncclBroadcast((COMM_SESSION.getRank() == root) ? input.data_ptr() : nullptr,
8282
output.index({torch::indexing::Slice(split_offset, torch::indexing::None)}).mutable_data_ptr(),
8383
numel_base * split_size, (*getDtypeMap())[type], root, *mNcclComm, stream));
8484
split_offset += split_size;

0 commit comments

Comments
 (0)