Skip to content

hrx-ops-test: the mixed-layout device row compared ValueIds across two graph imports - it reads the decode program's own weight value (engine#3389) - #509

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
fix/3389-mixed-row-decode-value-ids
Nov 24, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
fix/3389-mixed-row-decode-value-ids

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

engine#3389: the two mixed-layout rows' device failures are a test bug, not a product route. The row compared a ValueId from one graph import against the bindings of another import.

The defect

ValueIds are per graph snapshot. run_mixed_weight_layout_program_case has two programs and two imports:

  • mixed_lookup was built from hrx_mixed_graph and its weight value was read from imported_mixed.graph
    (tests/hrx-ops-test.cpp:4461);
  • decode_lookup is built from hrx_decode_graph, a different import, and the row compared the decode program's
    bindings against the mixed import's weight id (tests/hrx-ops-test.cpp:4489).

The same tensor has a different id in each import (the mixed graph meets the weight before the gather, the decode graph
after the rmsnorm+mul activation), so the comparison matched an unrelated value. Measured on the device build at
6164e5b, the collision was the activation: the binding it took has length 8192 (2048 f32) - not the Q6_K weight's
215040 bytes - which is why the row concluded "native" for a decode that binds the weight packed.

Consequences: REQUIRE(decode_packed) failed for Q6_K on both routes, and the Q4_K copy-count expectation was derived
from the false "native" reading, so the no-add-on Q4_K row (decode binds packed; mixed program already holds the native
copy) failed its materialization assert. The same id mix-up was in the packed branch's resident_buffer() lookup
(tests/hrx-ops-test.cpp:4561).

The fix

Read the weight's value from each program's own graph and compare in that space:

  • decode bindings vs decode_lookup.program->graph().values().find_tensor(hrx_weight);
  • resident_buffer() vs program.graph().values().find_tensor(hrx_weight).

No expectation is re-baselined: the row asserts the same packed copy / two resident copies / one duplicate warning as
before, now against the program's own ids. The host-tier twin for the same graph shape already asserts the packed
binding the device plan takes (q6_decode_source_eligibility.q6_k, which compares inside its own import - it passes on
the box).

Device evidence (gfx1151, one box-hold both ticket, as root)

Built with the pinned recipe (add-on and no-add-on, gfx1151), ran with the pin's runtime libs from pkg/hrx/llama/bin,
box env HRX_ALLOW_NO_SVM=1 etc., 12:00:59Z-12:03Z, no GPU reset.

build mixed_weight_layout_program.q4_k mixed_weight_layout_program.q6_k
6164e5b add-on, this change PASS PASS
6164e5b no-add-on, this change PASS PASS

At 6164e5b the same two rows are FAIL on add-on (q6_k, cpp:4506 decode_packed) and FAIL on no-add-on (q6_k cpp:4506,
q4_k cpp:4516 materializations).

Full add-on device suite with this change: 408 passed, 2 failed, 1 known-fail, 411 total. The two remaining
failures are the split-FA head96/value64 rows, which are engine#3380 and are fixed by llama.cpp#508; together the two
changes give 410 passed / 0 failed / 1 known-fail (qwen_flash_attention).

Logs on strixhalo: /data/dev/cl-hrxtest/runs/fa3.status, fa3-prb-addon-mixed.log, fa3-prb-noaddon-mixed.log,
fa3-prb-addon-full.log.

Refs 1bit-MONSTER/engine#3389
Refs 1bit-MONSTER/engine#3380

…o graph imports - it reads the decode program's own weight value (engine#3389)

The mixed program and the decode program are separate graph imports, so the same weight has a different ValueId in each; the row compared the decode program's bindings against the mixed program's id. The collision it hit was the activation (a 2048-float value, 8192 bytes), so the row read decode_native for a decode that binds the Q6_K weight packed, and its copy-count expectations followed that false reading. Compare in the decode program's own graph instead. Refs 1bit-MONSTER/engine#3389
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant