sdpa fp8 sm100: fused LDTM row-max on cc10.3 (per-tensor FP8) - #586
sdpa fp8 sm100: fused LDTM row-max on cc10.3 (per-tensor FP8)#586vedaanta wants to merge 1 commit into
Conversation
cc10.3 has had the fused LDTM.STAT row-max (tcgen05.ld.red.f32.max) since bring-up, but only the MXFP8 kernel read the fused_ldtm_stat flag - the per-tensor FP8 kernel ran the manual tcgen05_ld + software reduction on every part. This wires the same specialization into the per-tensor kernel: the unmasked softmax path loads S_acc and reduces the row max in one op per 64-column chunk; masked iters keep the software path (the fused max reduces before a mask could apply); cc10.0 folds to the manual path unchanged (the flag is per-specialization state in TemplateParams, so each device class gets its own traced variant, as with MXFP8). The branch is byte-for-byte the one the SM107 sibling bakes (board-proven on cc10.7, where the LDTM lever carried most of a -7.5% step at 65k), and the helper + instruction are the same ones the MXFP8 kernel exercises on cc10.3 in production. SM100 (cc10.0) suite: 34 passed, behaviorally identical. Direct cc10.3 hardware validation is queued (B300); the fused path's only new surface here is this kernel's integration, identical in shape to both existing users. 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 (3)
📝 WalkthroughWalkthroughSM100 FP8 compilation now enables fused ChangesSM100 FP8 fused reduction path
Estimated code review effort: 2 (Simple) | ~10 minutes Mergeability Score: ⚪ Minimal · up to This localized optimization enables the fused row-max path for per-tensor FP8 on supported hardware while preserving the existing SM100 behavior; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant compile
participant TemplateParams
participant prefill_d128_fp8_sm100
participant tcgen05_ld_red
compile->>TemplateParams: enable fused_ldtm_stat for FP8 on cc10.3
TemplateParams->>prefill_d128_fp8_sm100: provide reduction configuration
prefill_d128_fp8_sm100->>tcgen05_ld_red: load unmasked S_acc chunk with row-max reduction
tcgen05_ld_red-->>prefill_d128_fp8_sm100: return data and row maxima
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@cudnn-ci-bot run frost |
|
🚀 Running mirror pipeline Branch: cudnn-gh/pr-586-182d3a7 |
|
B300 (sm103, cc 10.3) hardware validation done — the merge gate from the PR description is cleared. Setup: B300 SXM6 node, NGC pytorch:26.03 container, FE source-built from this branch, cuDNN backend 9.25.0, nvidia-cutlass-dsl 4.7.0. The per-tensor fp8 e2e suite runs the fused |
Summary
cc10.3 has the fused LDTM.STAT row-max, but only the MXFP8 kernel read the
fused_ldtm_statflag — the per-tensor FP8 kernel ran the manualtcgen05_ld+ software reduction on every part, leaving the win on the table on SM103. This wires the identical specialization into the per-tensor kernel (unmasked path only; masked iters keep the software reduction since the fused max reduces before a mask could apply). cc10.0 folds to the manual path unchanged.Three-line summary of the mechanism for reviewers new to it:
fused_ldtm_statis per-specialization state in the frozenTemplateParams(auto-set from the device in the adapter), so one kernel file yields distinct traced variants per device class — the same routing MXFP8 has used since its bring-up, and the SM107 sibling simply bakes.Evidence
tmem_load_max_reduction_x64) and instruction are the same ones the MXFP8 kernel exercises on cc10.3 in production.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation