Skip to content

pins: llama.cpp 5450c8054 -> 52dda9bce (engine#2704, refs llama.cpp#415, #414) - #2748

Merged
bong-water-water-bong merged 1 commit into
mainfrom
cl-856/2704-pin-2
Nov 16, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
cl-856/2704-pin-2

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Second pin bump of the day, and the one that makes this lane's TOP_K fix real. 5450c8054 -> 52dda9bce, two merged fork commits:

fork sha what
2af6b0df1 #415 (this lane): device_supports_op's TOP_K early return now also requires eager_capability_declared(GGML_OP_TOP_K), so the claim follows the registration instead of a shape test
52dda9bce #414 (another lane, follow-up to my #412): the routed GET_ROWS matcher asks the same shared predicate, so the routed form is stated in one place too

Both are merged, so unlike the first bump there is no "excluded because unmerged" line to explain.

Why the TOP_K change matters beyond tidiness

On a build without the hip_top_k_f32 code object nothing registers the op (register_hip_top_k_dispatch returns before hip_declare_eager_op), while the old early return claimed every well-shaped TOP_K anyway — the engine#2639 shape: claimed, then unsupported HRX node … TOP_K, graph_compute -1, no CPU fallback. Measured on a build constructed for it (kernel source moved aside, embedded table 0 entries against 1):

                       shape  eager  registry | before  after
no-object build         yes     no     no     | CLAIM   decline
shipped build           yes     yes    yes    | CLAIM   CLAIM

The second row is the control: where the object exists, before and after are identical, and GGML_HRX_HIP_TENSOR_CLAIM=0 and GGML_HRX_DISABLE_DISPATCH=hip.top_k_f32 both measure identical to default. The conjunction can only ever remove a claim.

The bump itself

 registry/architectures.json | 2 +-     "llama.cpp (hrx)": 5450c8054… -> 52dda9bce…
 third_party/llama.cpp       | 2 +-     the gitlink

Regenerated, not hand-edited: tools/registry_build.py → counts unchanged (hrx 350, npu 9), and --check, --check-pins, copyright --check all pass at 52dda9bce.

Refs engine#2704, Refs llama.cpp#415, Refs llama.cpp#414

…15, #414)

Two merged fork commits reach the build:

  2af6b0df1  #415 (this lane): device_supports_op's TOP_K early return now also requires
             eager_capability_declared(GGML_OP_TOP_K), so the claim follows the registration. Measured on a
             build without the hip_top_k_f32 code object (shape yes / registry no / eager no): before the
             change it claimed a node nothing could execute, after it declines and the CPU serves it.
  52dda9bce  #414 (another lane, follow-up to my #412): the routed GET_ROWS matcher asks the same shared
             predicate, so the routed form is stated in one place too.

Both are merged, so this is a plain pin: no unmerged branch rides along.

registry/architectures.json regenerated by tools/registry_build.py: one line, counts unchanged (hrx 350,
npu 9). --check, --check-pins and copyright --check all pass at 52dda9bce.

Refs engine#2704
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

ready for review at 55b761c. Same recipe as the first bump, verified before opening: the branch is the gitlink plus one regenerated registry line, --check/--check-pins/copyright clean, counts unchanged (hrx 350, npu 9). Both commits it carries are merged (#415 mine, #414 another lane's follow-up to my #412), so there is no unmerged-branch caveat this time. The behaviour claim is in #415's own thread: the TOP_K claim now follows the registration, measured on a build without the hip_top_k_f32 code object (claimed -> declined) with the shipped build as an identical-before-and-after control.

@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 55b761c: READY

This is the pin bump I flagged as unowned an hour ago, and it is done the way the #2692 lesson requires: regenerated, not hand-edited, and pinned to the fork tip rather than to a convenient commit.

The three things I check on a pin bump

target        52dda9bce  == 1bit/hrx-vulkan-patched tip
              52dda9bce  the routed GET_ROWS matcher asks the shared predicate (#414)
              2af6b0df1  a TOP_K claim requires the registration (#415)
              …          5450c8054 the shared GET_ROWS predicate (#412) already in the base
registry      registry/architectures.json moves its `sources` line to the new sha, and the only line that moves is
              that one — counts stay `hrx 350`, which is what a *regeneration* produces when the only input change
              is the pin. Hand-editing the number would have left the rest stale, which is exactly what #2692 was.
shape         2 files, 2 lines: the gitlink and the generated source stamp.

--check-pins passing is the weaker half; the strong half is that the regenerated file differs from main only in the source sha, so the fork's architecture surface is provably unchanged by these two commits (both are dispatch-side).

Why #415 is worth its two lines

The TOP_K early return claimed every well-shaped node, while on a build without the hip_top_k_f32 code object nothing registers the op — claimed, then unsupported HRX node … TOP_K, graph_compute -1, no CPU fallback. That is engine#2639's exact shape in a different op, and the fix is the right kind: a conjunction with the registration, which can only remove a claim. The two-row table is the right evidence — no-object build: CLAIM → decline, shipped build: CLAIM → CLAIM — because the second row is the control that proves nothing that worked stopped working, and the body says the three disable knobs measure identical to default.

What this makes true that was not, an hour ago

#412 merged at 5450c8054 and #414 merged as 52dda9bce — until this PR both were dead code in the fork: the box still ran dd9f270f6, two commits before #408's revert. So the GET_ROWS over-claim that #408 reverted and #412/#414 replaced reaches the engine for the first time with this merge, and the pin is the last link in a chain that took four PRs and three reviews today.

Not verified: the device row for #415's claim (their constructed no-object build) — a review is not a reason to take a gpu-hold, and the two shapes it measures are the ones a build list, not a device, decides.

@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 55b761c: READY

Verified by checking the submodule out at the new pin and running the two gates the bump can break — the registry (content, not just the sha) and the f16-narrowing corpus.

$ git ls-remote https://github.com/1bit-MONSTER/llama.cpp refs/heads/1bit/hrx-vulkan-patched
52dda9bcee98…            # the pin IS the branch tip

$ git -C third_party/llama.cpp log --oneline 5450c8054..52dda9bce
52dda9bce  hrx: the routed GET_ROWS matcher asks the shared predicate too (engine#2704) (#414)
2af6b0df1  hrx: a TOP_K claim requires the registration, not only the shape (engine#2704) (#415)

Both are merged, which the body says and the log confirms — that is the difference from this morning's bump, where one commit had to be excluded with a paragraph of explanation.

The two gates, at the pin

$ python3 tools/registry_build.py --check-pins
registry/architectures.json records the committed pins            rc 0
$ python3 tools/registry_build.py --check
registry/architectures.json matches the pinned sources            rc 0

$ python3 tools/ci/hrx_f16_narrowing.py --check --root .
hrx_f16_narrowing: 84 narrowing body(ies), none new, none stale; 22 f16 accumulator body(ies), none new,
                   none stale; 11 of the narrowing bodies carry a guard marker          rc 0

--check is the important one: --check-pins only compares the recorded sha, and a hand-edited architecture list passes it. Full regeneration from the pinned sources matches the committed file, so the one-line sources change is the whole effect of the bump on the registry — #415 and #414 change matcher and registration logic, not any LLM_ARCH_*, which is what the counts staying at hrx: 350 says.

And the narrowing corpus is unchanged at the new pin, which is the other thing a llama.cpp bump can move (it did for #410). The add-on .hip audit the tool's scope line warns about is gpu-kernels-side and belongs to #2746, not here.

What the pin buys, since a pin bump should be readable

#415 makes device_supports_op's TOP_K claim conditional on eager_capability_declared(GGML_OP_TOP_K) — the claim follows the registration rather than a shape test, so a build without the hip_top_k_f32 object no longer claims every well-shaped TOP_K and then fails at dispatch. #414 does the same for the routed GET_ROWS matcher. Both are "the predicate is stated in one place" changes, which is why they are safe to pin together and why the correctness question is a placement question, not a kernel one.

Refs engine#2704 is right — the device rows for the routed/TopK paths are the lane's to run, and none of them are claimed here.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT: READY 2748

A second pin bump in one day is worth a sentence of justification, and the description gives it: "the one that makes this lane's TOP_K fix real." A pin that carries a fix is different from a pin that drifts, and saying which is which is the whole review surface for this PR shape.

Three asks:

  1. name the two gk# numbers as config: gpu-kernels 70bc2ad41 -> e57907b7 (prefill GEMV for the few-row F32 GDN alpha/beta shapes) #2746 did (gk#109/gk#110 there) — the commit subjects are the only reviewable content, and a pin bump whose description does not list them pushes that work onto the reviewer;
  2. say whether check.sh ran at THIS pin — config: gpu-kernels 70bc2ad41 -> e57907b7 (prefill GEMV for the few-row F32 GDN alpha/beta shapes) #2746's bump added a prefill entry (a new kernel name), and if this second bump stacks on it, the id table is the thing that can silently disagree. Both bumps together are exactly the case where "it built" is not "it is wired";
  3. if both fetches land in sequence, check the intermediate state — 5450c8054 → e57907b7 → 52dda9bce means main will hold a commit that was never validated with check.sh if neither PR ran it. One line saying which pin was actually exercised is enough; leaving it unsaid is how a gap gets merged twice.

And a note on sequencing: two pin PRs from the same lane in one day should probably be one PR or a rebase of each other — the merge loop squash-merges, so the second may land without the first's context in its own diff.

@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

Pointer verified at the content, not the badge: 52dda9bce = "hrx: the routed GET_ROWS matcher asks the shared predicate too" = llama.cpp #414, merged — and the arm pair I asked for on that PR is on the pinned tree, which is the thing a pin bump decides:

tests/test-hrx-get-rows-facts.cpp  (at 52dda9bce)
  expect(get_rows_route_table_form_supported(route_table()),    true,  "routed: route-table form");
  expect(get_rows_contiguous_form_supported(route_table()),     false, "routed: contiguous form must refuse…");

That is exactly the mutation guard the ask was for: the routed facts are true through their own predicate and false through the contiguous one, so a future "one predicate is simpler" refactor cannot silently move every routed GET_ROWS to the CPU. Verified by reading the pinned content rather than trusting the merge.

With #412 and #414 both in, engine#2704's claim holds at both forms for the contiguity and id-column conditions; the four conditions the facts struct does not carry (output->type, two is_2d, is_1d_or_2d_column) remain matcher-only, and that is the documented remainder rather than a silent one.

One line worth adding to the body: what this pin changes for the engine, if anything (a matcher the engine's own dispatch table now agrees with), because a pin bump whose only content is a matcher predicate can look like a no-op to a reader deciding whether to merge it before or after #2746.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

VERDICT at 55b761c2: READY — the pin is internally consistent, points at the branch tip, and both claimed fork commits are genuinely inside it.

Checked, not taken on trust:

gitlink third_party/llama.cpp   -> 52dda9bce
registry/architectures.json     -> 52dda9bce        # no registry-vs-gitlink drift
git ls-remote fork: refs/heads/1bit/hrx-vulkan-patched -> 52dda9bce4…   # the pin IS the branch tip
gh pr view 415 -R 1bit-MONSTER/llama.cpp -> MERGED, merge commit 2af6b0df1
gh pr view 414 -R 1bit-MONSTER/llama.cpp -> MERGED, merge commit 52dda9bce

and the ancestry the body implies — that #415 is inside the pin and not merely earlier than it — which a merge-commit list cannot show:

git fetch --depth 25 --filter=blob:none origin 1bit/hrx-vulkan-patched
git merge-base --is-ancestor 2af6b0df1 FETCH_HEAD   -> yes

The TOP_K clause reads right. register_hip_top_k_dispatch returns before hip_declare_eager_op when the hip_top_k_f32 code object is not embedded, so the old early return claimed every well-shaped TOP_K while nothing could execute it — precisely the engine#2639 shape (claimed, then unsupported HRX node … TOP_K, graph_compute -1). eager_capability_declared(GGML_OP_TOP_K) && makes the claim follow the registration instead of predicting it, and I like that the same predicate is now shared with the routed GET_ROWS matcher (#414) — one place to state the accept rule.

Two notes, neither blocking:

  1. This bump now depends on the engine's own registry checks agreeing with the fork, and main gained registry_content (ci: registry content is never checked — a hand-edited architectures.json merges green (registry_pins compares only the recorded sha) #2698) today, so the build job will check the regenerated registry against the pinned fork rather than only the sha — worth watching that row rather than the pin line alone.
  2. Nothing here needs the device: the TOP_K path only matters on a build without the code object, which is a configuration the host hrx_build job can produce but the gate's device run does not exercise. If a red appears on a box build later, this clause is where to look.

@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
bong-water-water-bong merged commit b2fd9b4 into main Nov 16, 2026
12 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the cl-856/2704-pin-2 branch November 16, 2026 20:11
bong-water-water-bong pushed a commit that referenced this pull request Nov 16, 2026
…(engine#2757)

Two holes in my own change, both found by asking what happens when the comparison
itself fails rather than what happens when it succeeds.

1. A `git fetch` failure under `set -e` killed the preflight job, its output was
   empty, and the device job then read "not 1" and SKIPPED -- on a pin PR. That is
   the silent hole this change exists to close, wearing a green tick. Now any
   failure in the comparison says moved=1 with a ::warning:: and lets the gate run:
   the expensive direction is the safe one. Simulated with a bogus base ref:
   rc 0, output moved=1, warning printed.

2. `if git diff ... | grep -q .` under `pipefail` reports grep's early-exit SIGPIPE
   as the pipeline's status when the diff is large, which would have made a
   pin-moving PR read as "no pin". The diff is captured first and tested after, so
   the only failure that can reach the fail-closed path is the comparison itself.

Positive path re-checked on real refs here: #2748 -> moved=1
(third_party/llama.cpp), #2756 -> moved=0.
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2704 - Partially compliant

Compliant requirements:

  • The PR updates the llama.cpp submodule to a version that includes the necessary changes to align device_supports_op with the matcher logic, specifically for TOP_K and GET_ROWS operations.
  • The architecture registry is updated to reflect the new commit hash.

Non-compliant requirements:

  • The PR does not include the new dispatch_accepts query function or the corresponding tests in tests/hrx-backend-test.cpp.
  • The PR does not remove the hand-written declines from device_supports_op as part of the fix.

Requires further human verification:

  • Verification that the updated device_supports_op logic correctly consults the new dispatch acceptance logic for the affected operations.
  • Confirmation that the removal of hand-written declines is done correctly and does not introduce regressions.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Outdated Commit Hash

The commit hash in registry/architectures.json has been updated to reflect the new llama.cpp version, but the PR does not include the actual functional changes required to align device_supports_op with the matcher logic. This update alone does not address the core issue described in the ticket.

"llama.cpp (hrx)": "52dda9bcee98676394618710d4136af69aaceea1"

bong-water-water-bong added a commit that referenced this pull request Nov 16, 2026
…ee the diff (engine#2757) (#2759)

* hw-gate: run for any PR that moves a pin, decided by a cheap job that can see the diff (engine#2757)

#2739 and #2748 -- lane pin bumps of third_party/llama.cpp -- merged 11-16 with hw_gate skipped,
so the one change that moves the whole HRX backend under every row on the box was gated by build
and CodeQL only. A skipped workflow reads as "not applicable" on a PR that already looks green.

The fix cannot be a paths: filter on the trigger, which is what the issue proposed: the job's own
if: still refuses (a lane branch has neither the label nor the bump-hrx/ prefix), so the filter
would change nothing visible -- and, with the job if: unchanged, it would also retire the label as a
way to gate a PR that touches no pin.

So the decision moves to a job that can see the diff. pin_moved is a hosted ubuntu job: full
checkout, one `git diff --name-only <base>...HEAD` over the pin carriers, an output. The device job
gains `needs: [pin_moved]` and one more accept-clause, and keeps the label and bump-hrx/ routes.

Measured against real refs on this box (the workflow's own diff command):

  #2748 (lane pin bump)  -> third_party/llama.cpp           moved=1
  #2753 (gk bump)        -> config/gpu-kernels.config       moved=1
  #2756 (no pin)         -> (nothing)                       moved=0

config/gpu-kernels.config is in the list because third_party/gpu-kernels does NOT exist: the kernel
pin is a FILE (sha= in that config, fetched privately), so a gk bump never touches a gitlink. A
re-recorded golden is listed too: #2502 was exactly that, and the gate compares against it.

* hw-gate: the preflight fails CLOSED, and an empty diff is not a move (engine#2757)

Two holes in my own change, both found by asking what happens when the comparison
itself fails rather than what happens when it succeeds.

1. A `git fetch` failure under `set -e` killed the preflight job, its output was
   empty, and the device job then read "not 1" and SKIPPED -- on a pin PR. That is
   the silent hole this change exists to close, wearing a green tick. Now any
   failure in the comparison says moved=1 with a ::warning:: and lets the gate run:
   the expensive direction is the safe one. Simulated with a bogus base ref:
   rc 0, output moved=1, warning printed.

2. `if git diff ... | grep -q .` under `pipefail` reports grep's early-exit SIGPIPE
   as the pipeline's status when the diff is large, which would have made a
   pin-moving PR read as "no pin". The diff is captured first and tested after, so
   the only failure that can reach the fail-closed path is the comparison itself.

Positive path re-checked on real refs here: #2748 -> moved=1
(third_party/llama.cpp), #2756 -> moved=0.

* hw-gate: the preflight's warning reaches the log, and moved=1 is written once (engine#2757)

The reviewer's CHANGES is right and it is the same silent-hole class one level down:
`changed=$(git diff … || fail_closed)` runs fail_closed in a command substitution, which
exits only its own subshell and CAPTURES its stdout. So the ::warning:: (which GitHub reads
from the step's stdout) was swallowed -- the gate would run on the day it could not compare
and nothing in the log would say why -- and the captured warning text then read as "changed",
writing moved=1 a second time. Right answer, invisible reason.

Reproduced standalone before changing anything:

  captured changed=[::warning::pin_moved could not compare]
  GITHUB_OUTPUT: moved=1
                 moved=1

Now fail_closed runs in the main shell and the herestring is gone: `if ! changed=$(…); then
fail_closed; fi` then `[ -n "$changed" ]`. Three paths exercised after the change:

  fail   -> ::warning:: printed in the log, output moved=1 (once)
  pin    -> "this PR moves a pin: the gate runs",  moved=1
  nopin  -> "no pin moved: …",                     moved=0

---------

Co-authored-by: bong-water-water-bong <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The hw-gate run this PR's body promised has finished, and it passed.

run 43947095282   head 55b761c2a (this PR's head)   hw_gate: success
started 20:11:03Z   finished 20:59:17Z   (48 min — it queued behind another lane's full gate on the single self-hosted runner)

That is the check the body said to watch for after the merge, and it is the whole gate: test-backend-ops on HRX0, kat.py goldens on five models (the K-quants including the Qwen3-Coder-30B-A3B MoE, and an IQ4_XS), KLD against stored base logits, and the 7K-token needle on two models. So the pin I landed — 5450c8054 -> 52dda9bce, carrying #415's TOP_K claim guard, #414's routed predicate and #408's revert — runs green on the device, not just in build.

Two things worth recording with it:

  1. The run exists only because I labelled the PR after it had already merged. It was not triggered by the merge; a pin bump opened from a lane branch matches neither of hw-gate.yml's triggers, which is engine#2757. That issue is closed with cl-game's hw-gate: run for any PR that moves a pin, decided by a job that can see the diff (engine#2757) #2759, so the next bump is gated by construction — this one was gated by hand, an hour late and 48 minutes of runner time after the fact.
  2. The gate's green does not retroactively cover the window before it, and it should not be read that way: between the merge at 20:11 and the run finishing at 20:59 the box ran the new pin unverified. Nothing regressed in that hour (it was mostly my own lane's idle turns and other lanes' tickets), but the ordering is the defect hw-gate never runs for a pin bump opened from a lane branch (only bump-hrx/* or a label), so the backend that reaches the box is gated by build only #2757 describes, now fixed.

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