Skip to content

ggml-hrx: fix the PAD param dump so the tree compiles, and run test-hrx-ops case by case (engine #444) - #127

Merged
bong-water-water-bong merged 2 commits into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-444-tests
Oct 23, 2026
Merged

bong-water-water-bong merged 2 commits into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-444-tests

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Refs #444 (the two remaining items of that issue are the test-hrx-ops route expectations and the device
run; see the end of this body).

The tree does not compile with GGML_HRX=ON at the pin

ggml/src/ggml-hrx/graph/graph-diagnostics.cpp:184:

error: no return statement in 'constexpr' function returning non-void

op_params_json() is a std::visit over OpParams with an if constexpr chain and no final else, and
ba64834d ("ggml-hrx: PAD parameters match the kernel …", PR #114) added PadParams to the variant without
adding a branch here. A lambda's call operator is implicitly constexpr, so falling off the end is an error
under GCC 15 and under clang — the tree has not compiled with -DGGML_HRX=ON since #114. Nothing caught
it because the engine's CI and hw-gate take cmake/hrx.cmake's public-binary-drop path, which does not
compile this tree at all.

Dump the pad fields and the circular flag with the other kind-tagged parameters and accept them back in
parse_op_params(), so a dumped plan round-trips.

test-hrx-ops runs case by case (engine #444, item 1)

tests/test-hrx-ops.cpp had one fail-fast main(): ~157 calls plus the loops around them, so the first
failed REQUIRE ended the run and no later case executed. It now uses tests/testing_suite.h (the runner
test-hrx-buffer already uses): every case gets its own process, a name, a per-case PASS/FAIL line and real
totals.

  • 239 cases: 2 host cases (the support-predicate and alternate-value-lookup checks, which need no device) and
    237 device cases.
  • the loops are unrolled so each case carries its shapes in its name
    (dense.q4_k.mul_mat_f32_f32_wmma.2.128, swiglu.q4_k.q4_k.…_prefill_wave32.256.4096.geglu), which is what
    makes a red row identifiable without a line number.
  • one job: every device case drives the GPU, so they run one at a time.
  • without an HRX device the device cases skip as before and the two host cases still run.
  • the call sequence is unchanged: 157 source call sites expand to the same 239 cases, helper by helper.

hrx-backend-test already got its per-case runner in #105; the abort-on-one-wrong-parameter that could still
kill that run is fixed in the companion PR.

Evidence

Host side, CPU, at the pin — the two host cases of test-hrx-ops:

$ ./build/bin/test-hrx-ops
test-hrx-ops: 2 case(s)
[PASS] rmsnorm_support
[PASS] alternate_value_alias_lookup
test-hrx-ops summary: 2 passed, 0 failed, 2 total
test skipped: no device available for test-hrx-ops (237 device case(s))

The fork has no CI, so that run is the gate for the host half.

Not in this PR (engine #444, item 2)

The stale routing expectations inside the cases: one-token kquant matmuls still expect
loom_libs:ggml_mul_mat_f32_f32_decode_wave64 where the registration names
ggml_kquant_mul_mat_decode_f32 / …_decode_tokens_f32 for 1..8 tokens (dispatch-kquant-decode.cpp,
kMaxTokens = 8). Those need the scheduled kernel names harvested from a device run, which was cut short by
the release-candidate build holds; they follow as one commit on this branch when the GPU slot comes back, and
any regression found there goes into #445's table rather than being written into the expectations.

🤖 Generated with Claude Code

bong-water-water-bong and others added 2 commits October 23, 2026 07:49
op_params_json() is a std::visit over OpParams with an `if constexpr` chain and no final `else`.
ba64834 ("ggml-hrx: PAD parameters match the kernel; source strides; circular flag", PR #114) added
PadParams to the variant without adding a branch here, so the chain falls off the end for PAD and the
lambda - whose call operator is implicitly constexpr - is an error:

    graph-diagnostics.cpp:184: error: no return statement in 'constexpr' function returning non-void

That is fatal under GCC 15 and under clang alike, so the tree has not compiled with -DGGML_HRX=ON since
#114. Nothing caught it because the engine's CI and hw-gate take cmake/hrx.cmake's public-binary-drop
path, which does not compile this tree at all.

Dump the pad fields and the circular flag with the other kind-tagged parameters, and accept them back in
parse_op_params() so a dumped plan round-trips.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
test-hrx-ops had one fail-fast main(): ~157 calls and loops around them, so the first failed REQUIRE
ended the run and no later case ever executed. This moves it onto tests/testing_suite.h, the runner
test-hrx-buffer already uses, which gives every case its own process, a name, and a per-case PASS/FAIL
line plus real totals.

- 239 cases: 2 host cases (the support-predicate and alternate-value-lookup checks, which need no
  device) and 237 device cases. The loops are unrolled so each case carries its shapes in its name
  (`dense.q4_k.mul_mat_f32_f32_wmma.2.128`, `swiglu.q4_k.q4_k.…_prefill_wave32.256.4096.geglu`), which
  is what makes a red row identifiable without reading a line number.
- one job: every device case drives the GPU, so they run one at a time.
- without an HRX device the device cases skip as before (`-` no device), the two host cases still run.
- the expectation names inside the cases are untouched here; the ones this pin schedules differently
  are the next commit.

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