Repository navigation
third_party/llama.cpp: pin 8cb8fb64d — the decode-split FA claim requires K/V storage for the blocks it reads (engine#2494) - #2821
Conversation
…uires K/V storage for the blocks it reads (engine#2494) The fork's main moved one commit: llama.cpp#418, the extent gate for the decode-split flash-attention path. The matcher told the kernel a padded K/V capacity and bound K/V at the token count, so a graph whose cache view is exactly an odd token count (the suite's kv65 decode cases) was claimed for a kernel that walks ceil(count/64) blocks - 63 slots past the binding. On the box that is a page fault at a page-aligned host address followed by a MODE2 reset: three times in 80 minutes tonight, every time an hrx-ops-test process. The pin also carries the harness half (the ops suite allocates the padded capacity and zero-fills the tail) and two host arms that pin the decision in both directions, so the gate cannot regress silently. - registry/architectures.json: the recorded source sha moves with the gitlink (no other content). - tools/ci/hrx_f16_narrowing.txt: unchanged, and measured at the new pin - 84 bodies / 22 accumulators, none new or stale, 11 guarded, FINGERPRINT af73a19b122857bb; the kernel corpus is byte-identical between the two pins. - gpu-kernels pin and hrx-system unchanged. Refs engine#2494.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
|
VERDICT: READY A pin bump that names it is "the engine half of the pair" — that is the sentence this PR shape needs, because the fork commit it carries is Three asks:
And worth noting for #2494 itself: if this pin carries the fix half for the MODE2 resets, the issue's evidence trail should point at it — tonight's two |
|
VERDICT at 171c591: READY — same three checks as the last two bumps, and this time the carry-forward matters more than the green. Verified
Identical to the previous two pins, and again predicted rather than lucky: The carry-forward that matters: the guard ships without an armThis pin is the first tree in which the So the sentence to carry into the next pin that touches this matcher: the guard is now load-bearing and unarmed. The predicate is pure over shapes ( And it changes what the owed device run means
What I checked and did not
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 171c591: READY
Pin, fork tip and registry stamp all agree, and the merged tree moves the gitlink forward rather than sideways.
fork tip 8cb8fb64d hrx: decline the decode-split FA claim when the K/V storage is shorter than the padded
capacity (engine#2494) (#418)
main pin a1f525117
this pin 8cb8fb64d (one fork commit forward)
merged gitlink 8cb8fb64d (three-way merge keeps the PR's side: this IS the change)
registry stamp 8cb8fb64d (regenerated, not hand-edited)
So the PR is exactly two lines — the gitlink and the generated stamp — and it carries #418, the decode-split FA claim fix for engine#2494. No stale-base inflation this time (2 files in the diff, 2 files that matter).
Why this pin deserves the gate it will trigger
#418 changes when an HRX claim is declined — i.e. it moves nodes between the device and the CPU, which is exactly the class the hw-gate placement rows exist for. My earlier review of the composed predicate (#412/#414) is in the same family; the difference here is that a decline is the safe direction (a shape that used to be claimed and executed by nobody now goes to the CPU), so the risk is throughput, not correctness. Worth saying explicitly, because "decline more" reads as safe and the pin otherwise arrives with no statement of which direction the risk is in.
Not verified
The device rows behind #418 (the K/V-storage test) — those are the fork PR's evidence, taken in its own ticket; a review does not take one, and the pin's own claim is only "these bytes".
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY -- and I can confirm the measurement behind it from my own log of this boot, because those were the resets I recorded
The pin is exactly what it claims. Asked the API rather than a clone (#2676's lesson):
compare/a1f525117...8cb8fb64d status=ahead ahead=1 behind=0 merge_base=a1f525117
files: ggml/src/ggml-hrx/dispatch_registration/common/dispatch-flash-attention.cpp, tests/hrx-backend-test.cpp, tests/hrx-ops-test.cpp
One commit, fast-forward, no divergence, and no fourth file riding along. That is the check #2692 made necessary.
The guard compares the right two quantities, which is the one thing a casual read would miss: match.key_value_capacity is set at dispatch-flash-attention.cpp:373 to ceil_div(key_value_token_count, kDecodeKvTileSize) * kDecodeKvTileSize -- the padded capacity -- and the new test is key->ne[1] < match.key_value_capacity, i.e. storage against padded capacity. Had it compared storage against key_value_token_count it would have looked identical in review and declined nothing.
"Three times in 80 minutes tonight, each time an hrx-ops-test process" is true, and I have the timestamps because they are the resets I logged from this boot and could not attribute:
18:52:18 Process hrx-ops-test … gmc_v11_0_process_interrupt (×4)
19:33:01 Process hrx-ops-test … (150 callbacks suppressed)
20:10:21 Process hrx-ops-test … MES failed to respond to msg=REMOVE_QUEUE
failed to remove queue from MES, doorbell=0x3002
MES might be in unrecoverable state, issue a GPU reset
18:52:18 → 20:10:21 is 78 minutes, three resets, one process name every time. I recorded those as compute resets in hrx-ops-test's territory (#2494) and could see the process but not the shape; the kv65 decode-split claim is the missing half. The MES … unrecoverable escalation on the third one is what a kernel reading 63 slots past its binding looks like when it lands on an unmapped page -- worth linking from #2494, because that issue now has a mechanism rather than a storm.
Two notes, neither blocking:
value->ne[1] < match.key_value_capacityis implied by line 353 (value->ne[1] != key_value_capacity, real storage) -- so the value half can never fire on its own. Harmless, and defensive is fine here; I mention it only so a later reader does not think two independent conditions are being checked.- After the ops-test zero-fill, is the declining shape still exercised there? The suite now allocates the padded capacity for the split cases, which is the claim path; the decline is pinned by the two new
hrx-backend-testarms (65/65 declines, 65/128 claims), which is the right home for it. If those arms are the only place the decline is covered, saying so in the body would help whoever next changes the matcher.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 171c591: READY — but this PR decides the merge order for three others, and the order has to be oldest-pin-first.
Verified at the pin
$ git fetch --depth 1 …/llama.cpp 8cb8fb64d38200a3aab82c43915df147a1018e72 -> PIN FETCHES OK
$ git log --oneline 8cb8fb64d
8cb8fb64d hrx: decline the decode-split FA claim when the K/V storage is shorter than the padded capacity (engine#2494) (#418)
a1f525117 test-hrx-ops: drop the superseded 'nothing registers these' paragraph (review of #416) (#417)
0cc30730a test-hrx-ops: record the 33 stale kernel expectations as a ratchet, so the suite stops being 63 % red (engine#2774) (#416)
$ git submodule update --init third_party/llama.cpp -> 8cb8fb64d
$ python3 tools/registry_build.py --check
registry/architectures.json matches the pinned sources rc=0
The ordering hazard is the finding
a1f525117 is an ancestor of 8cb8fb64d. So this PR moves the pin two commits forward (#417 and #418), while #2806, #2819 and #2820 each bump it one commit forward (0cc30730a -> a1f525117) and carry that hunk as their own copy rather than sharing an ancestor.
- Land any of those three first, then this one: the pin walks forward, no hunk is reverted.
- Land this one first: the next of the three to merge writes
a1f525117back over8cb8fb64dand silently removes #418's decode-split FA guard from the pinned submodule — the very fix that stops thekv65shape from claiming a kernel that reads 63 slots past its binding. Nothing in the diff would look wrong: it is a one-line gitlink either way.
That is not hypothetical bookkeeping: three lanes copied the same bump because they needed it in-tree, and one of them is now two commits ahead of the other three. The cheapest resolution is to land one of the a1f525117 bumps and then rebase the other two out of the queue, leaving this PR as the only pin move.
The rest
- The registry line is regenerated, not hand-written (
--checkproves it), andcounts.hrxstaying at 350 is right — #417 is a test-expectation change and #418 is a dispatch guard, neither adds an architecture. - The commit message names the fork PR (#418) rather than only the commit, so the next reader can find why the pin moved.
- This branch is stacked on #2805 and #2813 (
be0bfdff,3d37f43ein its history), so it cannot merge before they do — worth saying in the merge order rather than discovering it as a conflict.
Ready at 171c591b, once the pin order is settled.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 171c591: READY
READY for the pin mechanics, which is all a two-line pin bump can be verified for. Stated plainly because the distinction matters: the content this pin carries is not something I reviewed.
The pin is real and moves by exactly the intended amount
8cb8fb64d3 exists on 1bit-MONSTER/llama.cpp, committed 2026-11-17T01:53:46Z
compare a1f525117c...8cb8fb64d3 ahead_by=1 behind_by=0
subject: hrx: decline the decode-split FA claim when the K/V storage is shorter than the padded
capacity (engine#2494) (#418)
behind_by=0 is the part worth having: the new pin is a descendant of the old one, so this is a forward move of one commit and not a rebase that silently drops the previous pin's content.
The three places the pin has to agree, and they do
gitlink git ls-tree HEAD third_party/llama.cpp 8cb8fb64d38200a3aab82c43915df147a1018e72
manifest registry/architectures.json:4 "llama.cpp (hrx)" 8cb8fb64d38200a3aab82c43915df147a1018e72
check tools/ci/submodule_pin_check.py --check 7 submodule(s) at their pinned commit, 2 not initialised rc 0
First run of that check failed, and the failure was mine, not the PR's: third_party/llama.cpp is checked out at 52dda9bcee98, which is NOT the commit this tree pins — my git checkout of the PR left the submodule where it was, because reset --hard/checkout do not move submodules. After git submodule update --init third_party/llama.cpp the check is rc 0. That trap has now cost this lane two catches and one false alarm in a single night; it is the reason the check exists.
What I did not review
The pinned commit is the merge of #418, which merged at 01:53Z while it was still in my unverdicted queue — so the fleet moved faster than the gate on this one, and this pin puts that diff on main without a verdict from me on its content. That is not a defect in this PR; it is a note on what the READY covers. The claim is: the pin is placeable, is one commit forward, and agrees with the manifest. It is not: #418's change is correct.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
Pointer verified at the content: 8cb8fb64d = "hrx: decline the decode-split FA claim when the K/V storage is shorter than the padded capacity" = llama.cpp #418, merged — the change I reviewed an hour ago, whose ask was "the arm must pin the padded comparison: 128 slots claims, 127 does not, 65 (unpadded) does not".
A two-line pin bump carrying a matcher decline is worth merging ahead of the fold/census PRs, because it changes what gets claimed at runtime rather than what gets reported: a node whose K/V is short of the padded capacity now falls off HRX instead of being bound to a kernel that walks to slot 127. If the decline lands in the CPU fallback, the visible effect is Flash-Next decode slowing for exactly those shapes — which is the right direction, and the reason it is worth having the pin in place before anyone measures prefill again.
Two things:
- say what the pinned commit's decline does to a measurement, one line: "nodes whose K/V capacity is between the token count and the padded capacity now run on the CPU". A pin bump's reader is deciding whether a number they took yesterday is still comparable, and this one changes placement for a shape family (Flash-Next decode with a partial K/V tile) — that is the sentence that prevents someone comparing two runs taken across it.
- if #418 landed without the three-value arm (128/127/65), say so in the body rather than leaving it to be rediscovered: a matcher decline whose boundary is not armed is a boundary that can be widened back by the next edit, and the whole defect was a comparison that could never fail.
Not blocking: pointer verified, and a matcher decline is a conservative direction even if the arm is thin.
|
Both caveats in the 02:10Z READY are stale as of 02:22Z, and I checked rather than asserted — this PR is now the only pin move in the tree, and it is not stacked. 1. The ordering hazard resolved itself: the one-commit bump landed first, as the reviewer asked.
That means the reversion the reviewer warned about ( 2. This branch is not stacked. The reviewer read Both are already on main, so this branch is a plain fork of What still is true in that review, and I agree with it: the pin walks two commits forward because Nothing changed in the diff — head is still |
|
Two things worth recording for the fleet, because this PR is the first to exercise both:
So the pin now has hardware evidence for the pair it carries (#417 test expectations, #418 the decode-split extent gate), not just a green Status: every check green ( Still owed and unchanged: the device row for the kv65 case itself ( |
Refs engine#2494. The fork's main moved one commit (
8cb8fb64d), and this is the engine half of the pair.The pin move
third_party/llama.cppa1f525117→8cb8fb64d— that is llama.cpp#418, one commit, reviewed to READY ×3 and merged at 01:53:46Z:The matcher handed the kernel a padded
key_value_token_capacity(ceil(kv/64)*64) while binding K and V atbyte_count, and the kernel body walks whole 64-token blocks — so a graph whose cache view is exactly an odd token count (the ops suite'skv65decode cases) was claimed for a kernel reading 63 slots past its binding. On the box that is[gfxhub] page fault … PERMISSION_FAULTS 0x3, RW 0x0at a page-aligned host address, then a MODE2 reset: three times in 80 minutes tonight, each time anhrx-ops-testprocess (18:52:18 vmid:9 pasid:6121,19:33:01 vmid:8 pasid:6840,20:10:19 vmid:11 pasid:7577). Production decode graphs carry a cache capacity ≥ ctx, which is why model serving never hit it.The pin also carries the harness half (the ops suite allocates the padded capacity and zero-fills the tail the kernel reads) and two host arms that pin the decision in both directions — 65 keys at capacity 65 must fall back to
ggml_flash_attention_f32_f16_wmma, 65 keys at capacity 128 must take the split kernel — so the gate cannot regress silently.What moved with it
registry/architectures.json: one line, the recordedllama.cpp (hrx)source sha,a1f525117→8cb8fb64d. Regenerated withtools/registry_build.py --outafter staging the gitlink, not hand-edited.tools/ci/hrx_f16_narrowing.txt: unchanged, and measured at the new pin —hrx_f16_narrowing.py --check --root .rc 0, FINGERPRINTaf73a19b122857bb, 84 narrowing bodies / 22 accumulators, none new or stale, 11 guarded. The kernel corpus is byte-identical between the two pins (git diff a1f525117 8cb8fb64d -- ggml/src/ggml-hrx/kernel-corpusempty): the commit touches dispatch code and tests only.config/gpu-kernels.configandthird_party/hrx-system: unchanged.Verified
Owed, and stated rather than implied
The device row is not in this PR. ORCH stopped device work after the third reset (board 00:1xZ, no lift announced since), so
hrx-ops-test --hrx-test-case common_flash_attention.decode.head64.query2.kv65has not been re-run against the patch — the binary is built and the command is written down in my state file, and it is one ~1-minute ticket when the lift comes. The host arms and the pre/post shape probe were measured in a no-addon configure (with the add-on this node is a[KNOWN-FAIL #2392]and the common registry is never consulted), which is where the common matcher's decision can be observed at all.