[TE][HipKittens] Require K % 128 for blockwise FP8 GEMMs #788
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.49 · 340 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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.349
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #788"
general
weight: 0.35
wangye805
Description
ROCm-wide rules for blockwise FP8 GEMMs, from the #773 discussion: K % 128 != 0 now raises instead of computing (callers pad), and A/B data must be 128-byte aligned (sanity check; TE allocations always are). The #773 gfx942 workaround for unaligned rows is removed, since these checks make it unreachable. The checks run in HipKittens builds (
USE_HIPKITTENS_GEMM, on in all CI and wheel builds); without HipKittens, blockwise FP8 GEMMs are rejected as before.Applies to all ROCm GPUs, as agreed with the HipKittens owners. ROCm/Megatron-LM#167 pads MLA
kv_down(576 -> 640) and MoE splits to 128. Models with other dims that are not multiples of 128 per rank (e.g. GPT-OSS, hidden 2880) can't use blockwise FP8 on ROCm.Type of change
Changes
rocm_gemm.cu: K % 128 and 128-byte A/B alignment checks for blockwise FP8 (HipKittens builds)cublaslt_gemm.cu: blockwise grouped GEMMs run per GEMM (the CK/HipKittens grouped backends computed them wrong); every GEMM is checked before launchkittens/cdna3: revert the #773 unaligned-row workaroundquantization.py: blockwise align size 128 on ROCm, also with the Triton grouped GEMM (it falls back to HipKittens when ineligible)- ROCm blockwise cases use K % 128 == 0, including
test_fusible_opstest_layernorm_mlp- distributed TransformerLayer numerics compares in bf16 for ROCm blockwise (fp16 Q/K gradients underflow at these sizes, which flipped the zero-tensor check on gfx942)
- new rejection tests (C++, PyTorch); large-K and fp16-output pow2-scale C++ cases
Tested on gfx950 (MI355X) and gfx942 (MI300X): C++ blockwise/grouped GEMM tests and every CI PyTorch file that reaches blockwise FP8, in the CI env variants, single- and multi-GPU, pass.
Checklist: