Repository navigation
Conversation
ydwu4
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
October 10, 2026 03:43
This was referenced Oct 10, 2026
ydwu4
marked this pull request as draft
October 10, 2026 04:02
This was referenced Oct 10, 2026
sanketpurandare
added a commit
that referenced
this pull request
Oct 20, 2026
## Agent details (AI-generated) Adapted from Yidi Wu (@ydwu4), #5258, revision a5d8990, with original credit and license preserved. This is an integration and generalization, not an unmodified port. Keep the gate native and fuse sigmoid, group-limited top-k, routing weights, map/usage counts and backward. Preserve NVIDIA's BF16 logit/selected-weight boundaries and independent BF16 rounding for route and auxiliary score gradients. Forced round-robin remains an explicit benchmark deviation. Accept general legal token/expert/top-k/group dimensions with parameterized Triton kernels. Preserve the tuned CuTe launch for the production geometry. Match ATen's FP32 reduction order, including output-major upstreams, four virtual-thread accumulators and unaligned vector tails. Use fresh integer counts in the general path rather than a shape-dependent shared-counter budget. Keep padding, remat, rank-local counters, checkpoint parameters and native auxiliary-loss composition. Required unsupported precision/mesh/device contracts fail explicitly; supported shapes stay fused. ## Test Plan (AI-generated) python -m pytest tests/unit_tests/cpu/test_fused_dsv3_router.py tests/unit_tests/gpu/test_fused_dsv3_router.py -q pre-commit run --all-files 40 CPU/GPU tests passed, including original tuned-path cases, exact general FP32/BF16 gradients, forced routing, transposed gradients, unaligned top-129 tails, FakeTensor metadata, fullgraph compilation and CUDA capture/replay. Strict owning documentation rendering passed. All non-type lint hooks passed; only unchanged baseline type findings remained. Matched GB300 graph-replay F+B, excluding the common gate GEMM: the production path measured 28.7795us versus 28.7770us before (0.009%, within trial spread). General cases outperformed the same native reference: E64/K6/T8193 8.114x, E512/K8/T4097 6.633x, and E512/K129/T17 4.288x. Seed14536; three trials of 50 replays, with separate eager GPU trace collection and exact reference checks. These are kernel results, not distributed throughput or convergence claims. Full updated PP2/PP4 composition and expanded memory accounting remain pending.
sanketpurandare
added a commit
that referenced
this pull request
Oct 23, 2026
## Agent details (AI-generated) Adapted from Yidi Wu (@ydwu4), #5258, revision a5d8990, with original credit and license preserved. This is an integration and generalization, not an unmodified port. Keep the gate native and fuse sigmoid, group-limited top-k, routing weights, map/usage counts and backward. Preserve NVIDIA's BF16 logit/selected-weight boundaries and independent BF16 rounding for route and auxiliary score gradients. Forced round-robin remains an explicit benchmark deviation. Accept general legal token/expert/top-k/group dimensions with parameterized Triton kernels. Preserve the tuned CuTe launch for the production geometry. Match ATen's FP32 reduction order, including output-major upstreams, four virtual-thread accumulators and unaligned vector tails. Use fresh integer counts in the general path rather than a shape-dependent shared-counter budget. Keep padding, remat, rank-local counters, checkpoint parameters and native auxiliary-loss composition. Required unsupported precision/mesh/device contracts fail explicitly; supported shapes stay fused. ## Test Plan (AI-generated) python -m pytest tests/unit_tests/cpu/test_fused_dsv3_router.py tests/unit_tests/gpu/test_fused_dsv3_router.py -q pre-commit run --all-files 40 CPU/GPU tests passed, including original tuned-path cases, exact general FP32/BF16 gradients, forced routing, transposed gradients, unaligned top-129 tails, FakeTensor metadata, fullgraph compilation and CUDA capture/replay. Strict owning documentation rendering passed. All non-type lint hooks passed; only unchanged baseline type findings remained. Matched GB300 graph-replay F+B, excluding the common gate GEMM: the production path measured 28.7795us versus 28.7770us before (0.009%, within trial spread). General cases outperformed the same native reference: E64/K6/T8193 8.114x, E512/K8/T4097 6.633x, and E512/K129/T17 4.288x. Seed14536; three trials of 50 replays, with separate eager GPU trace collection and exact reference checks. These are kernel results, not distributed throughput or convergence claims. Full updated PP2/PP4 composition and expanded memory accounting remain pending.
This branch has not been 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.
Stack from ghstack (oldest at bottom):
Fuse sigmoid, grouped top-k, routing weights/map/counts, and score/routing
gradients. Preserve the native gate and auxiliary-loss boundaries.
Keep kernels, custom operators, autograd and override in one file, with
one CPU test file and one GPU test file.
Recorded GB300 FP32 [4096,256], native -> CuTeDSL:
Fwd 170.41 -> 13.06 us; Bwd 27.08 -> 3.52 us; F+B 193.87 -> 15.75 us.
Bitwise checks pass; roofline acceptance remains open. Requires CuTeDSL 4.8+.