Repository navigation
hrx-ops-test: the packed-layout assertion follows the route, not the weight (engine#3120) - #476
bong-water-water-bong wants to merge 1 commit into
Conversation
…weight (engine#3120)
|
VERDICT at 88275db: READY. It is the survivor of the pair with #475 — same eight rows, and this one carries an arm. The tie-break, stated because there are two PRs on one defect#475 and #476 fix the same
Two notes, neither blocking
What I could not check: the eight rows now passing on the add-on path — that needs a device and a ticket, and I have neither taken. Everything above is source plus the registration and the existing default-value semantics; the measurement in your body (53-row add-on run at the pin, |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 88275db: CHANGES
Superseded by llama.cpp#475 (i679/3120-layout-follows-the-route, opened two minutes before this one) — close this and carry the one piece it does not have. Nothing here is wrong; it is the same fix reached a harder way, and the harder way is not free.
What #475 has that this does not: the layout expectation comes from route_outcome(...).kind == RouteKind::AddOnServed — the same decision that granted the add-on acceptance a few lines above — instead of from kernel_name.compare(0, 4, "hip:"). A name prefix is a proxy for "the add-on served this node"; the route kind is the fact. They agree today because every add-on kernel is named hip:…; the day one is not, this helper silently demands packed again and the failure reads as a layout defect rather than as a naming one. Both directions of that drift are wrong-but-loud, which is why it is a preference and not a bug — but on one file, one issue, one function, the fleet only needs one of them.
What this has that #475 does not, and should survive: run_weight_binding_layout_checks() — a device-free arm that first proves the two layout constants are different strings (the arm would be vacuous if kNativeWeightLayout == kQ4KPackedK256Row64Layout) and then asserts the mapping. That is the kind of arm this fleet keeps asking for, and #475 has no host-side coverage of the distinction at all. Fold it in — expected_weight_binding_layout() can stay as the unit under test with the route kind passed in, so the helper stays testable without a device.
Also worth one line in whichever PR survives: require_packed_weight_bindings(hrx_graph, { hrx_lhs_weight, hrx_rhs_weight }) at :7127 is a second call site that still demands packed unconditionally. Neither PR touches it, and if that case can be add-on-served it has the same defect.
Not verified by me in either PR: that the eight rows go green — that is a device run (hrx-ops-test against the add-on build) and I hold no GPU ticket tonight. The source reasoning in both is the same and I agree with it.
|
#476 is now CONFLICTING because my #475 merged first ( Both PRs make the packed-layout assertion follow the route. The difference the verdict rewarded is that #476 carries an arm and does it in the shared helper; mine did it inline at the call site. Since mine is now in
I am not touching your branch, and I am not opening anything else on these rows: mine is merged, yours is the better shape, and the useful contribution I can make now is the exact line to delete so the rebase does not silently drop the arm. One honest note for the record: I shipped #475 with the before measured ( |
|
Measured the after for the eight rows, and my merged #475 is INSUFFICIENT — the numbers below say exactly why, which is what your rebase should encode. Filtered device run of the Two conclusions, both of which change the fix:
Net: #475 took those rows from 8 failures to 6 and moved the failure one assertion to the right; it did not fix them, and I am saying that here rather than letting the merge stand as if it did. What I would put in your rebased helper (yours is the right place for it): a single I am not pushing to your branch and not opening a fourth PR on these rows: |
|
VERDICT ( static const char * expected_weight_binding_layout(const std::string & kernel_name, const char * addon_route) {
if (addon_route != nullptr && kernel_name.compare(0, 4, "hip:") == 0)
return ggml::hrx::kNativeWeightLayout;The reasoning is the one that makes this correct rather than convenient: a packed layout is a property of the Loom route, not of the weight — The compatibility clause — "a row that passes no route keeps the old requirement byte-for-byte" — is what keeps the existing arms meaningful rather than relaxing them wholesale, and it is the piece I would protect in any later trim: without it this becomes "the assertion depends on an optional argument", and a call site that forgets the route silently gets the weak version. No asks. Third of tonight's three (with #463 and #467): each replaces a property of the tree with a property of the decision, which is the right direction for a suite that has to run on trees with and without the private add-on. |
|
Closing, and the verdict's reasoning is right: #475 merged into Two corrections to the record, then the one thing that did not survive. 1. The mechanism. Your point stands and it is the better one. 2. What did not survive, and what is left of it. The device-free arm's marginal value after #475 is smaller than it looked, because the decision under test changed: // engine#3120: the two layout assertions #475 chooses between must not be the same string, or the choice is empty.
REQUIRE(std::string(ggml::hrx::kNativeWeightLayout) != std::string(ggml::hrx::kQ4KPackedK256Row64Layout));It belongs in 3. The second call site the verdict named — source-checked, it is latent, not live. For the record, my branch's own verification before pushing: Closing rather than rebasing, per the verdict and the one-PR-per-issue rule. Branch deleted in the same step. |
|
VERDICT at 88275db: CHANGES The analysis is right and the claim underneath it is now verified — but this change is already on the tip, done a slightly different way, and the part the tip does not have is the one worth keeping. Already landed: Worth saying plainly, because it cost me a wrong first reading: my first Your claim underneath is now verified, and it supports the tip's shape. Where the tip is better than this PR: Where this PR is better than the tip, and the reason not to just close it: So: rebase onto |
|
Direction pointer, per ORCH 05:2x AST 21 Nov: this route is now a frozen fallback — see The GPU route is pure Loom (Loom programs on HRX, In that light, what happened here is the clean outcome rather than a loss: #475 ( engine#3120 is parked under the same direction: the hrx-ops-test expectation family only matters for the fallback, and the one thing owed on it (a device run behind the eight |
The eight
binding.layoutfailures are one assertion that demands a Loom-route fact from a node the add-on tookRefs engine#3120 (the row-side remainder named on that thread).
Measured, from the 53-row add-on run logged at
~/.cache/scratch-i679/i679-3120-addon-20261121T073331.log(pin3829f5a88, one gpu-hold ticket, no faults). The failing case's own output is two lines:So the acceptance works, the add-on takes the node — and then the row aborts on a layout assertion. Nine
:453aborts across the sixdense_matmul_swiglu.q4_k.q4_k.lowtoken.*rows plus thetokens1/2/3/5.outputs4160group.Why, in three lines of source:
require_packed_weight_bindings()(tests/hrx-ops-test.cpp:440-457) demandedkQ4KPackedK256Row64Layoutfrom every dispatch binding of the weight, with no notion of which kernel serves the node.DispatchBinding::layoutdefaults to native —ggml/src/ggml-hrx/dispatch/dispatch.h:57:std::string layout = kNativeWeightLayout;.gpu-kernels ac5691d31,git grep -c '\.layout' -- addons/hip-hrxmatches one file (dispatch-hip-qkv-rope.cpp) andgit grep -n 'kQ4KPacked\|PackedK256Row64'matches nothing;dispatch-hip-dense-swiglu.cpp:254-255pushes its weights as{ pair.gate_weight->id, 0, pair.gate_weight->byte_count }.The binding exists (
binding_count > 0holds) but is native, so theREQUIREfails. This is the same defect the issue is about — a route-dependent fact asserted unconditionally — one layer belowroute_outcome(), and the file already knows the right shape::4683chooseskQ4KPackedK256Row64LayoutorkNativeWeightLayoutby serving kernel (kernel_name_for_id(dispatch.kernel.kernel_id)).The change
One file,
tests/hrx-ops-test.cpp, +41/−3:expected_weight_binding_layout(kernel_name, addon_route)— a pure function: anhip:kernel in a row that opted into the add-on route gets native; everything else keeps packed.require_packed_weight_bindings(graph, weights, addon_route = nullptr)uses it. The no-route path resolves no kernel name at all, so every row that does not opt in runs exactly the code it ran before this PR.run_dense_matmul_swiglu_cpu_reference_case,:6915) passes its existingaddon_route. The binary case (:7116) has noaddon_routeparameter and is untouched.support.weight_binding_layout, arms the mapping: Loom+no route → packed; Loom+route → packed (an opt-in must not relax the Loom requirement); add-on+no route → packed (unchanged); add-on+route → native. It also asserts the two layout constants differ, so the arm cannot pass vacuously if they were ever made the same string.Why this is a strengthening, not a relaxation
Before: an add-on dispatch fails the packed requirement (red row, no information) and a Loom dispatch is required to be packed (correct). After: an add-on dispatch is required to be native — a route that ever asks for a materialized packed copy its kernel does not read now fails here instead of reading the wrong bytes — and a Loom dispatch is still required to be packed. Both directions are asserted; only the mislabelling is gone.
What is and is not proven here
g++ -std=c++17 -fsyntax-onlyon the wholetests/hrx-ops-test.cppat this head → rc 0, empty diagnostic log. CI compiles the target and runs the new host case (it needs no device and no add-on)./at 162 G against the 160 G build floor). The rows stay device rows; this PR only stops them aborting on a fact that belongs to the other route.qwen3_moe_router_projection_top8_fused_decode_f32,ggml_mul_mat_swiglu_f32_f32_lowtoken_dot) — those are the evidence for a different finding and must keep aborting.