Repository navigation
[GTP] Preserve independent expert prefetch chains under CUDA graphs - #8345
Open
fanshiqing wants to merge 6 commits into
Open
fanshiqing wants to merge 6 commits into
fanshiqing wants to merge 6 commits into
Conversation
Supplement NVIDIA#6057 by retaining separate captured FC1 and FC2 chains and extending graph stream tracking, gradient-ring ownership, and finalization to those chains. Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
Record each grouped gather completion at issue time so its consumer does not wait for unrelated work appended to the shared AG stream. Add eager and graph ordering regression coverage, repeated BF16 SwiGLU local/full graph numerical replay, and native MXFP8 op-fuser SwiGLU replay across Adam updates. Adapt capture ownership test fixtures to upstream main's explicit process groups and hooks. Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
Guard optional TE Work handles while recording grouped gather readiness even for synchronous fallbacks. Select capture-owned communication with the same predicate used by drains so future captured chain IDs cannot lose their stream joins. Treat missing chain IDs consistently as ungraphed. Add single-expert forward/recompute fallback coverage and future-chain/missing- chain regressions. Document the retained AccumulateGrad references. Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
Clear completed AG/RS stream caches between independent test models and process groups. Otherwise native MXFP8 full-iteration capture tries to join uncaptured streams left by earlier eager/local graph tests. This fixes the capture-isolation test failure without changing production code or tolerances. Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
svcnvidia-nemo-ci
marked this pull request as draft
October 19, 2026 16:07
Contributor
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
fanshiqing
marked this pull request as ready for review
October 19, 2026 16:08
Member
Author
|
/review |
Member
Author
|
/ok to test 6914806 |
Parameterize BF16 and native MXFP8 full-iteration replay and share process- group setup, gradient initialization, snapshots, comparisons, and Adam update trajectories. Retain all seven cases, six-update numerical replay, local-graph finalization coverage, completion-order tests, and synchronous fallback checks. Reduce the file from 559 to 433 lines without changing production code or relaxing numerical tolerances. Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
Signed-off-by: Shiqing Fan <shiqingf@nvidia.com>
Member
Author
|
/ok to test 8b41aaa |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Extend #6057’s separate grouped-expert FC1/FC2 prefetch chains to full-iteration and local CUDA graphs.
Previously, captured expert weights shared the general graphed chain: current FC1 prefetched current FC2 instead of next-block FC1, reducing the available communication-overlap window. Additionally, recording gather completion when consumed could make current FC2 wait for unrelated later FC1 communication on the shared all-gather stream.
This change:
How is the prefetch chain(s) changed under full-iter CG model
BEFORE: one logical captured chain
AFTER: three logical captured chains
Why this fix is critical for GTP+full-iter CG's performance
Earlier prefetch: The merged chain prefetches the next weight in execution order. Separate chains let FC1/FC2 prefetch their counterparts in the next MoE layer, giving communication more time to overlap computation.Fewer unnecessary waits: The completion-event fix lets a GEMM start once its own weights arrive, without waiting for unrelated gathers queued afterward.CG makes this overlap more useful: Full-iteration CG removes much of the CPU launch overhead. Better prefetching then helps keep the GPU compute stream busy instead of waiting for weights.Validation:
Perf Results on DSV4-pro-half-proxy: 35% e2e perf gain
Both runs use 256 NVIDIA GB300 GPUs, MXFP8, Adam, and the DSV4-Pro 30-layer proxy + MTP1, with TP1/PP1/CP1/EP64/GTP64/EGTP4, full-iteration CUDA graphs, and profiling enabled.
Related: #6057