Triton RMSNorm Optimizations #593
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 320 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #593"
general
weight: 0.35
aris134
Description
Optimizes the Triton RMSNorm forward and backward kernels and adds an LDS-tiled FP8 transpose path. Measured 10%-50% improvements across a representative shape sweep for bf16 w/ no quantization or FP8 quant, and improvements of 3x-8x on FP8 Transpose outputs.
Benchmarks generated by this script.
Type of change
Changes
Please list the changes introduced in this PR:
- Fwd non-blocked path:
gammaload +ZERO_CENTERED_GAMMAadjustment +1/n_colshoisted outside the persistent row loop.- Bwd non-blocked path: same
gammahoist;inv_n_colshoisted.- Bwd both paths: per-row
c_scalar = nfnfgrad_suminv_n_colscomputed once before the dx/dg loop;dxexpression refactored tonf (dzg - cx)(saves one multiply per element)._rmsnorm_bwd_tritonand_rmsnorm_bwd_dg_reduce_tritonnow follow the impl + autotune-wrapper dispatch pattern already used by the fwd kernel.te_rmsnorm_bwd_tritontakes anautotune: bool = Truekwarg; when off it uses the previously-hardcodednum_warps=8+ fixedBLOCK_SIZE_M/N=128/64reduce tile._fp8_transpose_2d_impl(+ autotune wrapper) replaces the in-kernelout_transpose_ptr + cols * stride + row_idxstrided byte stores that were uncoalesced (one byte per thread to a different cache line). The new kernel does a coalesced(BLOCK_M, BLOCK_N)read,tl.trans()for LDS-staged transpose, then coalesced strided write.Checklist: