Skip to content

feat: add collective communication for mccl - #63

Open
lqinfdim wants to merge 1 commit into
InfiniTensor:masterfrom
lqinfdim:feat/mccl-collectives-20260818
Open

feat: add collective communication for mccl#63
lqinfdim wants to merge 1 commit into
InfiniTensor:masterfrom
lqinfdim:feat/mccl-collectives-20260818

Conversation

@lqinfdim

Copy link
Copy Markdown

Summary

Add collective communication support for the MCCL backend on MetaX GPUs.

This PR implements the MCCL adapters and bridge registrations for the
collective operations that are already exposed by the InfiniCCL public API.

Changes

  • MCCL API adapters

    • Add MCCL wrappers for Broadcast, Reduce, ReduceScatter,
      AllGather, Gather, Scatter, and AllToAll.
    • Preserve the existing CclApi and CclTypeMap abstractions.
  • Collective implementations

    • Add common CCL forwarding implementations for the supported collective
      operations.
    • Add MCCL backend registrations for each operation.
    • Reuse the existing communicator, data type, reduction operation, and
      return status handling.
  • Tests and examples

    • Add fake MCCL API tests for argument forwarding and error handling.
    • Cover unsupported data types and invalid communicator states.
    • Add examples/ccl/collectives.cc demonstrating MCCL broadcast.
    • Register the collection communication test with CTest.

Platform and Backend Affected

Platform

  • CPU
  • NVIDIA GPU
  • Iluvatar GPU
  • MetaX GPU
  • Cambricon MLU
  • HYGON DCU

Backend

  • NCCL
  • MCCL

Performance Impact

  • No performance impact
  • Performance improved
  • Performance regression possible

This PR adds MCCL collective operation coverage and does not change the
implementation of existing collective operations on other backends.

Known Issues & Future Work

  • Runtime validation of multi-device collective communication depends on a
    working MetaX/MCCL communicator initialization environment.
  • Point-to-point communication is covered by the preceding MCCL change and is
    not modified by this PR.

Test Results

The following checks were run with MetaX and MCCL enabled:

  • Clean CMake configuration completed successfully.
  • Full project build completed successfully.
  • All existing examples compiled successfully.
  • The new examples/ccl/collectives example compiled successfully.
  • The MCCL bridge generated all seven new collective operations.
  • CTest passed:
    • ccl_collectives_impl
  • git diff --check passed.

Test Involved Platform

  • CPU
  • NVIDIA GPU
  • Iluvatar GPU
  • MetaX GPU
  • Cambricon MLU
  • HYGON DCU

Test Involved Backend

  • NCCL
  • MCCL

Checklist

Title, Branch, and Commits

  • PR title follows Conventional Commits.
  • Branch name follows the repository convention:
    feat/mccl-collectives-20260818.
  • The commit message follows Conventional Commits.
  • This PR is organized as a single focused change.
  • No unrelated merge commits were added.
  • No fixup!, squash!, or wip commits remain.

Scope and Design

  • Changes are limited to MCCL collective communication.
  • No unrelated backend or platform behavior was added.
  • No dead code or debug output was introduced.
  • Existing public operation interfaces are reused.

General Code Hygiene

  • Comments and error messages added by this PR are in English.
  • Modified files end with a trailing newline.
  • git diff --check passes.

C++ Specific

  • No exception-based argument parsing was added.
  • clang-format version 16 has been run locally.

Testing

  • The relevant MCCL example was built successfully.
  • The MCCL collective forwarding test passed.

Build, CI, and Tooling

  • GitHub CI workflows are green.

Documentation

  • No README or API documentation update is required for this internal
    backend implementation and example addition.

Security and Safety

  • No secrets, tokens, internal URLs, customer data, or hardware
    identifiers were committed.
  • No unsafe pointer arithmetic or uninitialized reads were introduced.

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