[Main] Support paged stash with device-initiated GroupedLinear - #6828
Open
lhb8125 wants to merge 12 commits into
Open
[Main] Support paged stash with device-initiated GroupedLinear#6828lhb8125 wants to merge 12 commits into
lhb8125 wants to merge 12 commits into
Conversation
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
This reverts commit 202149d. Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Signed-off-by: hongbinl <hongbinl@nvidia.com>
lhb8125
force-pushed
the
denliu/paged-stash-grouped-tensor
branch
from
August 25, 2026 11:15
06eef66 to
660e7a3
Compare
lhb8125
marked this pull request as ready for review
August 25, 2026 11:16
Contributor
Author
|
/ok to test df35d24 |
Signed-off-by: hongbinl <hongbinl@nvidia.com>
Contributor
Author
|
/ok to test d409603 |
zhongbozhu
approved these changes
Aug 25, 2026
zhongbozhu
left a comment
Contributor
There was a problem hiding this comment.
approved, please share some E2E results showing matching loss and potentially better perf would be better
yaox12
approved these changes
Aug 26, 2026
Signed-off-by: hongbinl <hongbinl@nvidia.com>
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.
What does this PR do?
Extend MoE paged stashing to the non-op-fuser Transformer Engine GroupedTensor path introduced by #6000. This enables HybridEP static budgets and paged activation storage without requiring the CuTe DSL fused GroupedMLP or a full-iteration CUDA graph.
TransformerConfigvalidation instead of falling back to raw activation code.mark_grouped_tensorutility.The activation restriction applies only when
moe_paged_stash=Trueanduse_transformer_engine_op_fuser=False. The op-fuser path and ordinary non-paged-stash unfused execution retain their existing activation support.Dependency
Requires NVIDIA/TransformerEngine#3423.
Issue tracking
Follow-up to #6000.
Validation
AWS-CMH GB300 job
20260825-010956-b8a8(Slurm3284950) validated commit7ef0a606bwith the companion Transformer Engine change after narrowing marker propagation to the weighted SwiGLU/QuickGeGLU paths.Configuration and marker coverage:
Adapter-routing follow-up job
20260825-031156-a4e3(Slurm3286704) validated commit0b0ec811d:9 passed, 46 deselected. This includes four negative configurations—fusion disabled, non-gated activation, unsupported activation, and GLU interleaving—plus adapter delegation, both fused-activation lazy-import paths, and paged-stash scope lifecycle coverage.Four-rank HybridEP, MXFP8,
moe_use_grouped_tensor=True, fused SwiGLU,use_transformer_engine_op_fuser=False, and GPU-only paged stash (CPU factor = 0):python -m torch.distributed.run --nproc_per_node=4 -m pytest -q \ tests/unit_tests/transformer/moe/test_paged_stashing.py \ -k "TestPagedStashingGroupedTensor and test_forward_backward_without_op_fuser" -sAll four ranks reported
1 passed, 10 deselected. The test verifies dynamic BF16 activation capture, allocated stash/reload execution, no overflow, and output/input-gradient parity.End-to-end GB300 validation
Environment and recipe:
segment=4.Numerical correctness
The paged-stash ON job
20260826-084247-40b2(Slurm575247) and OFF job20260826-184106-325b(Slurm580791) used the same image/source and differed only inmoe_paged_stash. Both completed 3/3 steps with exit code 0.All printed
lm lossand grad-norm values match exactly. Every ON step reportedattempt=1 enabled=True; every OFF step reportedattempt=1 enabled=False. Both sides had zerostash_overflow_ranks,overbudget_ranks, andhost_spill_ranks, withwill_retry=False, so the comparison contains no fallback/rerun attempt.Paged-stash kernel execution
NSYS job
20260826-070950-c6a0(Slurm574726) completed 11/11 steps. Every committed step used paged stash on attempt 1 with no overflow, over-budget rank, host spill, or retry. Offline NSYS stats job20260826-071734-6851(Slurm574761) found the following calls in the capture window:paged_stash_copy_kernelpaged_stash_pop_kernelThe equal, nonzero copy/pop counts show that the final submitted attempt executed both stash and reload; this is stronger than checking the configuration flag alone. The rank-0
.nsys-repSHA256 is64920f7da4abfa61a7c3156f2817d1fbfb93059997a75e32f6b4568a8d9e3332.GPU memory A/B
The same three-step A/B used
moe_expert_rank_capacity_factor=2.0,moe_paged_stash_buffer_size_factor_cuda=1.1, CPU stash factor 0, and complete CUDA memory histories. Rank 31 provides the clean like-for-like comparison:The pool implies an actual-shape basis of
S = 2668.3125 / 1.1 = 2425.74 MiB. The capacity model predicts(2.0 - 1.1) * S = 2183.16 MiBof peak allocated saving; the measured 2112.92 MiB is 96.8% of that prediction (70.24 MiB difference). The ON path keeps the fixed stash pool resident, so current allocation at a step boundary can be higher even though the runtime peak is lower.Memory-history Python stack capture perturbs iteration timing, so these runs support correctness, actual kernel execution, and memory reduction only; they are not used to claim a throughput improvement.
Additional checks:
CHECK_ONLY=true BASE_REF=main bash tools/autoformat.shpy_compilegit diff --checkmainContribution process
Pre-checks