Skip to content

[PG][4b/N] Add NCCL device route (LSA + GIN) - #5364

Open
caozhanhao wants to merge 1 commit into
mainfrom
czh/pg-device-collectives-pr4-split
Open

caozhanhao wants to merge 1 commit into
mainfrom
czh/pg-device-collectives-pr4-split

Conversation

@caozhanhao

@caozhanhao caozhanhao commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Part of #3483 (Phase 2), stacked on #4575.

This PR adds the NCCL device route described in 4a/N (#4575). Please see that PR for the end-to-end design of coordinated endpoint installation, two-phase route updates, pause/resume, and communicator switching.

On top of that mechanism, this PR implements:

  • LSA direct-memory access and GIN put, signal, and drain operations through DTS.
  • NCCL bootstrap from the coordinated endpoint snapshot, PG-region registration, and current / pending / retired communicator generations.
  • NCCL route dispatch, configuration, and build integration.

User-visible behavior

  • Building PG with USE_NCCL_DEVICE=ON requires NCCL >= 2.31.2 for timeout support in ncclGin::wait().
  • The NCCL device route is disabled by default. Set MOONCAKE_PG_DISABLE_NCCL_DEVICE_ROUTE=0 to enable it.
  • Route selection currently follows a static priority order: P2P > RDMA > NCCL device > Host Proxy. We plan to design a more flexible route selection and failover mechanism in future work.

Known limitations

The current NCCL device route keeps all retired generations until shutdown. As a result, repeated installations accumulate NCCL communicators and their resources.

The intended design is to reclaim retired generations whose versions are below reclaim_before_version. However, reclaiming them eagerly during installation led to deadlocks in end-to-end tests, and we have not yet identified the cause.

The VA-signal access issue raised in review is also still open: GIN updates VA signals, while TransferLane::waitSignal() reads them using ordinary CUDA loads. The signal-access fix is not included in this split.

Suggested Merge Priority

  • P0 — Urgent: Critical security vulnerability, data loss/corruption, or widespread production outage requiring immediate action
  • P1 — High: Significant correctness or stability issue in existing functionality, or a regression blocking users without a practical workaround
  • P2 — Normal: Routine bug fix, validated performance/compatibility improvement, or new feature for a confirmed use case
  • P3 — Low: Experimental feature, optional enhancement, refactoring, or cleanup with no urgent user impact

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

All tests under mooncake-pg/tests passed.

Checklist

  • Every commit I contribute includes my Signed-off-by trailer certifying the DCO
  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

Codex was used to assist in designing and implementing this PR. All code and architectural changes have been thoroughly reviewed and verified by me in person.

@caozhanhao
caozhanhao added this pull request to stack #5365 November 9, 2026 13:39
@github-actions github-actions Bot added the size/M 100-1000 changed lines (additions + deletions) label Nov 9, 2026
@caozhanhao
caozhanhao force-pushed the czh/pg-device-collectives-pr4-split branch from 1c9ff68 to 984ebc4 Compare November 9, 2026 14:14
Base automatically changed from czh/pg-device-collectives-pr4 to main November 10, 2026 07:37
Signed-off-by: caozhanhao <cao2013zh@163.com>
@yuechen-sys
yuechen-sys force-pushed the czh/pg-device-collectives-pr4-split branch from 984ebc4 to 78468c6 Compare November 10, 2026 07:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyTorch Backend run-ci size/M 100-1000 changed lines (additions + deletions) Transfer Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant