Skip to content

[dev] Share CUDA graph slots across dynamic CP variants - #6479

Draft
xiaoyao0115 wants to merge 11 commits into
NVIDIA:pull-request/6801from
xiaoyao0115:dcp-cg-slot-pool
Draft

[dev] Share CUDA graph slots across dynamic CP variants#6479
xiaoyao0115 wants to merge 11 commits into
NVIDIA:pull-request/6801from
xiaoyao0115:dcp-cg-slot-pool

Conversation

@xiaoyao0115

@xiaoyao0115 xiaoyao0115 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • capture a separate CUDA Graph bank for each supported dynamic-CP size
  • derive a bounded set of physical slots from reachable PP/VPP schedules and tensor lifetimes
  • share one Transformer Engine torch.cuda.MemPool and explicit saved/output/user-gradient arenas across mutually exclusive CP variants
  • select the graph by local CP size and the physical slot from the runtime microbatch schedule

Graph executables remain separate because different CP sizes have different compute and communication graphs. Memory addresses are shared only when the schedule proves that their lifetimes cannot overlap, including cases where the total microbatch count is larger than the physical slot count.

Implementation

MCore builds the complete capture order for every CP variant and passes a compact seven-field slot plan to Transformer Engine. TE discovers tensor layouts during warmup, fixes boundary addresses in the slot arenas, and captures every variant against the shared pool.

Dependencies and merge order

  1. [PyTorch] Allow CP P2P transport group overrides TransformerEngine#3420
  2. [dev] Reuse parent communicators for dynamic context parallelism #6801
  3. [PyTorch] Share CUDA graph memory across dynamic CP variants TransformerEngine#3353
  4. this PR

This PR is intentionally stacked on pull-request/6801; its diff contains only the CUDA Graph and slot-planning layer.

Validation

  • Black and isort checks
  • MCore graph suite: 67 passed, 11 skipped for higher GPU counts
  • communicator/router unit tests
  • 4-GPU dynamic-subgroup reduction tests
  • Transformer Engine suite: 45 targeted GPU tests
  • mixed CP2/CP1/CP1 CUDA Graph probe: 50 replays

@copy-pr-bot

copy-pr-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@xiaoyao0115

Copy link
Copy Markdown
Contributor Author

/ok to test 2a1d969

@xiaoyao0115

Copy link
Copy Markdown
Contributor Author

/ok to test a24ea4d

@xiaoyao0115

Copy link
Copy Markdown
Contributor Author

/ok to test 7e6ba4c

@xiaoyao0115

Copy link
Copy Markdown
Contributor Author

/ok to test 8bb6345

@xiaoyao0115
xiaoyao0115 changed the base branch from dev to pull-request/6801 August 25, 2026 09:54

Copy link
Copy Markdown
Contributor Author

/ok to test e64ea93

balasaajay and others added 9 commits August 25, 2026 12:55
…IDIA#6646)

Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Signed-off-by: Ajay Balasa <abalasa@nvidia.com>
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
Co-authored-by: Ajay <abalasa@nvidia.com>
Signed-off-by: Jingqi Yang <jingqiny@nvidia.com>
Signed-off-by: jingqiny-99 <jingqiny@nvidia.com>
…VIDIA#3635)

Signed-off-by: sophiayyya <yangjingyi0730@163.com>
Signed-off-by: root <root@eos0294.eos.clusters.nvidia.com>
Signed-off-by: Sophia Yang <sopyang@cw-dfw-cs-001-dc-02.cm.cluster>
Signed-off-by: Deyu Fu <deyuf@nvidia.com>
Signed-off-by: Sophia Yang <sopyang@cw-dfw-cs-001-vscode-01.cm.cluster>
Co-authored-by: root <root@eos0294.eos.clusters.nvidia.com>
Co-authored-by: Sophia Yang <sopyang@cw-dfw-cs-001-dc-02.cm.cluster>
Co-authored-by: Deyu Fu <deyuf@nvidia.com>
Co-authored-by: Sophia Yang <sopyang@cw-dfw-cs-001-vscode-01.cm.cluster>
Signed-off-by: Robin Zhang <robinz@nvidia.com>
Signed-off-by: Hongxiao Bai <hongxiaob@nvidia.com>
Tailai Ma added 2 commits August 27, 2026 23:31
Signed-off-by: Tailai Ma <tailaim@ferries-work.nvidia.com>
Signed-off-by: Tailai Ma <tailaim@ferries-work.nvidia.com>
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.

7 participants