Skip to content

Fix SM107 (Rubin) grouped GEMM quant: read TMEM accumulator before releasing the overlapping stage - #673

Merged
Anerudhan merged 1 commit into
NVIDIA:developfrom
Anerudhan:fix-rubin-tmem-overlapping-accum
Aug 20, 2026
Merged

Fix SM107 (Rubin) grouped GEMM quant: read TMEM accumulator before releasing the overlapping stage#673
Anerudhan merged 1 commit into
NVIDIA:developfrom
Anerudhan:fix-rubin-tmem-overlapping-accum

Conversation

@Anerudhan

@Anerudhan Anerudhan commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #654, which fixed the SM100 grouped GEMM kernels to read the TMEM accumulator before releasing the overlapping accumulator stage. As noted in #654 (comment), the Rubin (SM107) kernel moe_blockscaled_grouped_gemm_quant_rubin.py has the identical pattern.

With overlapping_accum enabled, the epilogue released the accumulator stage (acc_pipeline.consumer_release) before performing the TMEM→register copy of that stage's subtile. Once released, the MMA warp can start overwriting the accumulator while the epilogue is still reading it, corrupting results. This PR applies the same reorder as #654: move the t2r copy ahead of the fence + early-release block.

Scope

Checked all Rubin kernels containing the iter_acc_early_release_in_epilogue early-release pattern:

Kernel Status
grouped/quant/moe_blockscaled_grouped_gemm_quant_rubin.py Fixed here (release preceded copy)
grouped/glu/moe_blockscaled_grouped_gemm_glu_rubin.py Already correct (copy before release)
grouped/glu_hadamard_quant/moe_blockscaled_grouped_gemm_glu_hadamard_quant_rubin.py Already correct (copy before release)
grouped/dglu/moe_blockscaled_grouped_gemm_dglu_rubin.py Already correct (copy before release)
grouped/wgrad/moe_blockscaled_grouped_gemm_wgrad_rubin.py Not affected (overlapping_accum = False)

Summary by CodeRabbit

  • Bug Fixes
    • Improved the reliability of grouped quantized matrix multiplication by ensuring accumulated results are captured before pipeline resources are released.

…the overlapping stage

Apply the same fix as NVIDIA#654 to the Rubin (SM107) kernel
moe_blockscaled_grouped_gemm_quant_rubin.py, which has the identical
pattern: the overlapping accumulator stage was released before the
TMEM->register copy of that stage's subtile, allowing the MMA warp to
overwrite the accumulator while the epilogue was still reading it.

Move the t2r copy ahead of the early-release block so the accumulator
is read before consumer_release.

The other Rubin kernels (glu, glu_hadamard_quant, dglu) already perform
the copy before the release, and wgrad_rubin has overlapping_accum
disabled, so only this file is affected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0e8ab7b1-1788-4ed7-9ec7-b60baa2e770a

📥 Commits

Reviewing files that changed from the base of the PR and between 3041838 and d14c960.

📒 Files selected for processing (1)
  • python/cudnn/gemm/cutedsl/grouped/quant/moe_blockscaled_grouped_gemm_quant_rubin.py

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The quantized Rubin grouped GEMM epilogue now copies the TMEM accumulator fragment before the overlapping-accumulator fence and pipeline-stage release.

Changes

Quantized Rubin GEMM epilogue

Layer / File(s) Summary
Accumulator copy ordering
python/cudnn/gemm/cutedsl/grouped/quant/moe_blockscaled_grouped_gemm_quant_rubin.py
Moves the TMEM accumulator fragment copy before the overlapping-accumulator fence and early pipeline-stage release.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to d14c9

This is a localized ordering fix in the Rubin grouped GEMM path, and no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

Suggested reviewers: sraman-rgb

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the bug and scope, but it omits several template sections, including affected area, testing, compatibility impact, and checklist status. Add the required template sections and checklist results, including affected area, API and compatibility impact, exact testing commands and results, and related issues.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the Rubin grouped GEMM quant race fix and the required read-before-release ordering.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Anerudhan Anerudhan self-assigned this Aug 19, 2026
@Anerudhan Anerudhan added cat-bug Reports of incorrect behavior, crashes, regressions, or unexpected results. orig-nv-eng Reported or requested by NVIDIA engineering. mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. labels Aug 19, 2026
@Anerudhan Anerudhan added this to the Frontend 1.28.0 milestone Aug 19, 2026
@Anerudhan
Anerudhan merged commit 33086dd into NVIDIA:develop Aug 20, 2026
1 check passed
@Anerudhan Anerudhan mentioned this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat-bug Reports of incorrect behavior, crashes, regressions, or unexpected results. mod-cutedsl CuTeDSL kernels, generated kernels, examples, or related integration work. orig-nv-eng Reported or requested by NVIDIA engineering.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant