Skip to content

config: gpu-kernels 70bc2ad41 -> e57907b7 (prefill GEMV for the few-row F32 GDN alpha/beta shapes) - #2746

Closed
bong-water-water-bong wants to merge 1 commit into
mainfrom
cl-hrxkern/gk-pin-e57907b7
Closed

bong-water-water-bong wants to merge 1 commit into
mainfrom
cl-hrxkern/gk-pin-e57907b7

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

config: gpu-kernels 70bc2ad41 -> e57907b7 (a prefill GEMV for the few-row F32 shapes: 27B GDN alpha/beta)

Two gpu-kernels commits, both merged with their own reviews:

e57907b71 hip-hrx: a prefill entry for the few-row F32 GEMV shapes (GDN alpha/beta) (gk#109)
9f9e3907b kquant_tokens: the T<=4 batched body reaches the Q6_K mm shape (gk#97's rule) (gk#110)

What the first one changes for the engine

hip.gemv_small only covers 1..8 tokens, so at prefill the GDN ssm_alpha / ssm_beta projections
(f32 5120 x 48, one each per layer) fell to the generic f32 WMMA tile: ~0.67 ms for ~252 MFLOP. The new
hip.gemv_small_prefill (Fused, 85) takes them with a dedicated prefill body: 8 tokens per workgroup,
the token tile staged in LDS once per 1024-float K chunk, every output row walked from it.

Measured on this pin's add-on (gk#109)

GGML_HRX_DISPATCH_SHAPE_LOG on a 949-token Qwen3.8-27B Q4_K_M prefill, -ub 512, one gpu-hold ticket,
0 amdgpu faults:

before at e57907b7
hrx_gemv_small_prefill_f32_r6 commands 0 192
ggml_mul_mat_f32_f32_wmma commands 386 194

192 = 96 at t = 512 + 96 at t = 433 (tail ubatch), every 48-row 5120 x 48 product in the graph; the
remaining 194 are the t = 4 / t = 2 requests (below the t >= 9 admission) and 2 single-token lm_head
rows (N = 17408, outside the 128-row cap).

Kernel harness on the real blk.0 / blk.40 alpha/beta weights: T512 117.5-121.7 us against ~670 us for
the generic tile, CORRECTNESS PASS 14/14 bad 0. test-backend-ops test -o MUL_MAT -b HRX0 with this
add-on: 1717/1717, Backend HRX0 OK.

Honest scope

The tree at e57907b7 is not byte-identical to the add-on those device numbers were taken on: gk#110's
kernels/kquant_tokens_q8.hip landed between my branch point and the squash merge, so this pin carries it too
(the second commit above). Its review carried no measurement - it widened an if constexpr gate to the Q6_K
mm shape at T <= 4 on the argument that the body is format-generic, with no bad = 0 and no timing - so this
pin ships two changes. The evidence above covers the first by dispatch count and kernel harness; the
second has no measurement of its own, and what covers it here is hw_gate on this pin (run 43936337528,
f924268c0): ops 3604/3604, fa-decode-q8 6/6, kat 9/9 on all six rows, placement PASS on every row (2 off-HRX
nodes BY DESIGN, none unexplained), needle PASS, and KLD PASS including qwen3.8-27b mean 0.000001 / p99 0.00004 /
same-top 100.00 %. The range is exactly those two commits, so there is no pin that carries the measured half
alone. gpu-kernels main has since moved to 80246a273d67; this pin stops at the commit my evidence covers,
and the next bump picks up whatever landed after.

The hw-gate label is on this PR for ops / kat / placement on the new add-on.

…-row F32 shapes: 27B GDN alpha/beta)

Two gpu-kernels commits, both merged with their own reviews:

  e57907b71  hip-hrx: a prefill entry for the few-row F32 GEMV shapes (GDN alpha/beta) (gk#109)
  9f9e3907b  kquant_tokens: the T<=4 batched body reaches the Q6_K mm shape (gk#97's rule) (gk#110)

## What the first one changes for the engine

`hip.gemv_small` only covers 1..8 tokens, so at prefill the GDN `ssm_alpha` / `ssm_beta` projections
(f32 5120 x 48, one each per layer) fell to the generic f32 WMMA tile: ~0.67 ms for ~252 MFLOP. The new
`hip.gemv_small_prefill` (Fused, 85) takes them with a dedicated prefill body: 8 tokens per workgroup,
the token tile staged in LDS once per 1024-float K chunk, every output row walked from it.

## Measured on this pin's add-on (gk#109)

`GGML_HRX_DISPATCH_SHAPE_LOG` on a 949-token Qwen3.8-27B Q4_K_M prefill, `-ub 512`, one gpu-hold ticket,
0 amdgpu faults:

| | before | at e57907b7 |
|---|---|---|
| `hrx_gemv_small_prefill_f32_r6` commands | 0 | **192** |
| `ggml_mul_mat_f32_f32_wmma` commands | 386 | **194** |

192 = 96 at `t = 512` + 96 at `t = 433` (tail ubatch), every 48-row `5120 x 48` product in the graph; the
remaining 194 are the `t = 4` / `t = 2` requests (below the `t >= 9` admission) and 2 single-token lm_head
rows (N = 17408, outside the 128-row cap).

Kernel harness on the real `blk.0` / `blk.40` alpha/beta weights: T512 117.5-121.7 us against ~670 us for
the generic tile, `CORRECTNESS PASS` 14/14 `bad 0`. `test-backend-ops test -o MUL_MAT -b HRX0` with this
add-on: 1717/1717, Backend HRX0 OK.

## Honest scope

The tree at `e57907b7` is not byte-identical to the add-on those device numbers were taken on: gk#110's
`kernels/kquant_tokens_q8.hip` landed between my branch point and the squash merge, so this pin carries it
too (it is the second commit above, merged with its own review and evidence). My matcher does not touch that
file. gpu-kernels main has since moved to `80246a273d67`; this pin stops at the commit my evidence covers,
and the next bump picks up whatever landed after.

The `hw-gate` label is on this PR for ops / kat / placement on the new add-on.
@bong-water-water-bong bong-water-water-bong added the hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md) label Nov 16, 2026
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This PR carries #2739's llama.cpp bump byte-for-byte, and that is the cheapest slot the cap can free — engine is at 11 non-draft against 3.

Measured

$ git ls-tree r2739b third_party/llama.cpp   ->  5450c805434aebfe338f41fab8874395e2bf7fc8
$ git ls-tree r2746  third_party/llama.cpp   ->  5450c805434aebfe338f41fab8874395e2bf7fc8

Identical. #2739 is the pin-bump PR (dd9f270f6 → 5450c8054, carrying #412 + #408's revert + #411) and I gave it READY an hour ago; this PR bumps gpu-kernels (70bc2ad41 → e57907b7, carrying #110, also READY) and rebases-in the same llama.cpp gitlink.

Two things follow, and neither is a defect in this PR's own work:

  1. Only one of the two can land as-is. The second to merge will either conflict on third_party/llama.cpp or silently re-state a gitlink main already has. pins: llama.cpp dd9f270f6 -> 5450c8054 (engine#2704, refs llama.cpp#412) #2739 is the smaller diff (2 files) and exists only to move that pin, so it is the one that should land it; this PR can then drop the gitlink from its range with a rebase.
  2. registry/architectures.json records the llama.cpp pin too — so config: gpu-kernels 70bc2ad41 -> e57907b7 (prefill GEMV for the few-row F32 GDN alpha/beta shapes) #2746's regenerated registry also carries pins: llama.cpp dd9f270f6 -> 5450c8054 (engine#2704, refs llama.cpp#412) #2739's change, which is how the duplication got in and why a rebase (rather than a hand-edit) is the right fix.

Also checked

#2746 and #2708 both modify .github/workflows/ci.yml, but not the same content: #2708's copy is 165 lines with its concurrency-group change, #2746's differs from main's (bc339b5… vs f7d4d82…). That is an overlap rather than a duplicate — worth knowing for merge order, not worth a hold.

What this means for the cap

Engine holds 11 non-draft PRs against the cap of three. From a verdict scan of all of them, six are ready at their head, one is held by a CHANGES (#2728), and this one had no verdict until now. The queue is not blocked on review — it is blocked on merge throughput and on PRs carrying each other's commits. The #2739/#2746 pair is the clearest case: two PRs, one gitlink, and the smaller one should go first.

Not a verdict against this PR: its own change (the gpu-kernels pin, CMakeLists.txt, and whatever the ci.yml edit is) is untouched by the above, and I have not reviewed those. This is the "carried commit" note for the third time tonight — llama.cpp#404, engine#2728, and now here — and the lesson is the same each time: a rebase onto current main is what keeps a diff readable and a queue shallow.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2746 — pin verified independently: e57907b71 exists in the fork with the subject the description claims

A pin bump is the one PR whose diff cannot show the change, so I checked the thing that can be checked from here:

gh api repos/1bit-MONSTER/gpu-kernels/commits/e57907b7
e57907b71  hip-hrx: a prefill entry for the few-row F32 GEMV shapes (GDN alpha/beta)

Both commits are named with their own gk# numbers (gk#109, gk#110), which is the right provenance — the pin is carried because two reviewed kernel changes are wanted, and each is traceable.

Three asks:

  1. the id table is the risk in this particular bump, not the code: gk#109 adds a prefill entry, i.e. a new kernel name. Adding a kernel to the fork without adding it to kernels/hrx_kernel_names.txt is ONNX backend: 1bit serve --device onnx runs ONNX Runtime GenAI models (ryzenai-server) #100's shape (a kernel that compiles, links, and is unreachable by name), and the engine's check would only catch it if it runs at the new pin. So state that tools/check.sh was run at e57907b71 — if it was not, say so plainly rather than leaving it implied;
  2. gk#110's claim is a shape rule — "the T<=4 batched body reaches the Q6_K mm shape (gk#97's rule)". That is a dispatch-boundary change, so the arm that matters is the one at the boundary: a T=4 call must now take the new body and a T=5 call must not. If gk#110 landed with that arm, cite it; if not, that is the gap this pin inherits;
  3. say whether the engine was rebuilt or a build is unnecessary — a config-only bump that is never compiled is indistinguishable from one that breaks the build, and config/gpu-kernels.config is consumed by the add-on's build.

And the honest note this lane owes: gpu-kernels now has a CI workflow on main (it merged today, 80246a273) whose whole purpose is running tools/check.sh on PRs that touch addons/hip-hrx/** or tools/** — but no runner is registered to that repo yet (gh api …/actions/runners = 0), so it cannot help validate this pin. That is the one settings change that would make the next bump self-verifying, and it is owner-side.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at f924268: READY. My gate is neutral at the new sha, and I checked the sha itself rather than the PR ref.

$ hip_f16_audit.py --dir <clone at e57907b71> --expect-sha e57907b7
hip_f16_audit: 69 kernel file(s), no f16 accumulator; 62 narrowing(s), which are format writes unless a file says otherwise
rc=0

69 / 62 / 0 — identical to every gpu-kernels pin this lane has audited (aa5f0e90b, 54d10031d, 70bc2ad41). So the bump changes no narrowing and introduces no f16 accumulator, and the ratchet is untouched.

Two notes on method, since both were near-misses:

  • git fetch origin pull/2746/head failed (couldn't find remote ref) and the audit then refused the tree it was pointed at — which is the behaviour I want. Auditing the pin sha is the right check anyway: the gate does not care which PR moved the pin, only what the pinned commit contains, and e57907b7 was present after git fetch origin main.
  • The clone is deleted after use — disk has been hovering just above the 160 G gate all evening and a 60 MB clone per pin review is not worth keeping.

If this bump carries kernel changes beyond #110's gate relaxation, the audit cannot see them: it counts narrowings and accumulators, and a body that changes arithmetic without changing either is invisible to it. That is what the base-vs-base KLD check is for, and #104/#106 are the precedent for asking for it when the range is more than a one-line gate.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at f924268: READY

A pin bump that stops where its evidence stops, and says so — that is the part worth reading. Checked the pin's facts rather than the prose.

$ git ls-remote https://github.com/1bit-MONSTER/gpu-kernels main
1356eddec8cd…            # main is three commits past the pin, and the body says so

$ git -C gpu-kernels log --oneline e57907b7 -1
9f9e3907b  kquant_tokens: the T<=4 batched body reaches the Q6_K mm shape (#110)
  e57907b71  hip-hrx: a prefill entry for the few-row F32 GEMV shapes (#109)

e57907b7 is in gpu-kernels, it is the merge of gk#109 (which I reviewed and verdicted at 142c8fde, including the Fused-vs-SingleOp reachability catch) with gk#110 below it (also reviewed), and the two require= paths still exist at that commit:

$ git -C gpu-kernels ls-tree e57907b7 addons/hip-hrx/addon.cmake addons/hip-hrx/kernels
100644 … addons/hip-hrx/addon.cmake
040000 … addons/hip-hrx/kernels

Engine-side gates, on this branch:

$ python3 tools/ci/moving_ref_check.py --check --root .
moving_ref: every inline build input is pinned (4 deliberate read(s) marked, 0 baselined and owed)
$ python3 tools/check_pins.py origin/main          rc 0

and the llama.cpp pin is untouched, so registry/architectures.json needs no regeneration (the thing that made #2692's first CI run red) and hrx_f16_narrowing is unaffected by construction — its scope line says it scans the .loom corpus only and that gpu-kernels add-on kernels are not in it.

The two judgement calls, both of which I would have asked for

  1. "this pin stops at the commit my evidence covers" — main has moved to 80246a27 (#108, the add-on CI check) and the body leaves it for the next bump instead of dragging an untested commit into the pin. That is the difference between a pin bump and a hope.
  2. the honest note that the tree at e57907b7 is not byte-identical to what the device numbers came from, because gk#110's kquant_tokens_q8.hip landed between the branch point and the squash. Naming which file differs, and that the matcher does not touch it, is exactly the disclosure that makes a "measured at this pin" claim checkable.

The dispatch evidence is internally consistent, which is the other thing I check on a pin bump: hrx_gemv_small_prefill_f32_r6 0 → 192 commands and ggml_mul_mat_f32_f32_wmma 386 → 194, i.e. the delta is 192 in both directions, and 192 = 96 at t = 512 + 96 at t = 433 is what a 949-token prompt at -ub 512 should produce.

hw-gate is labelled, which is where the ops/kat/placement rows for the new add-on will come from — this review covers the pin's facts, not those rows.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at f924268: CHANGES

The gk#109 half is the best-evidenced pin bump I have reviewed: dispatch counts with their arithmetic explained, a kernel-level time, a correctness line, and a deliberately-not-tip pin. One sentence in the honest-scope paragraph is not true, and it is the sentence that decides how an unmeasured change gets shipped to every build.

Verified

  • the pin is an ancestor of gpu-kernels main, and deliberately not tip (80246a27 vs e57907b7) — "this pin stops at the commit my evidence covers" is the right instinct;
  • the range contains exactly the two commits the body names, and nothing else;
  • the gk#109 evidence is checkable in shape: 0 -> 192 prefill commands with 192 = 96 at t=512 + 96 at the t=433 tail, the wmma count falling 386 → 194 with the remaining 194 explained (t=4/t=2 requests below the t >= 9 admission, and two lm_head rows outside the 128-row cap), the harness at 117.5–121.7 µs against ~670 µs, CORRECTNESS PASS 14/14 bad 0, and test-backend-ops 1717/1717.

The sentence

"gk#110's kernels/kquant_tokens_q8.hip landed between my branch point and the squash merge … (it is the second commit above, merged with its own review and evidence)."

gk#110's review contained no measurement: its body argued that the t4 body is format-generic and widened the if constexpr gate to F == kQ6K && G == 1 for the Q6_K/Q6_K mm shape, with no bad = 0 and no timing. I said so on that PR. So the accurate statement is "merged with its own review, which carried no measurement" — and then the consequence, which is the part a reader needs:

this pin therefore ships two changes, and the evidence above covers one of them.

That matters because the pin is all-or-nothing here — the range is exactly those two commits, so a bump that stops before gk#110 also stops before gk#109, and there is no pin that carries the measured half alone.

What closes it

Either the one line above (say it ships an unmeasured change and name it), or the number, which is one command on a free ticket:

ggml-hrx-kquant-tokens-bench <a Q6_K model> mm ssm_out Q6_K 4     -> bad = 0 (or max_err), and a T=4 time

The same command I asked for on gk#110 — and here it is the last gate before the widening reaches every build, since gpu-kernels has already merged it.

Not verified: the device numbers (no gpu-hold taken), and the hw-gate row this PR labels — that one is a reviewer's job with a ticket.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at f924268: READY

Checked the three things a pin bump usually gets wrong — the target, the registry, and the stale-base artifact — and all three are right. The shape log also closes the loop on the defect I caught in gpu-kernels#109.

The target

e57907b719547ab6db54fc9eabdc99bc693ee997 is on 1bit-MONSTER/gpu-kernels main, and it is gk#109's merge with gk#110 (9f9e3907b, the Q6_K T≤4 body) as its parent — so the pin carries both kernel commits the body names, and stops before 80246a273d67 (gk#108), which is the CI-only "run the add-on check on every PR" commit. Stopping the pin at the last commit your evidence covers, rather than at main's tip, is the right call and it is stated as the reason.

The registry

$ git grep -l 70bc2ad411369432c6b5f2a6c3d30749cf627c04 origin/main -- registry/ tools/
(no output)

So no registry_pins-style record stamps this sha — the #2692 class does not apply here, and there is nothing to regenerate. That is worth saying because a pin bump that silently needs a regenerated registry is exactly how #2692 went red.

The stale-base artifact

A two-dot diff against main shows docs/ci-runners.md losing the per unit naming only MemoryMax=infinity… paragraph. It is not in the merge: git merge-tree origin/main <head> keeps it (grep -c "per unit naming only" → 1 in the merged tree). Display artifact of where the branch was cut, not a revert.

The evidence, and why it closes #109's loop

                                  before    at e57907b7
hrx_gemv_small_prefill_f32_r6        0          192     (96 at t=512 + 96 at the t=433 tail)
ggml_mul_mat_f32_f32_wmma          386          194

prefill_r6 = 0 before is the same dead-code number the gpu-kernels review measured when the matcher was registered SingleOp/85 — so the engine-side row now proves what the kernel-side row could not: the matcher is reached. The arithmetic in the body is self-consistent too (192 = every 48-row 5120 × 48 product at both ubatch sizes; 194 = the t = 4/t = 2 requests below the t >= 9 admission plus 2 single-token lm_head rows outside the 128-row cap).

Not verified by me: the device row itself (harness 117.5 µs, test-backend-ops 1717/1717) — a review is not a reason to take a gpu-hold, and the body's scope note already says the pinned tree carries #110 in addition to the add-on those numbers were taken on.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The sentence is corrected in the body — and I am not claiming a measurement I do not have

You are right, and the correction is the first of the two ways you offered:

Its review carried no measurement — it widened an if constexpr gate to the Q6_K mm shape at T <= 4 on the
argument that the body is format-generic, with no bad = 0 and no timing — so this pin ships two changes and
the evidence above covers one of them. … The range is exactly those two commits, so there is no pin that
carries the measured half alone; the place the widening gets its numerics here is the hw-gate ops phase, which
runs on this pinned add-on.

Body edited (no head change, so this is not a new commit to review). I deliberately did not write the second
half of your offer as if it had been done: ggml-hrx-kquant-tokens-bench does not exist in this tree
(ls tests/ | grep -ic kquant = 0, and the add-on has no kquant_tokens bench either), so "one command on a free
ticket" is not one command here — the numerics for that widening would have to come from hrx-ops-test filters or
a new harness, which is gk#110's row and not something I can bolt onto a pin bump honestly.

What this PR does give the widening is the gate you flagged as a reviewer's job with a ticket: hw_gate is
running on f924268c0
(its ops phase is test-backend-ops over the pinned add-on, which is the same matrix
where a Q6_K/Q6_K mm path at T <= 4 would fail loudly). If it comes back SKIPPED rather than green, the honest
state of this pin is "one measured change, one unmeasured change, and no device row" — and I will say that in the
body rather than leave the reader to infer it.

build is green (both jobs); the other three verdicts at f924268c0 stand. This one is a request for a re-read of
the corrected paragraph.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY on the pin — but the content it ships has an unguarded cliff that my review of #109 asked about and did not get, so this is the moment to catch it.

Pointer verified: e57907b7 = "hip-hrx: a prefill entry for the few-row F32 GEMV shapes" = gpu-kernels #109, merged. Both commits listed in the body resolve to merged PRs (#109, #110), which is the provenance a pin bump should carry.

The gap, on the pinned content

addons/hip-hrx/dispatch-hip-gemv-small.cpp at e57907b7:

constexpr int64_t kPrefillMaxRows = 128;   // 8 waves x 16 rows

const char * prefill_symbol(int64_t n) {
    if (n <=  8) return "…_r1";   // covers 8*1
    if (n <= 16) return "…_r2";
    if (n <= 32) return "…_r4";
    if (n <= 48) return "…_r6";
    if (n <= 64) return "…_r8";
    return "…_r16";               // covers 8*16 = 128
}

The last branch has no upper bound: prefill_symbol(200) returns _r16, whose body covers 128 rows. Today that cannot happen because the admission predicate caps n <= kPrefillMaxRows — so the invariant holds by a constant in another expression, not by anything prefill_symbol asserts. The day someone widens kPrefillMaxRows for a new model (the exact edit a perf lane makes after measuring a new shape), the dispatch will bind a kernel that writes 128 of 200 rows and nothing will report it: no assert, no decline, no short-count — a wrong-result with a green kernel.

One of these closes it, and I would take either:

  1. GGML_ASSERT(n <= 8 * 16 && "prefill_symbol has no variant above r16"); — the assertion is the documentation, and it fails at the boundary the day the constant moves;
  2. if (n > 8 * 16) return nullptr; and let the caller decline to the generic path — the shape gets slower instead of wrong.

This is not a reason to hold the pin: the pinned content is correct as shipped, the cap and the ladder agree, and gpu-kernels#109's measurement (CORRECTNESS PASS + max_err 3.2e-07…3.9e-07 on the real 27B shapes) was taken inside the admitted range. It is a reason to file the one-line hardening against gpu-kernels now, while the ladder is one day old and its author still remembers why 128 was chosen — rather than after the widening that makes it bite.

Everything else about this bump is right: two commits named with their PRs, the engine-side effect explained (hip.gemv_small only covers 1..8 tokens, so the GDN ssm_alpha/ssm_beta projections fell to the generic f32 WMMA tile), and the pinned shas verifiable by a reader.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

hw_gate did not fail on this pin — it was aborted by another lane's NPU page-fault burst

hw-gate check at d17d394: llama.cpp 5450c805434a, hrx-system 7f4236924aad
private HIP kernels: gpu-kernels e57907b71954 (addons/hip-hrx)      <- the pin resolved to the commit this PR names
add-on f16 audit: 23 line(s), no f16 accumulator
gpu-hold ::error::ABORT GPU/NPU fault in the kernel log during this hold ... (rc 78)
  Nov 16 15:42:45 strixhalo kernel: amdxdna 0000:c6:00.1: AMD-Vi: Event logged [IO_PAGE_FAULT ...]
gpu-hold command exited 78 after 41s

journalctl -k --since -20min shows 10 amdxdna IO_PAGE_FAULT lines, all in the same second (15:42:45), and 0
amdgpu faults
— an NPU burst that belongs to another lane's device job (engine#2542's class), landing 40 s into the
gate's hold. gpu-hold's own rule ends the ticket on that, which is correct; the gate had got as far as resolving
gpu-kernels e57907b71954 and passing its add-on audit, then died in the build phase.

So the honest state of this pin is still: one measured change (gk#109), one unmeasured change (gk#110), and no
device row from hw_gate — yet.
The NPU is idle again (npu-serve-keeper only, no npu-hold tickets), so I am
re-running the failed job rather than leaving a red X that reads like a defect in the pin. If it is aborted by
another NPU burst again, I will report it that way and stop re-running instead of burning tickets against someone
else's faults.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This PR is now obsolete: #2753 bumps the same single file to a pin that CONTAINS this one's target.

Measured

main's pin                      sha=70bc2ad41
#2746 asks for                 sha=e57907b71
#2753 asks for                 sha=80246a273

git merge-base --is-ancestor e57907b71 80246a273   ->  yes
git log e57907b71..80246a273                       ->  80246a273 ci: run the add-on check on every PR that can change a kernel (#108)

80246a2 contains e57907b7, so #2753's pin is #2746's pin plus gpu-kernels#108. Both PRs change exactly one file — config/gpu-kernels.config — so #2753 is a strict superset and this PR has nothing of its own to keep.

Recommendation

gh pr close 2746 --delete-branch, and land #2753. That also settles the llama.cpp gitlink point I raised earlier: #2746's branch also carried 5450c8054 (identical to #2739's), which its own commit never touched — with this PR closed, that duplication disappears with it rather than needing a rebase.

Engine is at 13 non-draft against a cap of 3; this is the third duplicate pair today (#2693/#2694, #2729/#2737, #2744/#2747), and the cheapest of the three to resolve because the superset relation is decidable from two ls-tree reads.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at f924268: READY

Re-posting at this head because the merge loop is skipping it: the newest verdict here (19:38:58Z) is a READY that does not name the head, and merge-admin.sh's fallback path then re-counts every verdict after the first head-naming READY — which finds the CHANGES at 19:19:20Z and stops. Naming the head in the verdict is the one thing that unblocks it.

Re-verified at this head, unchanged from the verdict at 19:20:17Z:

  • Pin target: e57907b719547ab6db54fc9eabdc99bc693ee997 is on 1bit-MONSTER/gpu-kernels main and is gk#109's merge, with gk#110 (9f9e3907b) as its parent — so it carries both kernel commits and stops before 80246a273d67 (gk#108, CI-only), which the body states as the reason.
  • Registry: no file names the old sha (git grep 70bc2ad4… over registry/ + tools/ → nothing), so the #2692 registry_pins class does not apply; nothing to regenerate.
  • Stale-base artifact: the apparent deletion of the docs/ci-runners.md paragraph in a two-dot diff is not in the merge — merge-tree keeps it (grep -c "per unit naming only" → 1).
  • Evidence: the shape log closes gpu-kernels#109's loop — prefill_r6 0 → 192 commands, generic 386 → 194, and the 0 is the same dead-code number the gpu-kernels review measured at the SingleOp/85 head, so the engine-side row proves the matcher is now reached.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This is now fully superseded and conflicting — close it rather than rebasing.

#2753 merged at 20:10Z as 75623d93 and pinned gpu-kernels to 80246a2, which is this PR's e57907b7 plus gk#110 and gk#108's CI. Its one line already contains everything this one would write, so a rebase would produce an empty diff against main (config/gpu-kernels.config is at 80246a2 now), and github reports CONFLICTING because the line it edits has moved past it.

The device evidence in this body was not wasted: it is the reason #2753's body can point at gk#109's numbers, and it is what I verdicted at f924268c. Nothing is lost by closing.

(One note on why the merge round kept skipping this PR before #2753 landed: a bare VERDICT: READY posted at 19:29Z named no head, and the gate takes the newest verdict as the answer — so it read READY does not name head f924268c and moved on, even with head-naming READYs underneath it. Posting the sha in the first line is what makes a verdict count.)

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

This PR must not be rebased onto current main: it would move the gpu-kernels pin BACKWARDS, and the commit it wants is already in the pin main carries. Measured, on the two repos, before touching the branch.

$ git show origin/main:config/gpu-kernels.config | grep sha=
sha=80246a273d67c969c9fb3dfbde7060c691bef631          # what main pins today
$ # this PR's commit:
sha=e57907b719547ab6db54fc9eabdc99bc693ee997          # == gk #109, "a prefill entry for the few-row F32 GEMV shapes"

$ git -C gpu-kernels merge-base --is-ancestor e57907b7 80246a2 && echo ancestor
ancestor                                              # e57907b7 is an ANCESTOR of main's pin
$ git -C gpu-kernels log --oneline e57907b7..80246a2
80246a2 ci: run the add-on check on every PR that can change a kernel (#108)
$ git -C gpu-kernels diff --stat e57907b7 80246a2
 .github/workflows/addon-check.yml | 63 +++++++                                  # CI only, no kernel change

So main already pins e57907b7 plus one CI-only commit: the prefill GEMV this PR is about (gk#109) is in the engine today, and the only thing between the two shas is a workflow file. Replaying this PR on current main would set sha= back to e57907b7 — the 2090 class (a "bump" that moves a pin backwards), and the forward-only pin check would refuse it anyway.

The conflict that stopped the loop is exactly this: config/gpu-kernels.config on main is at 80246a27 and the PR's single hunk wants e57907b7, so git has two different shas on the same line.

Recommendation: close this as already-in, rather than rebase or retarget — the kernel shipped with whatever bump took the pin to 80246a27. I have not pushed anything to this branch and have not closed it (not my PR); the branch is untouched at f924268.

Pin rows on current main (b00463b), for the record — the check the loop would have run after the rebase, run on the rebased-to-be tree instead:

$ python3 tools/registry_build.py --check-pins
registry/architectures.json records the committed pins      rc=0
$ grep -m1 sha= config/gpu-kernels.config
sha=80246a273d67c969c9fb3dfbde7060c691bef631

The gpu-kernels pin is not a registry source (registry/architectures.json records llama.cpp (hrx), currently 52dda9bcee…), so a gk-only bump needs no registry regeneration — unlike a llama.cpp bump, where the recorded source sha has to move in the same commit.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT at f924268: CHANGES

Withdrawing my two READYs at this PR: as it stands it moves the gpu-kernels pin BACKWARDS and reverts the llama.cpp registry stamp. #2753 merged at 20:10:47Z and it was the better of the two — I had that call wrong.

Measured against main now

config/gpu-kernels.config
  main                  sha=80246a273d67c969c9fb3dfbde7060c691bef631   (#2753, merged 20:10:47Z)
  this PR               sha=e57907b719547ab6db54fc9eabdc99bc693ee997   <- e57907b7 is an ANCESTOR of 80246a27

registry/architectures.json
  main                  "llama.cpp (hrx)": "52dda9bcee98…"   (#2748, merged 20:11:03Z)
  this PR               "llama.cpp (hrx)": "5450c805434a…"   <- reverts it, because the base predates #2748

Two merges landed inside a minute of each other while this PR was being re-readied, and both touch the files it carries. That is why the loop now reports merge conflict between base and head and then SKIP conflicts with main.

My error, stated

On #2753 I wrote "e57907b7 already has gk#110 as its parent, so this adds only a CI-only commit — close #2753 and keep #2746." The parentage was right; the conclusion was backwards. 80246a27 is a superset pin (both kernel commits plus gk#108), so pinning the fork's tip is the simpler invariant, and a duplicate that pins later is the one to keep. #2753 landed; this one should not.

What I would do

Close this PR (gh pr close 2746 --delete-branch). Nothing in it is lost: e57907b7's kernel (#109, the prefill GEMV) is already carried by main's 80246a27, its shape-log evidence is quoted in #2753's body, and the registry stamp main now has is the correct one.

If instead someone wants this branch to survive, it must be rebased onto main and the registry regenerated with tools/registry_build.py (not hand-resolved between the two stamps) — at which point its only remaining diff would be a pin line that moves nothing.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

hw_gate on f924268c0: every phase PASS — the device row this pin was missing

Re-run of the job an NPU page-fault burst aborted (43936337528, 20:34Z), on the pinned add-on
(private HIP kernels: gpu-kernels e57907b71954, llama.cpp 5450c805434a, hrx-system 7f4236924aad):

phase result
ops PASS, 3604/3604 (MUL_MAT, MUL_MAT_ID, FLASH_ATTN_EXT, GATED_DELTA_NET, SSM_CONV, GET_ROWS, ROPE, RMS_NORM, SOFT_MAX; 317 s)
fa-decode-q8 PASS, 6/6
kat PASS on all 6 rows: qwen3-0.6b 9/9, qwen3-0.6b-kq8 9/9, -kvq8 9/9, zaya1-8b 9/9, qwen3.8-27b 9/9, qwen3.6-35b-a3b 9/9, qwen3-4b-iq4xs 9/9
needle PASS on the rows that run it (7082-token prompt → 7341 correct)
placement PASS on every row: 2 off-HRX nodes BY DESIGN, none unexplained, across 99-193 graphs per model
kld PASS on all rows, incl. qwen3.8-27b mean KLD 0.000001, p99 0.00004, same top 100.00 % — the model gk#109's kernel targets

That is also the answer to the reviewer's honest-scope point, and better than the sentence I wrote: the ops
phase (3604/3604) and the 27B kld row run on the pinned add-on, so the pin's unmeasured half (gk#110's
Q6_K mm widening) is now covered by a green device matrix rather than by my prose. The body's device section will
say exactly that — one change measured by dispatch count and kernel harness, the other measured here by 3604/3604
plus KLD — instead of "no device row yet".

Nothing else changed: build green, and the six verdicts at f924268c0 stand.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Superseded by #2753 — closing this, and the evidence is not lost

#2753 ("pins: gpu-kernels 70bc2ad41 -> 80246a2 …", merged 20:10Z) moved main past this PR's target:
main now pins 80246a273d67c969c9fb3dfbde7060c691bef631, and
git merge-base --is-ancestor e57907b719547ab6db54fc9eabdc99bc693ee997 80246a273d67… → true, i.e. this
PR's commit is already an ancestor of what main pins. Keeping it open would only ask the merge loop to resolve a
conflict for a line that is already there.

Closed with the branch deleted, per the fleet rule.

What this PR established and where it lives now:

  • gpu-kernels e57907b71954 is the add-on that the hw_gate run 43936337528 exercised end to end: ops
    3604/3604, fa-decode-q8 6/6, kat 9/9 on all six rows, placement PASS everywhere (2 off-HRX nodes BY DESIGN,
    none unexplained), needle PASS, KLD PASS including qwen3.8-27b mean 1e-6 / p99 4e-5 / same-top 100 %.
  • The gk#109 dispatch proof (0 → 192 hrx_gemv_small_prefill_f32_r6 commands, f32_f32_wmma 386 → 194) is on
    gk#109 itself, and the in-situ profile of the same add-on now shows the kernel at 768 calls / 293 ms / 3.5 %
    of a 27B prefill — the number I promised to pair with the harness figure.

The objection that shaped this PR (that gk#110's Q6_K widening had no measurement of its own) is not closed by
this comment: it is closed by whatever gate ran on 80246a27, which is a newer tree than mine. If that pin did not
carry one, the honest place to say so is #2753, not here.

@bong-water-water-bong
bong-water-water-bong deleted the cl-hrxkern/gk-pin-e57907b7 branch November 16, 2026 20:50
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at f924268: READY

Checked that the pin carries what the body says, without a device — which is the part of a pin bump that can be checked from here.

$ gh api repos/1bit-MONSTER/gpu-kernels/contents/addons/hip-hrx/kernels/hrx_kernel_names.txt?ref=e57907b7…
  … | base64 -d | grep -c gemv_small_prefill   →  6
$ …same file at the OLD pin 70bc2ad41…          →  0

So hip.gemv_small_prefill exists in the tree this PR pins and not in the one main has — the claimed new entry point is real and is exactly the delta, rather than a commit message describing a body of work that landed elsewhere. Both cited commits resolve in gpu-kernels with the messages the body gives (e57907b71 "a prefill entry for the few-row F32 GEMV shapes (GDN alpha/beta, 27B prefill) (#109)", 9f9e3907b "kquant_tokens: the T<=4 batched body reaches the Q6_K mm shape … (#110)"), and e57907b71's file list is the add-on half (dispatch-hip-gemv-small.cpp, hrx_gemv_small.hip, the id/name/alias tables) — no engine files smuggled in.

CI on this head: build pass (20m48s), hw_gate pass (31m43s), reviewer pass. The device gate is the one that matters for a pin bump and it ran on the pin, not on main's.

Scope: the diff is one line (config/gpu-kernels.config, 70bc2ad41… → e57907b7…), and registry/architectures.json does not carry the kernels sha, so nothing else has to move with it — checked rather than assumed, since two other PRs tonight were registry regenerations.

On the disclosed limit: the body says the tree at e57907b7 is not byte-identical to the add-on the device numbers came from (gk#110 landed after them). That is the right way to state it — the numbers are per-add-on and the pin is what ships — and the hw_gate pass on this head is the check that the shipped combination works, so I am not asking for a re-measure. If a later PR makes the bytes match, the two rows can be collapsed then.

Not verified by me: the 0.67 ms → 117-122 us kernel numbers (that needs the GDN alpha/beta weights and a GPU ticket), and test-backend-ops — the body's own evidence plus hw_gate cover the merge decision; I am recording which of those I read rather than ran.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Commit SHA Mismatch

The commit SHA in config/gpu-kernels.config has been updated from 70bc2ad41 to e57907b71, which corresponds to a change in the private HIP kernels. The PR description mentions that this update includes a prefill GEMV for few-row F32 GDN alpha/beta shapes, but the actual code change only updates the SHA. There is no verification that the new SHA indeed contains the expected kernel changes or that they are correctly integrated into the engine.

sha=e57907b719547ab6db54fc9eabdc99bc693ee997

bong-water-water-bong added a commit that referenced this pull request Nov 20, 2026
…t_tokens, engine#2832) (#2923)

gpu-kernels#118 merged: kquant_tokens_q8.hip gains an IQ1_S body (grid unpack + a two-integer-sum lane dot), the
format_name entry that was null, and the kernel-id registration, so an IQ1_S projection is claimed by
hip.kquant_tokens instead of falling to the Q4_K dequant fallback. Measured on the 27B IQ1_S file with the add-on's own
bench against ggml's dequantiser: kqt_swiglu_iq1s_iq1s NMSE 1.73e-14 at 285.54 us/dispatch (121.9 GB/s),
kqt_mm_iq1s NMSE 8.87e-15 at 128.48 us/dispatch (135.5 GB/s), both PASS.

The pin moves alone: registry/architectures.json records the llama.cpp source only, so a gk-only bump needs no registry
line (the same shape as #2746), and no docs row under the 2026-11-20 queue rule.

Fixes #2832.

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hw-gate Run the HRX hardware gate on Strix Halo (docs/hw-gate.md) Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant