Skip to content

Bump llama.cpp to af04c9f2 and record gpu-kernels cf222e7d - #497

Merged
bong-water-water-bong merged 4 commits into
mainfrom
1bit/pin-af04c9f2-cf222e7d
Oct 22, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
1bit/pin-af04c9f2-cf222e7d

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Bump llama.cpp to af04c9f2 and record gpu-kernels cf222e7d

Two pins move together, and registry/architectures.json is regenerated (scripts/registry-regen.sh) so
it records the new llama.cpp pin.

pin from to content
third_party/llama.cpp 96f81977 af04c9f2 #123 ggml-hrx: claim views of q8_0 KV caches · #124 common: opt-in cumulative-confidence draft budget for MTP
gpu-kernels (build input, -DONEBIT_GPU_PRIVATE) b373c3ec's predecessor cf222e7d #22 the q8_0 KV decode kernel takes short caches too · #23 L2_NORM on strided views

What each one does

  • q8_0 KV views (HRX: decode-split multipass path intermittently faults (HSA_STATUS_ERROR_MEMORY_FAULT) above capacity 2048 #123, fork). test-backend-ops probes the lone VIEW node of a quantized KV cache
    and no matcher claimed a VIEW, so the q8_0 attention family was reported unsupported and silently
    skipped — 29 cases. HRX now claims a VIEW of a q8_0 tensor (a pure alias; the FLASH_ATTN_EXT matcher
    decides), and the cases run for real: -p type_K=q8_0 28/28 passed, -p type_V=q8_0 28/28
    passed
    , Backend HRX0: OK. The 4-bit KV type from that work is not shipped (it failed the
    quality bar), and q8_0 keeps llama.cpp's graph Hadamard rotation: skipping it raised KLD vs f16 from
    0.000172 to 0.000903 on Qwen3-4B at c2048, so that candidate was dropped.
  • q8_0 KV short-cache decode (Embed the engine into Lemonade, not Lemonade into the engine: drop the vendored Lemonade #22, gpu-kernels). Below n_kv 1024 the f16 decode matcher declines
    because Loom's decode-split is as fast there; a q8_0 cache has no such fallback and fell through to
    the scalar prompt kernel. q8_0 now uses its own floor: depth 512 on Qwen3-4B goes from -27 % to
    -7.4 % vs f16 (75.23 vs 69.64 tok/s), 2048 -4.6 %, 8192 -5.5 %, with KLD unchanged at 0.000172
    (identical with the old floor, so the change is speed-only).
  • MTP draft budget (HRX: decode-split multipass reduce output pass is O(blocks) per element, leaving a ~16% decode gap above 2048 #124, fork). --spec-draft-cum-p-min P (default 0 = off, historical
    behaviour): keep drafting while the running product of the drafter's top-1 probabilities stays above
    P. Measured, 3 interleaved rounds, same binary, fresh server per arm: code 35.76 -> 40.75 tok/s
    (+14.0 %), prose +1.2 %, short -5.7 %, greedy texts byte-identical in all three classes. It is
    opt-in and documented as code-only for exactly that reason. Everything lives in our own
    common/onebit-mtp-budget.h with one member and six one-line hooks in common/speculative.cpp; the
    ONEBIT_MTP_TRACE measurement log is env-gated and never read back.
  • L2_NORM on strided views (Docs: the 1bit engine runs inside Lemonade #23, gpu-kernels). The gated-delta-net norms that arrive as views are
    handled instead of refused (this is what made --spec-draft-n-max >= 5 drop speculative decoding on
    the 27B, where the target's L2_NORM came in as f32[128,16,N,1] <- VIEW).

Hardware gate (local, before this PR)

Engine main's own gate at this pair (llama.cpp af04c9f2, gpu-kernels cf222e7d, hrx-system
82804197), kernels present and off by default, run with a private HW_GATE_STORE so concurrent gates
could not clobber the base logits:

check result
ops (MUL_MAT, MUL_MAT_ID, FLASH_ATTN_EXT, GATED_DELTA_NET, SSM_CONV, GET_ROWS, ROPE, RMS_NORM, SOFT_MAX) PASS 695/695
kat x 7 (qwen3-0.6b, zaya1-8b, qwen3.8-27b, coder-30b-a3b, 4b-iq4xs, 0.6b-kq8, 0.6b-kvq8) all PASS
kld x 5 (0.000003 / 0.007729 / -0.000000 / 0.000912 / 0.000002) all PASS, same-top 98.33-100 %
needle x 4 (incl. both q8_0-KV rows) all PASS

0 new amdgpu ring events during the run.

Reviewer notes

  • gpu-kernels is not a submodule; the release builds pass a checkout via -DONEBIT_GPU_PRIVATE, so
    the commit is recorded in docs/hrx.md's pin table in this PR (and in the commit message) instead of
    as a gitlink.
  • Nothing here changes a default: the q8_0 cache type is user-selected, the MTP flag is 0 by default.
  • Auto-merge is deliberately off; merge by hand after CI.

🤖 Generated with Claude Code

bong-water-water-bong and others added 2 commits October 21, 2026 20:24
llama.cpp moves from 96f81977 to af04c9f2 (1bit/hrx-vulkan-patched), which carries:
  - #123 ggml-hrx: claim views of q8_0 KV caches, so test-backend-ops actually runs the q8_0
    FLASH_ATTN_EXT cases (29 were silently reported unsupported; now 28/28 pass on type_K=q8_0 and
    on type_V=q8_0)
  - #124 common: opt-in cumulative-confidence draft budget for MTP (--spec-draft-cum-p-min, default 0)
    with the ONEBIT_MTP_TRACE measurement hook in our own common/onebit-mtp-budget.h

gpu-kernels moves from b373c3ec's predecessor to cf222e7d, which carries #22 (the q8_0 KV decode
kernel takes short caches too: depth 512 -27% -> -7.4% on Qwen3-4B) and #23 (L2_NORM over views). It is
not a submodule; docs/hrx.md now names the commit a release builds against.

Hardware gate on this pair (engine main + these two pins, kernels present and off by default):
ops 695/695, 7 kat rows, 5 kld rows, 4 needle rows - PASS, 0 ring events.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/hrx.md's pin table gains the private-kernels row (gpu-kernels cf222e7d, not a submodule), and
registry/architectures.json - which records the pins it was generated from - is regenerated for
llama.cpp af04c9f2 (scripts/registry-regen.sh).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@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 Oct 21, 2026
bong-water-water-bong and others added 2 commits October 21, 2026 20:52
@bong-water-water-bong
bong-water-water-bong merged commit ee7d0cb into main Oct 22, 2026
10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/pin-af04c9f2-cf222e7d branch October 22, 2026 00:16
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

123 - Partially compliant

Compliant requirements:

  • The PR bumps llama.cpp to af04c9f2 which includes the multi-pass KV-block reduction
  • The PR updates the gpu-kernels pin to cf222e7d which may contain fixes for the fault
  • The PR updates registry/architectures.json to reflect the new llama.cpp commit

Non-compliant requirements:

  • The PR does not directly address the root cause of the out-of-bounds access or the JIT-specialised code issue
  • The PR does not include a fix for the specific memory fault in the multipass output pass

Requires further human verification:

  • Verification of the fix for the memory fault requires running the specific test cases mentioned in the ticket
  • The actual GPU fault behavior needs to be confirmed on the hardware (Strix Halo)

124 - Partially compliant

Compliant requirements:

  • The PR bumps llama.cpp to af04c9f2 which includes the multi-pass reduction
  • The PR updates the gpu-kernels pin to cf222e7d which may contain optimizations for the output pass

Non-compliant requirements:

  • The PR does not directly address the performance issue in the output pass
  • The PR does not include a specific optimization to make the output pass O(1) per element

Requires further human verification:

  • Performance testing is needed to confirm the improvement in decode speed
  • Verification that the output pass optimization is actually applied requires code inspection

22 - Partially compliant

Compliant requirements:

  • The PR removes the vendored Lemonade
  • The PR updates documentation to reflect the new relationship
  • The PR adds new tests for serve proxy
  • The PR pins dependencies (json and cpp-httplib)

Non-compliant requirements:

  • The PR does not include the upstream Lemonade recipe PR that launches 1bit serve

Requires further human verification:

  • The upstream Lemonade recipe PR needs to be reviewed and merged
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Kernel Pin Update

The gpu-kernels pin has been updated from 3c9ef4d745e9799d41470fa094cb282b0a4fab4c to cf222e7d2530d45c3bb9d7634321027cf11dbbd9. While this update is necessary for the PR's stated purpose, it's important to verify that this specific commit resolves the memory fault issues described in ticket #123 and improves performance as described in ticket #124. The PR description mentions that the new pin includes fixes for q8_0 KV short-cache decode and L2_NORM on strided views, but without further details or testing, it's unclear if these changes directly address the root causes of the reported issues.

sha=cf222e7d2530d45c3bb9d7634321027cf11dbbd9

bong-water-water-bong added a commit that referenced this pull request Nov 24, 2026
…514 (the one-token f16 block-sum overflow fix + its guards; engine#3411) (#3462)

- gpu-kernels#126 (engine#3411): hip.dense_kquant_swiglu no longer publishes its q8 copy (its f16 block sum
  overflows on large activations); the top-1 MoE Q4_K reader sums its own codes.
- llama.cpp#502: test-hrx-ops moe_top1.q4_k.decode.{ordinary,large_activation}, the top-1 guard.
- Also on the fork since the last pin: #494 (upstream security sync), #495, #496, #497, #498.

Co-authored-by: bong-water-water-bong <[email protected]>
Co-authored-by: Claude Opus 5.5 <[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 3/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant