← Back to Pull requests

feat(hipblaslt): W4A16 gfx1150 decode kernels selected by Origami #16341

Closed
unknown closed this pull request without merging on Nov 24, 2026 15:51 UTC
View on GitHub
unknown unknown commented on Nov 19, 2026 15:34 UTC
Author

ISSUE ID #16340

Motivation

On gfx1150, W4A16 decode GEMMs (1 to 5 tokens) run on the prefill tiles, which read the weights through LDS in multi-wave workgroups sized for many tokens. #16249 gives gfx1151 decode kernels that stream the int4 weights once at DRAM bandwidth, and an Origami model that ranks them. This PR brings both to gfx1150.

  • On the 1-token problems of a vLLM profile, hipBLASLt is on par with vLLM's wvSplitK_int4_g: 1.01x geomean over 86 problems, 1.02x weighted by the profile's time.
  • Depends on #16249, which is stacked on #16276 and #16229; based on #16249's branch. One commit.

    Technical details

    Kernels. The 70 gfx1151 dot2 WaveSplitK decode kernels retargeted to gfx1150, *_MT<m0>x<m1>x<du>_Dot2_gfx1150, 35 per int4 encoding:

    | Type | Kernels |
    |---|---|
    | bf16 symmetric | 7 |
    | bf16 zero-point | 10 |
    | fp16 symmetric | 8 |
    | fp16 zero-point | 10 |

  • gfx1150 and gfx1151 share the ISA, so each kernel is the gfx1151 one with its target and symbols renamed, and each logic entry is the gfx1151 entry with gfx1150's architecture, device and ISA, in the 8 gfx1150 Origami logic files.

  • The entries declare the workgroups per WGP that the kernel's resources allow on gfx1150: 32, or 20/16 where gfx1150's smaller VGPR file caps it.
  • Origami. w4a16_decode_dram_bytes_per_us returns gfx1150's DRAM bandwidth, 84.1 GB/s, [MEASURED] on these boards, which turns the decode model on there. Nothing else is per architecture: the model and its two cycle constants are the ones of #16249. A TODO (AIESW-51613) records that the two bandwidths should come from hardware_t, whose DRAM values are wrong today (about 623 GB/s on gfx1151 and 31 GB/s on gfx1150) and are what the tile model is calibrated against.

    Kernel set on gfx1150. The set was selected on gfx1151. On gfx1150, every kernel of the set was timed in its own process on 380 cases (95 shapes of 1-5 tokens × 4 types):

  • Origami's pick takes 1.016x the time of the fastest kernel (geomean); it is the fastest one on 295 of the 380.

  • MT1x3x2048 is the fastest kernel on 26 of its 48 cases; without it they would be 10% slower on average. It stays.

  • MT1x4x2048 (fp16 symmetric) is the one kernel that could go: without it its 13 cases would be 0.1% slower. It stays so that both architectures ship the same set.

  • The generated variants outside the set were not timed on gfx1150 over the shape list, only on one large shape.
  • Hold-out of the two cycle constants. They were fitted on gfx1151, on canonical shapes. Choosing them on half of the (N, K) layers of the 380 gfx1150 cases and scoring the pick on the other half (200 random splits) gives 1.020 against the fastest kernel; the shipped values give 1.015 on the same held-out halves, and are the best of the grid tried on all 380 cases.

    Test plan

  • Client tests now run on gfx1150. The six matmul_w4a16 cases of matmul_gtest.yaml select gfx1150 and gfx1151, and the w4a16_layout_gtest.cpp fixture no longer skips gfx1150. That covers the tests of #16229 and #16249 (K remainders, incomplete scale groups, unserved K, batch) and the ones that were already on develop, which had never run on gfx1150.

  • Performance on gfx1150 (two boards): GPU kernel time of hipBLASLt's own pick, 50 iterations after 50 warm-up. Only the weight rows are padded (odd multiple of 128 bytes). The boards give two speeds between processes, so each side takes its fastest process.

  • Against vLLM: the 1-token W4A16 problems of a vLLM profile on gfx1150 (86), vLLM's time per call taken from the profile as it is, with vLLM's own layout.

  • Unit tests: Origami ctest, with a test that decode configs are ranked on gfx1150 for bf16 and fp16; TensileLite custom-kernel tests with the new kernels.

  • No PR lane runs on gfx1150 (TheRock tests it nightly only); the numbers below are from manual runs.
  • Test result

  • Correctness: on a gfx1150 board, 10 of the 11 tests of w4a16_layout_gtest.cpp pass. They were run by hand against this stack's library with a stand-in for gtest, so CI is their first real run. The eleventh, scalar_b_has_no_matching_kernel (already on develop), needs a plain fp16 kernel and could not be checked: the library built for these runs holds only the W4A16 logic. The gfx1150 logic it needs is on develop since #15687. hipblaslt-bench -v on the sizes of the W4A16 YAML cases: 432 of 432 pass (54 sizes × 8 types), worst normalized error 3.2e-3 for bf16 and 7.1e-5 for fp16; the 360 cases of 1-5 tokens all run a decode kernel.

  • Unit tests: Origami 148 test cases pass (test_gemm 90, test_streamk 19, test_origami 39); TensileLite custom-kernel tests 2219 pass, 3 skipped.

  • Against vLLM (1 token, vLLM time / hipBLASLt time):
  • | | problems | geomean | weighted by profile time | hipBLASLt faster |
    |---|---|---|---|---|
    | all | 86 | 1.01x | 1.02x | 53 |
    | bf16 symmetric | 23 | 1.00x | 1.01x | 12 |
    | bf16 zero-point | 4 | 0.98x | 0.98x | 0 |
    | fp16 symmetric | 12 | 1.01x | 1.01x | 8 |
    | fp16 zero-point | 47 | 1.02x | 1.04x | 33 |

    17 problems are more than 2% slower than vLLM, 10 more than 5% and 5 more than 10%. The lowest are 1×9728×896 (0.89x), 1×896×4864 (0.89x) and 1×2048×6144 (0.90x), all fp16 zero-point.

  • Where it falls short. Small problems: the kernel's fixed time per wave is a large share of the time below about 100 µs.

  • Model against the first version of this PR (decode constants fitted per architecture): the picks take 0.994x its time on the kernels timed one by one (95% CI 0.990-0.997, 380 cases) and 1.000x end to end.
  • Submission checklist

  • Look over the contributing guidelines at https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.

  • The decode kernels are generated (the gfx1151 set), not hand-written.
  • Risk level

    Low. The kernels only serve W4A16 problems of 1 to 5 tokens on gfx1150. gfx1151 is not affected, except that its W4A16 client tests now share their cases with gfx1150.

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: yzhang93 Review duration: 7216m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.57) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #16341"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 57% (MEDIUM) · Higher = larger blast radius
    57%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%