feat(hipblaslt): add vLLM wvSplitKQ FP8 TN skinny GEMMs (n ≤ 4) on gfx950 #15717
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.57) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.57 · 650 lines diff across 8 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.388
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #15717"
general
weight: 0.35
yzhang93
JIRA ID : AIHPBLAS-5126
Motivation
Skinny FP8 TN GEMMs, decode with one to four tokens through
torch._scaled_mmwith per-tensor scales, are bound by streaming the weights. vLLM runs them with its wave-split-K FP8 kernels (wvSplitKQ). This brings those kernels to hipBLASLt on gfx950 as GFA custom kernels, as #13489 did for BF16 and FP16, with the bias epilogue built in as in #14855: the same kernels serve GEMMs with and without a bias.On MI355X, these GEMMs get a +14% to +28% perf lift over develop on average (BF16 and FP16 D, with and without a bias, weights streamed from HBM or in cache), over ~600 shapes per D type,
n= 1 to 4. The kernels win most for one token (+36% to +43%) and least for four (+7% to +9%).Technical Details
Kernels
tensilelite/CustomKernels/vllm/wvSplitKQ_vllm_f8_{bf16,f16}_tn_n<N>_y<YTILE>u<UNRL>.s: 8 kernels, vLLM's tile for eachn.| D | n | Tiles (YTILE, UNRL) |
| - | - | ------------------- |
| BF16, FP16 | 1, 2 | (2, 2) |
| BF16, FP16 | 3, 4 | (2, 1) |
D = alpha scaleA scaleB A^T B + beta C + bias[m], with OCP FP8 (E4M3) A and B and FP32 accumulation inv_mfma_f32_16x16x32_fp8_fp8. The K loop, the MFMA accumulation and the DPP reduction are vLLM'swvSplitKQ_hf_sml_andwvSplitKQ_hf_(csrc/rocm/skinny_gemms.cuat9163190dda00; on vLLM main they now live incsrc/rocm/skinny_gemms.cuh). Each kernel picks between them at run time: alln Ktoken bytes staged once in the 160 KB of LDS, or the bytes that fit staged and the rest read from global memory.Changes from vLLM, for hipBLASLt's interface, as in #13489:
beta == 0. The scales are folded into alpha, and a null scale address reads as 1;ldbneither overflows LDS nor reads past the last token; LDS DMA only for 16-byte-aligned token rows;mindiv) computed on the device, andsmlhandlingmthat is not a multiple ofYTILE;The arguments are the wvSplitK ones followed by the scale A, scale B and bias addresses (96 bytes, same kernarg preload). Predicates:
batch == 1,n == N,K % 16 == 0, unit strides. Rows pastmread the last row and are not written, somneeds no bound. Each row of D is reduced by one wave in the same order, and the epilogue is compiled without contraction, so every row rounds the same way whether its row tile is whole or not; the kernels declareuniformSummationOrder: true. The kernels support no activation, scale-alpha vector, scale vectors or FP32 bias: problems with any of them get the kernels they get today.Library logic
gfx950/gfx950/Range/gfx950_Cijk_Alik_Bljk_F8BS_BH_SAB_UserArgs.yaml(BF16 D) andgfx950_Cijk_Alik_Bljk_F8HS_BH_SAB_UserArgs.yaml(FP16 D), both new, with the plain GEMM problem type and scalar A and B scales. FP8 GEMMs without scales match them too (hipBLASLt accepts a problem without scales in any scale mode) and take the kernels, which read a null scale as 1. gfx950 ships no other plain FP8 GEMM logic for these problem types, so each file forms a placeholder of its own; the FP16 file has the BF16 file's header with D's data types set to FP16.gfx950_Cijk_Alik_Bljk_F8BS_BH_Bias_B_SAB_UserArgs.yamlandgfx950_Cijk_Alik_Bljk_F8HS_BH_Bias_H_SAB_UserArgs.yaml, both new: the same problem types with a bias of D's type, and the same kernels. Each forms a placeholder of its own, searched after the plain one and before the FP8 Bias/activation/scale-vector libraries (checked in the built library's index on MI350). The bias problem type also accepts problems without a bias, and those reach the plain files first; the bias rows lie inside the plain rows.SupportUserGSUandSupportCustomWGMfalse): the kernels take neither, and hipBLASLt would run a split-K by passing the workspace as C and D. #14855 does the same for the BF16 and FP16 skinny entries.nand each cell of m (9 to 1536, 3072, 6144, 12288, 24576, 49152, 98304, and above) and K (1024 to 1280, 2560, 5120, 10240, 20480, and 36864), a file keeps the kernel where it is at least 3% faster than develop's pick over the cell's shapes, hot and cold, counting every kernel that pick launches (a split-K Tensile kernel also launches a reduction kernel). A bias cell needs its plain cell. 514 of the 732 measured cells keep the kernel: 39 and 32 rows for BF16 and FP16 D without a bias, 37 and 33 with one. Cells without measurements and K above 36864, the largest K measured, keep develop's kernels, so no row reaches the path forn Kpast the LDS stage.nof 1, 2 or 4, in both the MI350 file and MI355X's (gfx950_id75a3). MI355X searches its own tuned logic first, so there those shapes keep their tuned kernels; on MI350 these files come first, so the rows take over the 20 of them inside the BF16 rows. On MI355X the wvSplitKQ kernel beats the tuned kernel on 12 of the 24 by 3% or more and loses on 8; 5 of the 8 lie inside the rows: 8192×8192 withn= 2 (−25%) andn= 4 (−33%), 10240×8192 withn= 4 (−8%), and 57344×8192 withn= 2 (−6%) andn= 4 (−22%).Test Plan
On MI300X, with the same kernel source built for gfx942 (FNUZ FP8, 64 KB LDS) as a proxy for everything but gfx950's encoding, LDS size and LDS DMA:
n= 1 to 4, 7 tiles).On the branch, host side:
test_CustomKernelMetadata.py,test_CustomKernels_buffer_oob.py),ValidateMetadata --strict,TensileLogic --check-allon the four Range files, pre-commit.On gfx950:
matmul_skinny_f8_and the row-uniformity casesRowUniformity_pre_checkin.SkinnyTnF8, in Math CIprecheckinand on MI355X.nand from its merge base with develop (8b6dd4d7e43): each pick timed withrocprofv3as the sum of its kernels' median times over 500 calls after 150 warm-up ones, develop and this branch back to back on one GPU for each shape, alternating which goes first. "hot" = weights reused across iterations, "cold" =--rotating 512. Shapes, per D type, bias andn= 1 to 4: 46 model decode (m, K) pairs, 57 power-of-two pairs (m from 64 to 131072, K from 1024 to 32768) and 50 random pairs.Test Result
beta == 0, and row padding and buffer tails hold FP8 NaNs to catch out-of-bounds reads.custom.configarguments match its kernarg metadata; code object v4; the buffer-OOB scan.ValidateMetadata --strict(294 kernels, no errors),TensileLogic --check-allon the four Range files (16 solutions kept) and hipBLASLt's pre-commit hooks pass.matmul_skinny_f8_tn_dst_{bf16,f16}(288 cases: padded and misaligned leading dimensions, a K tail inside a wave's step with weight rows off any boundary, a partial LDS DMA wave, a scale on only A or only B,n= 5 and pointer-array fall-back),matmul_skinny_f8_tn_dst_{bf16,f16}_biasand_bias_epilogue(216 cases: a bias of D's type and an FP32 one, beta 0 and 2, GELU and scale-alpha vector fall-back), and the two row-uniformity cases: all 506 pass.n Kis past the LDS stage, to Tensile kernels, so the gtests check those kernels there. The TensileLite testscustom_vllm_wvsplitkq_f8_run the wvSplitKQ kernels one K step past the LDS stage for everyn, andRowUniformity_pre_checkin.SkinnyTnF8F16BiasTail_1031x4x41984runs then= 4 FP16 kernel there by name._bias_epiloguecases now usehpldata. Withrand_intdata, a scale-alpha vector of up to 10 and A and B scales of up to 1 sent 109 of the 4,124 outputs of the K = 41984 case past the FP16 range, on the GPU and in the CPU reference alike, and the norm check reported a NaN error (inf minus inf). Whether that happened depended on the scales the test drew, which change with the tests that ran before it in the same process, so these four cases failed in Math CI and passed when run alone.Performance (MI355X, perf lift over develop)
Perf lift = develop's time / this branch's time − 1, as a geometric mean over the shapes. Shapes in cells that keep develop's kernels are counted at develop's time.
| D | bias | shapes | hot | cold | n=1 | n=2 | n=3 | n=4 |
| - | ---- | ------ | --- | ---- | --- | --- | --- | --- |
| BF16 | none | 581 | +26.3% | +13.8% | +36% | +27% | +12% | +7% |
| BF16 | BF16 | 581 | +27.2% | +15.6% | +38% | +29% | +13% | +8% |
| FP16 | none | 608 | +27.6% | +19.9% | +43% | +31% | +15% | +9% |
| FP16 | FP16 | 608 | +27.2% | +19.7% | +42% | +30% | +16% | +9% |
The
ncolumns combine hot and cold. With a row pernfor every m from 9 and K from 1024, the same shapes gained +11% to +27%, and 16% of the results were at least 3% slower than develop; with the measured rows, 4.9% are. 77 cells lie within 2 points of the 3% threshold.Submission Checklist
Risk level
Medium. New kernels and library logic for gfx950 FP8 TN GEMMs with
nup to 4, scalar or no A and B scales, and no bias or a bias of D's type; other problems, devices and data types are unchanged. The rows were measured on MI355X; on MI350 they also take over 20 tuned FP8 Bias shapes, 5 of which ran slower on the wvSplitKQ kernel on MI355X.