Skip to content
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

How to achieve batch_isend_irecv using CustomBackend implementation? #2

Open
MC952-arch opened this issue Jan 17, 2025 · 0 comments
Open

Comments

@MC952-arch
Copy link

MC952-arch commented Jan 17, 2025

Hello,

Could you help me explaining how to implement batch_isend_irecv via custom backend?

I've tried developing a simplified nccl backend send operation as follows:

c10::intrusive_ptr<Work> BackendFlagcx::send(
        std::vector<at::Tensor>& tensors,
        int dstRank,
        int tag)
{
    ...

    // Perform the send operation
    ncclSend(
        tensor.data_ptr(),
        tensor.numel(),
        ncclDataType,
        dstRank,
        comm,
        stream);

    auto future = c10::make_intrusive<c10::ivalue::Future>(
        c10::ListType::create(c10::TensorType::get()));
    future->markCompleted(c10::IValue(tensors));
    return c10::make_intrusive<WorkNCCL>(OpType::SEND, std::move(future));
}

However, I find no way to add group semantics for batch_isend_irecv op. I notice that in pytorch ProcessGroupNCCL, it defines several methods for group operation, including:

  • groupStart()
  • groupEnd()
  • startCoalescing()
  • endCoalescing()

Could you give me some advices about it?

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

No branches or pull requests

1 participant