Repository navigation
serve --parallel on HRX: shared KV cache, no qwen.attention (Qwen3-4B 4 slots 39 -> 153 tok/s) - #240
Conversation
…llama.cpp acf9c74 llama-server's per-slot KV streams make K/V 4-D; HRX flash attention then runs on the CPU in every layer (Qwen3-4B, 4 slots: 39 tok/s aggregate, below one stream). 1bit serve --device hrx --parallel N now passes -kvu and turns off AMD's Qwen attention path, which builds its mask from positions and let the slots' answers bleed into each other under -kvu (measured: 3 of 4 parallel answers taken over by another prompt). Qwen3-4B 4 slots 39 -> 153 tok/s (Vulkan 216), Qwen3-Coder-30B-A3B 34 -> 74, ZAYA1-8B 47 -> 71, answers on topic. Gated delta-net models (qwen35, qwen35moe, qwen3next) are refused with --parallel on HRX: no multi-sequence GATED_DELTA_NET kernel yet. Pins llama.cpp acf9c74 (#47, #48): token kernels accumulate vectors; kquant matchers skip q8-only inputs (Qwen3-Coder-30B crashed with qwen.attention off) and a softplus kernel. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Docs7 for 1bit-monster/engine
Commit |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
…244) Without --parallel, serve passes no -np and llama-server opens its default several slots. On HRX0 a second concurrent request then shares a batch with the first, and Qwen3.5/3.8 (qwen35, qwen35moe, qwen3next; Ternary Bonsai too) fail with HTTP 500 at the multi-sequence softplus / GATED_DELTA_NET (found by the leaderboard session: Bonsai GSM8K died on its second request). serve now passes -np 1 for those architectures on HRX; requests queue instead. Complements #243 (-np 1 for an explicit --parallel 1) and #240 (--parallel >1 refused for them on HRX). Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…load names its size (engine #1417) (#1736) Moves third_party/llama.cpp 8f124f906c -> 60ae4c9358, the tip of 1bit/hrx-vulkan-patched. Seven merged fork commits ride it: 60ae4c9 ggml-hrx: the transient arena is charged to the pool before it grows 18b222e hrx: cap the host copy staging buffer and copy through it in chunks 02d8e6b kv-share: report the layout a context expects, so a provider can match it 4e57033 ggml-hrx: the forward declaration says bool, matching the definition <- the pin BUILDS again 6b8eba3 hrx: say which relation a refused layout-alias node has 214ccf8 hrx: claim a head-row ROPE only when a fused matcher accepts it 5c47fa0 ggml-hrx: a failed host-weight materialize names the size and the pool headroom 4e57033 is the reason this bump exists: 8f124f906 does NOT compile. Two merges each added a forward declaration of device_free_total 130 lines apart (void from #252, bool from #240), so both merged cleanly and the break was only visible when GGML_HRX is compiled - which the fork's own CI never does. The engine's hrx_build did see it, which is what reddened my previous pin PR (#1681) and why that one is superseded rather than rebased: its target, 8f124f906, reached main from another lane before this. Regenerated registry/architectures.json with the submodule at 60ae4c935: the ONLY delta is the sources sha - counts stay hrx 298, npu 9, architectures 298, mapped 298 - so none of the seven commits touched the architecture surface. Verified: check_pins.py says '8f124f906 -> 60ae4c935 is ahead' (rc 0) and registry_build.py --check-pins passes. Still Refs #1417, not Fixes: the live admission check (fork #254 + the fail-safe) is in this pin, but #1417's reported shape - a request admitted with GTT room while host memory is short - needs the host term, which is fork #256 + #259 and neither has merged. Co-authored-by: pi-hrx-sched <[email protected]>
…rrects #1771) #1771 retracted the "read hrx_build as unavailable" instruction, which was right, but its closing clause says the failure "was not a property of the pins in the tree — which is what the same pins failing four hours earlier had seemed to say". The pins are not the same, and the gitlinks come from the runs themselves: red, 21:06 run 42699357566 (fix/1696) hrx-system 7f4236924 llama.cpp 8f124f906 -> failure green, 00:21 run 42727646749 (bump-hrx/831629f) hrx-system 7f4236924 llama.cpp 831629fe9 -> success hrx-system matches; llama.cpp does not. And 8f124f906 is exactly the pin #1733 root-caused (ggml-hrx.cpp declares device_free_total twice: void from #252's forward declaration at :383, bool from #240's 800 lines later), which #1759 replaced. As merged, the paragraph teaches the opposite lesson: "a window, not the pins" instead of "this pin was broken, a bump fixed it, and a llama.cpp bump must clear hrx_build before it lands" — the rule the hw-gate label exists for, and what #1768 did before merging (hrx_build pass 1m10s). Docs only.
…rrects #1771) (#1776) #1771 retracted the "read hrx_build as unavailable" instruction, which was right, but its closing clause says the failure "was not a property of the pins in the tree — which is what the same pins failing four hours earlier had seemed to say". The pins are not the same, and the gitlinks come from the runs themselves: red, 21:06 run 42699357566 (fix/1696) hrx-system 7f4236924 llama.cpp 8f124f906 -> failure green, 00:21 run 42727646749 (bump-hrx/831629f) hrx-system 7f4236924 llama.cpp 831629fe9 -> success hrx-system matches; llama.cpp does not. And 8f124f906 is exactly the pin #1733 root-caused (ggml-hrx.cpp declares device_free_total twice: void from #252's forward declaration at :383, bool from #240's 800 lines later), which #1759 replaced. As merged, the paragraph teaches the opposite lesson: "a window, not the pins" instead of "this pin was broken, a bump fixed it, and a llama.cpp bump must clear hrx_build before it lands" — the rule the hw-gate label exists for, and what #1768 did before merging (hrx_build pass 1m10s). Docs only.
Makes
1bit serve --device hrx --parallel Nfast and correct, and pins llama.cppacf9c74(fork #47, #48).The problem
llama-server gives each slot its own KV stream, so K/V are 4-D. HRX's flash-attention matchers all require 3-D tensors, so attention fell back to the CPU in every layer. Qwen3-4B with 4 slots managed 39 tok/s in total, less than a single stream (76).
The fix (
app/serve.cpp, HRX only)-kvu: one shared KV cache across all slots, so attention stays on the GPU.GGML_HRX_DISABLE_DISPATCH=qwen.attention, merged into any value already in the list. AMD's Qwen attention path builds its mask from token positions and ignores the other sequences. Under-kvuthat made 3 of 4 parallel answers carry another prompt's content (TCP text in the palindrome, Mars and German answers).--parallelfor qwen35 / qwen35moe / qwen3next (Qwen3.5/3.8), with a message pointing to Vulkan. Multi-sequence batches of those models stop at GATED_DELTA_NET, which has no multi-sequence kernel on HRX yet. Before this they failed mid-request.Pinned llama.cpp (
acf9c74)qwen.attentionoff, Qwen3-Coder-30B crashed on its first request ("reads transient before write"). Docs chat on 1bit.gg: Context7 widget + context7.json #48 also adds a softplus kernel.Measured on strixhalo
4 slots, greedy, llama-server with the flags serve now passes:
test-backend-opsMUL_MAT and SOFTPLUS pass on HRX0.docs/hrx.mdgets a section on this.I did not run the rebuilt
1bitbinary itself end-to-end, only llama-server with identical flags.serve.cpppasses a syntax-only compile, and CI builds it.🤖 Generated with Claude Code