Skip to content

hrx: the absent bias/residual slots of mul_mat_id_postops bind a read-only value (engine #533 verify) - #131

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/533-postops-placeholder
Oct 23, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/533-postops-placeholder

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

What

The fused mul_mat_id_postops export declares its bias and residual_input bindings with read
access unconditionally, and the kernel only loads them when has_bias / has_residual is set. For an
absent slot the dispatcher filled it with the command's own output transient, which the
command-program verifier rejects (engine ggml-org#533):

VERIFY-ERROR: command 2 kind=Kernel kernel_id=343748864632602669 bindings=10 deps=1
              binding bias value=5 origin=Transient access=Read range=[0, 16384)
              reads transient value 5 before write

This binds a value the programme already reads (the expert weight) for those placeholder slots instead.
The kernel never loads it — the read is guarded by has_bias / has_residual — so the change is
numerically inert by construction.

Before / after (hrx-backend-test at the pin, llama.cpp 7ca8ba5a + hrx-system 82804197)

before:  VERIFY-ERROR: command 2 ... binding bias value=5 ... reads transient value 5 before write
         [KNOWN-FAIL #533] common_mul_mat_id_postops_dispatch

after:   [UNEXPECTED-PASS #533] common_mul_mat_id_postops_dispatch   (case body passes)

The #533 tag is retired in tests/hrx-backend-test.cpp in this PR, so the case prints [PASS]; the
[UNEXPECTED-PASS] above is this harness's name for "a tagged known-fail started passing".

The other three #533 rows are untouched by this patch and still fail (see "not in this PR" below).

Model check — the fused path is numerically identical either way

Qwen3-Coder-30B-A3B Q4_K_M (the postops + next_rmsnorm user), one server per arm, per-token top-5
logprobs on the three bench prompts, plus a second pass on the same server (cold vs warm):

prompt tokens greedy text logprobs max abs Δlogprob
code 128 identical identical 0.000e+00
prose 126 identical identical 0.000e+00
short 29 identical identical 0.000e+00

Arms: default vs GGML_HRX_DISABLE_DISPATCH=common.mul_mat_id_postops.f32_f32_wmma. Cold-vs-warm
identical on all three. 90 W cap, PCM pad (23 Oct).

So this is a plan-declaration defect with no model-visible effect — worth fixing because the verifier is
the backend's own correctness gate, not because it was changing numbers.

Not in this PR

qwen_attention_postprocess_dispatch, gdn_selected_rms_q8_dispatch and qwen_routed_gate_up_dispatch
still fail the same verifier for a different reason: their fused programmes emit a consumer command
before the command that writes a transient it binds, and the planner's dependency model is linear
(dispatch/command-program.cpp: "TODO: replace this linear ordinal dependency with real graph/resource
dependency analysis" → dependencies.push_back(command.ordinal - 1)), so the verifier sees a forward
edge (reads transient value 33 before write by command 7). That needs the producer-before-consumer
ordering inside those matchers (or the resource-dependency analysis the TODO describes), and it is the
next change rather than this one. For the record, disabling the GDN family on
Qwen3.8-27B --mtp also changes nothing numerically (128/128/26 tokens, max |Δlogprob| = 0, cold vs warm
identical).

Risk

One dispatcher branch, no kernel change, no new binding count (the slot keeps its declared position and
access). The three untouched cases behave exactly as before.

…-only value (engine ggml-org#533 verify)

The fused postops export declares its bias and residual bindings with read access whether or not
the kernel uses them, and the kernel only loads them when has_bias / has_residual is set. For an
absent slot the dispatcher bound the command's own output transient, which the command-program
verifier rejects:

  VERIFY-ERROR: command 2 kind=Kernel bindings=10 deps=1 binding bias value=5 origin=Transient
                access=Read range=[0, 16384) reads transient value 5 before write

Bind a value the programme already reads instead - the weight - for those placeholder slots. The
kernel never loads it (has_bias / has_residual guard the read), so nothing changes numerically.

  before: [KNOWN-FAIL ggml-org#533] common_mul_mat_id_postops_dispatch
              VERIFY-ERROR: command 2 ... binding bias value=5 ... reads transient value 5 before write
  after:  [PASS] common_mul_mat_id_postops_dispatch  (tag retired in tests/hrx-backend-test.cpp)

Model check (Qwen3-Coder-30B-A3B Q4_K_M, the postops+next_rmsnorm user): the family enabled vs
GGML_HRX_DISABLE_DISPATCH=common.mul_mat_id_postops.f32_f32_wmma gives identical greedy text and
identical per-token top-5 logprobs on three prompts (128/126/29 tokens, max |dlogprob| = 0), and an
identical second pass on the same server (cold vs warm). 90 W cap, PCM pad (23 Oct).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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