Skip to content

hrx-backend-test: drop the use of the deleted dispatch-symmetric-i4.h (#422) - #103

Closed
bong-water-water-bong wants to merge 3 commits into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-test-symmetric-i4-removed
Closed

bong-water-water-bong wants to merge 3 commits into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-test-symmetric-i4-removed

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Oct 18, 2026 •

Copy link
Copy Markdown

#422: tests/hrx-backend-test.cpp still includes dispatch_registration/common/dispatch-symmetric-i4.h, which f2099e9 deleted, so the test target cannot compile at the branch tip:

tests/hrx-backend-test.cpp:9:10: fatal error: 'dispatch_registration/common/dispatch-symmetric-i4.h' file not found

The header held only common_symmetric_i4_lowrow_route_enabled() (which returned false) and common_symmetric_i4_lowrow_mul_mat_eligible(). run_symmetric_i4_consumer_qualification_checks() called the predicate on every consumer of the qualified input, which only restated that a disabled route is never eligible - the "same treatment" the header got.

This drops the include, the call and the two values that existed only for it. The rest of the case stays: the scheduler must still not emit loom_libs:ggml_rmsnorm_binary_symmetric_i4_k32 for these consumer shapes, and the q8_publication expectations are untouched.

Reproduced and checked on CPU, no GPU, with the target's own include paths (clang++ -std=c++17 -fsyntax-only -Iggml/include -Iggml/src -Iggml/src/ggml-hrx -Iggml/src/ggml-hrx/kernel-corpus ..., plus the HRX headers):

  • before: error: 'dispatch_registration/common/dispatch-symmetric-i4.h' file not found
  • after: that error is gone.

A second commit ports the three removals the re-head left behind in this file (KernelSpecialization.workload_specialization x4, CommandPlanMetadata.activation_publication_diagnostics x2 blocks, the stale DispatchMatchContext initializer), keeping the observable property each case still has. With that, the target builds: cmake --build ... --target hrx-backend-test links, and the binary runs.

The suite is not green, and this PR does not claim it is. Now with the per-case classification: engine issue 1bit-MONSTER/engine#445.

On CPU here (85 host cases, 14 device cases skipped without an HRX device): 36 PASS, 49 FAIL. Evidence for each failure is the plan the case actually produced (temporary dump of plan.dispatches with kernel names) plus whether the kernel a case expects still exists in the corpus and in dispatch_registration/. Grouped:

  • 17 stale plan shape - the case expects one fused dispatch; the current plan covers the same nodes with separate dispatches whose kernels all exist (scale_add_f32_dispatch: 1 expected, 2 actual ggml_scale_f32 + ggml_binary_f32; same for rmsnorm_two_binary, get_rows_*, rope_set_rows, generic_ssm_conv_binary, ...).
  • 14 stale kernel name - the expected kernel is gone from the corpus and the registrations (common.mul_mat_swiglu.tiled_pair_f32_f32; llm_attention_v_matmul_set_rows_vector_f32_f32 -> ..._decode_f32_f32; ggml_mul_mat_vector_q6_f32_f32 -> ggml_mul_mat_q6_k_packed_token1_f16_wmma; the iq/iq3_xxs codebook kernels -> ggml_kquant_mul_mat_decode_f32).
  • 11 publication/alternate - the machinery is still live (22 append_alternate_value sites), but these shapes get a different producer kernel or no alternate.
  • 7 that need a ruling before any expectation is touched, not an edit: symmetric_i4_consumer_qualification now dispatches loom_libs:ggml_rmsnorm_binary_symmetric_i4_k32, the route f2099e9 deleted as a numerical/perf regression, and the case exists to assert it is never selected; gdn_rmsnorm_gate_dispatch expects ggml_rmsnorm_gate_f32_publish (in the corpus, not registered); iq2_codebook_resource_reuse sees no constant initializations; qwen_router_top8_dispatch binding length changed; qwen_token_embedding_dispatch asserts a graph is unsupported and it now is supported; gather_add_dispatch is missing a compile parameter; qwen_flash_attention_dispatch and gdn_native_projection_pair_dispatch abort with std::out_of_range: map::at.

Deliberately not done here: writing the current plan back into the expectations. For class 1-3 that would bless a plan that may be worse than the one the test was written to protect, without anyone deciding it is fine; for class 4 it would erase the finding. The build is what this PR restores, and #445 says exactly what is still red and why.

Ruling applied (engine #445, "table accepted as posted")

…#422)

f2099e9 deleted
ggml/src/ggml-hrx/dispatch_registration/common/dispatch-symmetric-i4.h (its route was
already disabled), but tests/hrx-backend-test.cpp kept the include and kept calling
common_symmetric_i4_lowrow_mul_mat_eligible(), so the test target cannot compile at the
tip: "'dispatch_registration/common/dispatch-symmetric-i4.h' file not found".

The header held only that predicate and a route switch that returned false, and the test
used the predicate to restate that a disabled route is never eligible. Drop the include,
the loop over the qualified input's consumers and the two values that existed only for it.
The case keeps what still means something: the scheduler must not emit
loom_libs:ggml_rmsnorm_binary_symmetric_i4_k32 for these consumer shapes, and the
q8_publication expectations are untouched.

Checked on CPU against the target's own include paths (clang++ -fsyntax-only with
-Iggml/include -Iggml/src -Iggml/src/ggml-hrx -Iggml/src/ggml-hrx/kernel-corpus): the
fatal error is gone. The same unit then hits unrelated API drift from the AMD-core
re-head, listed in the PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oduced (#422)

With the deleted header gone, the same translation unit reached 20 more errors from f2099e9
/ 53d443c, which re-headed ggml-hrx onto AMD's core. Three removals to follow:

- KernelSpecialization lost workload_specialization (4 sites: 3298, 5191, 7352, 7547). Drop
  the marker assertion; each case keeps the property it was checking - an aligned dynamic
  kernel still pins no fixed ggml.workload.token_capacity (3298 keeps that line), and the
  copy/conv/epilogue cases keep their kernel identity and integer parameters.
- CommandPlanMetadata lost activation_publication_diagnostics(). The published alternate
  value is still in alternate_values(), so the two cases assert graph_value, alternate_value
  and type == GGML_TYPE_Q8_1 instead of the removed diagnostic's source_value /
  alternate_value / publication_stage / requested_format (6328, 10894).
- DispatchMatchContext no longer has the registry as its last member (9564): drop that
  initializer element; match() is still called on the registry.

Checked with the target's own include paths (clang++ -fsyntax-only, the ggml-hrx and
kernel-corpus include dirs plus the pinned hrx-system headers): 0 errors, no new warnings.

Not in this commit: tests/test-hrx-ops.cpp (9 sites) and tests/test-hrx-loom-jit.cpp (4
sites) use the same removed members. In loom-jit the assignments exist to make two
specializations distinct for the JIT disk cache, so they need a different discriminator
rather than deletion; that is a separate change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Engine #445's ruling (table accepted as posted) says these plan changes are equivalent or better,
so their expectations follow. Each change cites its #445 row. Deliberately still red: the 9
REGRESSION rows (publication dropped whole in f2099e9, the symmetric-i4 route re-enabled in
aadd602) and the NEEDS-DEVICE row (qwen_router_top8_dispatch).

- gdn_native_projection_pair_dispatch: the epilogue element count is the compile parameter
  llm.gated_delta_net.epilogue_element_count (dispatch-gated-delta-net.cpp:794), not an integer
  parameter.
- iq2_codebook_resource_reuse: the IQ2 codebook path is AMD's generic
  loom_libs:ggml_kquant_mul_mat_decode_f32 now, which carries no codebook tables, so there is no
  constant initialization and no transient grid to reuse.
- qwen_token_embedding_dispatch: IQ3_S and IQ4_NL manual token-embedding graphs are claimed now,
  running as the get_rows + matmul the supported types already used.
- swiglu_q8_output: the q8-output publish kernel is gone; the shape is the kquant swiglu decode
  feeding the kquant matmul decode, which reads f32, so no alternate exists.
- rmsnorm_gate_q8_output: publication still happens, through ggml_rmsnorm_gate_f32_q8_1_x4.

Not updated yet (each has further variants whose current plan needs checking first):
gather_add_dispatch, generic_swiglu_k16_publication_edges, rmsnorm_gate_packed_output,
qwen_flash_attention_dispatch.

Suite here: 41 pass / 44 fail (was 36 / 49); the 10 REGRESSION and NEEDS-DEVICE cases are
untouched and still red.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Author

Closing as superseded by #104, which merged into 1bit/hrx-vulkan-patched (8dafc4a) with the same include removal and a rewritten hrx-backend-test. Rebasing this branch onto it leaves no diff. The 5 ACCEPT expectation updates from engine#445 carry over to a new branch off 8dafc4a.

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