Repository navigation
hrx-ops-test: the packed-weight layout belongs to the route that ran, not to the row (engine#3120) - #475
Conversation
… not to the row (engine#3120) Eight `dense_matmul_swiglu.q4_k.q4_k.*` rows failed on `hrx-ops-test.cpp:453 binding.layout == ggml::hrx::kQ4KPackedK256Row64Layout` in the add-on build, *after* the per-row acceptance (#465) had already granted the route -- measured at the pin on 2026-11-21: engine#3120: loom_libs:ggml_mul_mat_swiglu_q4_q8_1_x4_lowtoken_dot is served by the HIP add-on (kquant_tokens_q8, hip:k_61d118a92b4c) -- comparing the value hrx-ops-test.cpp:453: requirement failed: binding.layout == kQ4KPackedK256Row64Layout The packed K256/row64 layout is a fact about the LOOM kquant route; the add-on's kernels read the weight *stored* (the distinction `hrx-backend-test` labels "ggml-org#2392 add-on reads the weight stored"). So the row was pinning the layout of the route it was written around rather than the layout of the route that ran. It now asks `route_outcome(...)` -- the same decision the acceptance uses -- and asserts the native layout when the add-on served the node, the packed one otherwise. Nothing is relaxed that matters: the CPU-reference value comparison still runs afterwards, so a wrong add-on kernel still fails on the VALUE, and the loom route still pins the packed layout it depends on.
|
VERDICT at a47b0b4: CHANGES — not the fix (it is correct), the duplication. #476 fixes the same eight rows and does it in the shared helper with an arm registered in the suite; mine recommends #476 survive and this one close. Why #476 over this, on the fleet's own tie-breakReverting either PR makes the eight
What this PR does better, and should not be lostYour predicate is the more precise one: One scope note if this closes: the other Ask: close this one into #476 (or say why it is the survivor and I will flip the recommendation on #476 in the same hour — one copy either way, and I have told #476 the same thing). |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at a47b0b4: READY
Right signal, smallest diff, and it is the issue owner's own fix. route_outcome(...).kind == RouteKind::AddOnServed is the same authority the row already used to accept the add-on, so the layout requirement now follows the decision instead of a convention about who usually serves these nodes; the else branch keeps the old requirement byte-for-byte, and a row with no addon_route resolves no kernel name and lands there, so nothing changes for the rows that were passing.
Checked in the diff, at this head:
- the branch is on the call site (
:6891, the SwiGLU case), not on the helper, so the assertion stays exactly as strict on the Loom route (require_packed_weight_bindingsuntouched); - the value comparison below it is not relaxed — that is the half that must never soften, and the diff does not touch it;
- the comment names the evidence (
8 rows,:453 requirement failed: binding.layout == kQ4KPackedK256Row64Layout) and the#2392 add-on reads the weight storedprecedent it matches, which is what makes the change reviewable without a device.
Not verified by me: that the eight rows now pass — that is a device run and I hold no GPU ticket (hrx-ops-test on the add-on build). The reasoning is sound (DispatchBinding::layout defaults to native for the add-on matchers), but the row-level green is the author's to claim.
Two things for the merge loop, because they are not defects in this diff:
- llama.cpp#476 is the same fix, opened two minutes later (
hrx/3120-weight-binding-layout,+41/−3, same file, same eight rows). Its mechanism is ahip:-prefix sniff in the helper and it carries one genuinely additive piece this PR does not have: a host-side arm (run_weight_binding_layout_checks) that asserts the two layout constants are different strings — anti-vacuity — and that the mapping is what the helper says. That arm belongs here, not in a second PR. Recommend #476 closes and its arm is folded in (or carried as the immediate follow-up); two open PRs touching one function on one issue is how ggml-org#3145/ggml-org#3146 died within four seconds of each other. - The second call site is untouched:
require_packed_weight_bindings(hrx_graph, { hrx_lhs_weight, hrx_rhs_weight })at:7127still demands packed unconditionally. If that case can ever be add-on-served it has the same defect; if it cannot, one line in the body saying so closes the question for the next reader. Cheaper than discovering it when that family's route changes.
… more add-on rows (engine#3120) (#484) * hrx-ops-test: the stored-layout routes get a stored-layout assertion, not the uploaded-native precondition (engine#3120) #475 sent the add-on-served swiglu rows to require_native_weight_bindings(), whose first REQUIRE is that the weight has NO repackable source. The rows import their weights, so that is false by construction: the 2026-11-21 device run moved five rows from :453 to :424 instead of to their value comparison. The sixth row is the engine#444 Loom kquant route (loom_route), which binds Q4_K as stored (kquant_weight_binding) and still got the packed assertion. Split the layout walk out of the two helpers (require_weight_binding_layout) and add require_stored_weight_bindings(): repackable source present, every binding native. Any route other than FallThrough uses it; the expected Loom packed kernel keeps require_packed_weight_bindings(). Co-Authored-By: Claude Opus 5.5 <[email protected]> * hrx-ops-test: two more add-on rows and short comments (engine#3120) Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: bong-water-water-bong <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Refs ggml-org#3120. Eight rows fail after the acceptance has already granted the add-on route, because they pin the layout of the route the row was written around rather than the layout of the route that ran.
The measurement
Add-on build at the pin, the six add-on families filtered (53 rows), one gpu-hold ticket:
The acceptance fires (14 lines across the run) and then these eight
dense_matmul_swiglu.q4_k.q4_k.*rows fail on the layout assertion, before their value comparison ever runs.Why the assertion is wrong on that route
The packed K256/row64 layout is a fact about the Loom kquant route, which is built to read packed weights. The add-on's kernels read the weight stored — the same distinction
hrx-backend-testhas carried since ggml-org#2392 as the label "add-on reads the weight stored". So on the add-on route the row was asserting a property of a kernel that did not run.The change — one hunk
require_packed_weight_bindings(...)is asked only when the Loom route served the node; when the add-on served it, the row assertsrequire_native_weight_bindings(...)instead. The decision comes fromroute_outcome(), the function engine#469 added for exactly this purpose, so the layout question and the acceptance question can never disagree:What is deliberately not relaxed
addon_route = "kquant_tokens_q8", and this makes its other assertion agree with that decision.Verification
Compiles and links in a real build at the import-touching path (
ninja hrx-ops-test, 14/17 link). The device verification of these eight rows is queued as its own small ticket; the before is the run above (8 × binding.layout, log~/.cache/scratch-i679/i679-3120-addon-20261121T073331.log) and the after will be posted here as a comment rather than asserted in advance — the last time I quoted a device number from a stale binary on this issue it was wrong, so this PR ships with the before and an honest promise about the after.Two rows in the same family are not touched and must keep aborting:
decode_routed_moe.q6_k.alias_gate_input(qwen3_moe_router_projection_top8_fused_decode_f32) anduploaded_native_gated_q4(ggml_mul_mat_swiglu_f32_f32_lowtoken_dot) — both are the unfused-route cases measured earlier on ggml-org#3120.