Skip to content

Revert "use send/recv imple all2all (#1351)" #1692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Chao1Han
Copy link
Contributor

This reverts commit 7ee006f.

@Copilot Copilot AI review requested due to automatic review settings May 22, 2025 01:44
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reverts a previous commit that replaced the send/recv alltoall implementation with an alltoallv-based approach while introducing a helper function for flattening tensors.

  • Reintroduces a different alltoall implementation using ccl::alltoallv.
  • Adds a helper function (computeLengthsAndCheckAndGetFlat) to compute flattened tensor lengths and determine if tensors are already contiguous.
Comments suppressed due to low confidence (2)

src/xccl/ProcessGroupXCCL.cpp:43

  • Consider adding a check to ensure that the 'tensors' vector is not empty before accessing its first element, to avoid potential out-of-range errors.
bool computeLengthsAndCheckAndGetFlat(const std::vector<at::Tensor>& tensors, std::vector<size_t>& lengths, at::Tensor& flatTensor, int64_t& flatLength) {

src/xccl/ProcessGroupXCCL.cpp:2000

  • Using a reinterpret cast from 'size_t*' to 'int64_t*' might introduce issues on platforms where these types differ; consider using a conversion that safely translates the vector elements to int64_t.
auto flatInputSplits = flatInput.split_with_sizes(c10::IntArrayRef((int64_t*)sendCounts.data(), sendCounts.size()), 0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant