Gate the packed-FP4 wgrad layout workaround on cutlass-dsl < 4.8 - #763
Conversation
Public cutlass-dsl wheels before 4.8 interpret packed sub-byte from_dlpack layouts in byte units, so BlockScaledMoEGroupedGemmWgradKernel recasts the FP4 A/B layouts to element units. The 4.8.0a0 public wheels adopted the internal wheel's native sub-byte layout semantics, so the recast now double-corrects: the MMA consumes byte-aliased data and every fp4 wgrad test fails with ~94% mismatched output (and occasionally an illegal memory access from the corrupted discrete-pointer TMA path). Gate the workaround on the cutlass-dsl version instead of only on internal-wheel presence. Verified on sm100 (torch 2.13, dense compile_execute fp4 sf_e4m3, mma 128x128/256x128, cluster 1x1/2x1): bit-exact vs the torch reference on both cutlass-dsl 4.7.0 (gate on) and 4.8.0a0+20260823210556.ac70faa (gate off); before this change 4.8 fails with ~94% mismatch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughThe grouped WGRAD GEMM now selects the packed-FP4 layout workaround based on the CUTLASS DSL version. Internal DSL and public versions 4.8+ use native layouts; older public versions use recasting. ChangesFP4 layout compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized change selects the packed-FP4 layout workaround by cutlass-dsl version and is reported bit-exact on both supported versions; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description clearly explains the problem, root cause, fix, and verification results, but it does not follow the repository template. It omits the required checklist, affected area, explicit summary, related issues, API and compatibility impact, and exact testing commands. Resolution Update the description to include all template sections. Mark or explain the Before submitting checklist, select the affected area, add explicit Summary and Why sections, state Related issues or None, document API and compatibility impact or None, and list the exact testing commands with their results.
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The pre-commit GitHub Action runs black on --all-files and this pre-existing file was not black-clean, failing the check for every PR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
CI replay results (internal MR !2355, pipeline 64703783,
The replay installed cutlass-dsl |
|
@cudnn-ci-bot run oss |
|
🏁 Pipeline finished SHA: |
Problem
The nightly
oss:rel:cutlass_dsl_4.8[Blackwell] CI jobs fail all fp4test_grouped_gemm_wgradtests (21 on shard1, e.g. pipeline 64271661 / job 409620600) with ~94% mismatched output — and, run-dependently, an illegal memory access that poisons the CUDA context and cascades into dozens of unrelated test ERRORs. cutlass-dsl 4.7 is green on the same commit.Root cause
BlockScaledMoEGroupedGemmWgradKernelcarries a packed-FP4from_dlpacklayout workaround (cute.recast_layout(4, 8, ...)on the A/B layouts) that public cutlass-dsl wheels < 4.8 require, gated on the internal cutlass-dsl wheel not being installed. The 4.8.0a0 public wheels adopted the internal wheel's native sub-byte layout semantics, so on 4.8 the recast double-corrects: the MMA consumes byte-aliased data (effectively halved-K / wrong strides), producing garbage output, and the corrupted addressing in the discrete-pointer TMA path can cross into unmapped memory (the IMA).A/B proof matrix from the standalone repro (dense compile_execute fp4 sf_e4m3 vs the torch
scaled_grouped_mmreference, sm100):Fix
Gate the workaround on the cutlass-dsl version (
< 4.8) instead of only on internal-wheel presence. The sm_107 and internal-wheel exemptions are unchanged.Verification
On an sm100 box (torch 2.13, CUDA 13), dense compile_execute fp4
sf_e4m3, mma 128x128 and 256x128, cluster 1x1 and 2x1:A full CI replay (internal MR !2355,
oss:relpointed at the 4.8.0a0 prerelease) is running on Blackwell shard0/shard1; results will be posted as a comment here.🤖 Generated with Claude Code
Summary by CodeRabbit