Skip to content

Cover symmetric memory in CUDA graph test - #5987

Merged
wujingyue merged 11 commits into
NVIDIA:mainfrom
wujingyue:cuda-graph
Aug 13, 2026
Merged

wujingyue merged 11 commits into
NVIDIA:mainfrom
wujingyue:cuda-graph

Conversation

@wujingyue

@wujingyue wujingyue commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Extend the MFSDP v2 CUDA-graph unit test to cover two cases:

  • The supported default CUDA-graph path without symmetric memory.
  • CUDA-graph capture with symmetric-memory collectives.

Only the symmetric-memory parametrization is marked flaky and flaky_in_dev; the default path continues to run normally.

Why

The symmetric-memory case tracks #6154. Its dedicated MemPool is separate from the CUDA-graph private pool, so allocation addresses and lifetimes are not yet guaranteed across capture and replay. Keep that coverage present but excluded from the default and LTS test runs until the required PyTorch allocator and buffer-registration support is available.

Testing

  • ruff check tests/unit_tests/distributed/mfsdp_v2/test_cuda_graph.py
  • Black check (locked version)
  • pytest --collect-only -m "not flaky and not flaky_in_dev" tests/unit_tests/distributed/mfsdp_v2/test_cuda_graph.py (collects the default case and deselects the symmetric-memory case)

@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@wujingyue wujingyue changed the title Cover symmetric memory in mFSDP v2 CUDA graph test Cover symmetric memory in CUDA graph test Jul 24, 2026
@wujingyue wujingyue linked an issue Jul 31, 2026 that may be closed by this pull request
@wujingyue
wujingyue force-pushed the cuda-graph branch 4 times, most recently from 2b60bdc to 0deb195 Compare August 10, 2026 22:38
@wujingyue
wujingyue marked this pull request as ready for review August 10, 2026 22:38
@wujingyue
wujingyue requested review from a team as code owners August 10, 2026 22:38
@copy-pr-bot

copy-pr-bot Bot commented Aug 11, 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.

wujingyue and others added 2 commits August 11, 2026 21:26
Parametrize test_captures_full_iteration over use_symm_mem so CUDA graph
capture and replay are verified for both the default and NCCL
symmetric-memory FSDP collective paths, which produce identical loss
trajectories.

With symmetric memory the FSDP path allocates its all-gather and
reduce-scatter staging buffers from a symmetric-memory MemPool and calls
symm_mem.rendezvous(); the capture-stream warmup installs and rendezvouses
those buffers so the captured region reuses already-registered windows.
Warm the data-parallel communicator with a barrier before capture, since
NCCL symmetric-memory window registration fails when a rendezvous is the
first collective on a communicator. Size the bf16 layers so NCCL selects
its symmetric-memory kernels, and use a zero regression target so the loss
decreases by a robust margin across replays.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31679739540

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 13, 2026
@wujingyue
wujingyue added this pull request to the merge queue Aug 13, 2026
@svcnvidia-nemo-ci

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/31723217131

Merged via the queue into NVIDIA:main with commit d7430d5 Aug 13, 2026
216 of 220 checks passed
@wujingyue
wujingyue deleted the cuda-graph branch August 13, 2026 19:00
ksivaman pushed a commit to ksivaman/Megatron-LM that referenced this pull request Sep 1, 2026
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

This branch was previously deployed

2 inactive deployments
public — 4c2f67dd Deployed Aug 12, 2026 by copy-pr-bot[bot] via finalize / publish-docs #5863
test — 4c2f67dd Deployed Aug 12, 2026 by copy-pr-bot[bot] via cicd-wait-in-queue #18784
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support CUDA graph capture with symmetric memory in MFSDP v2

5 participants