Skip to content

tests: fix test-hrx-ops from the first device run (engine #444) - #132

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

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

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

tests: fix test-hrx-ops from the device run (engine #444)

First device run of test-hrx-ops in its per-case form: 194 passed, 45 failed, 239 total at fork
f1670b43 + hrx-system 82804197bc (host 2 passed). The failures say two different things.

My route translation was wrong, the table was right

45 failures were caused by the translation added in #128, not by the test. On hardware the registry
schedules the q8 publication plus the table's own kernel:

missing expected kernel: loom_libs:ggml_kquant_mul_mat_decode_tokens_f32
scheduled kernels:
  qwen3_moe:ggml_quantize_q8_1_x4_f32
  loom_libs:ggml_mul_mat_f32_f32_wmma

i.e. here the kquant matcher declines because a q8 alternate exists and the shape goes
quantize + wmma — exactly what the table said before I "corrected" it. That also settles the open question
from #128: the rule in dispatch-kquant-decode.cpp describes when the decode family is eligible, not that
it always wins.

require_matmul_route() now accepts the table's kernel or the kquant family (and reports the scheduled
sequence when neither is there), so the case keeps its guard without forcing one of the two.

Registered decode/prefill pairs

Four shapes named the prefill variant while the plan schedules the decode one, and the asymmetric flash
attention case names the flash kernel while the MLA shapes schedule the rows kernel. Both are pairs the
registry picks from by token count / layout, so a case that names one accepts the other:

named sibling
llm_attention_v_matmul_set_rows_f32_f32_wmma llm_attention_v_matmul_set_rows_decode_f32_f32
ggml_flash_attention_f32_f16_wmma ggml_attention_rows_f32_f16

Names that are simply gone (updated from the scheduled sequence)

  • routed_moe.q4_k.true: qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32 ->
    qwen3_moe_routed_down_weighted_reduce_f16_f32 (the reduce and the next RMSNorm are separate dispatches;
    the fused variant is not scheduled for this shape).
  • routed_moe_decode.q4_k / .q6_k: the table named routed-down kernels that are not in the sequence; what
    the plan schedules is the fused gate/up kernel
    (qwen3_moe_routed_gate_up_swiglu_q4k_q8_1_x4_next_q8, resp. …_gate_up_swiglu_q4k_q8) followed by
    ggml_mul_mat_id_decode_f32_wave64, so the expected list now ends with those.
  • routed_moe_decode.q6_k.true: the q6_k variant does not publish q8, so the sequence starts with
    ggml_rmsnorm_binary_f32 instead of qwen3_moe_rmsnorm_f32_quantize_q8_1_x4.

Evidence

test-hrx-ops (host):       2 passed, 0 failed, 2 total
test-hrx-ops (f1670b43): 194 passed, 45 failed, 239 total   <- before these fixes
hrx-backend-test:         host 60 passed, 0 failed, 6 known-fail, 0 unexpected-pass
                          device 11 passed, 0 failed, 0 known-fail, 0 unexpected-pass

The 45 -> expected ~4 remaining failures are host-verified only: the GPU lane went to the Qwen3.8-27B
leaderboard before the re-run, so the device confirmation of these edits is the first thing to do when it
comes back. That re-run is also what #444 still needs to close.

🤖 Generated with Claude Code

First device run of `test-hrx-ops` in its per-case form: **194 passed, 45 failed, 239 total** at fork
`f1670b43` + hrx-system `82804197bc` (host 2 passed). The failures say two different things.

## My route translation was wrong, the table was right

45 failures were caused by the translation added in #128, not by the test. On hardware the registry
schedules the **q8 publication plus the table's own kernel**:

```
missing expected kernel: loom_libs:ggml_kquant_mul_mat_decode_tokens_f32
scheduled kernels:
  qwen3_moe:ggml_quantize_q8_1_x4_f32
  loom_libs:ggml_mul_mat_f32_f32_wmma
```

i.e. here the kquant matcher declines because a q8 alternate exists and the shape goes
quantize + wmma — exactly what the table said before I "corrected" it. That also settles the open question
from #128: the rule in `dispatch-kquant-decode.cpp` describes when the decode family is *eligible*, not that
it always wins.

`require_matmul_route()` now accepts the table's kernel **or** the kquant family (and reports the scheduled
sequence when neither is there), so the case keeps its guard without forcing one of the two.

## Registered decode/prefill pairs

Four shapes named the prefill variant while the plan schedules the decode one, and the asymmetric flash
attention case names the flash kernel while the MLA shapes schedule the rows kernel. Both are pairs the
registry picks from by token count / layout, so a case that names one accepts the other:

| named | sibling |
|---|---|
| `llm_attention_v_matmul_set_rows_f32_f32_wmma` | `llm_attention_v_matmul_set_rows_decode_f32_f32` |
| `ggml_flash_attention_f32_f16_wmma` | `ggml_attention_rows_f32_f16` |

## Names that are simply gone (updated from the scheduled sequence)

- `routed_moe.q4_k.true`: `qwen3_moe_routed_down_weighted_reduce_next_rmsnorm_f32` ->
  `qwen3_moe_routed_down_weighted_reduce_f16_f32` (the reduce and the next RMSNorm are separate dispatches;
  the fused variant is not scheduled for this shape).
- `routed_moe_decode.q4_k` / `.q6_k`: the table named routed-down kernels that are not in the sequence; what
  the plan schedules is the fused gate/up kernel
  (`qwen3_moe_routed_gate_up_swiglu_q4k_q8_1_x4_next_q8`, resp. `…_gate_up_swiglu_q4k_q8`) followed by
  `ggml_mul_mat_id_decode_f32_wave64`, so the expected list now ends with those.
- `routed_moe_decode.q6_k.true`: the q6_k variant does not publish q8, so the sequence starts with
  `ggml_rmsnorm_binary_f32` instead of `qwen3_moe_rmsnorm_f32_quantize_q8_1_x4`.

## Evidence

```
test-hrx-ops (host):       2 passed, 0 failed, 2 total
test-hrx-ops (f1670b4): 194 passed, 45 failed, 239 total   <- before these fixes
hrx-backend-test:         host 60 passed, 0 failed, 6 known-fail, 0 unexpected-pass
                          device 11 passed, 0 failed, 0 known-fail, 0 unexpected-pass
```

The 45 -> expected ~4 remaining failures are host-verified only: the GPU lane went to the Qwen3.8-27B
leaderboard before the re-run, so the device confirmation of these edits is the first thing to do when it
comes back. That re-run is also what #444 still needs to close.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@bong-water-water-bong

Copy link
Copy Markdown
Author

Review (orchestrator): the route-accepting helper is the right shape and the stale-name fixes match the scheduled sequences from the device log. Two cleanups before merge:

  1. run_dense_matmul_cpu_reference_case, the normalize_input && (Q4_K || square_output) branch: require_matmul_route(...) is called a second time there, unindented, right after the rmsnorm-only subsequence check. The route was already required two lines above, so drop the duplicate (or, if the intent was to keep the old ordering check "rmsnorm before the matmul", say so and keep it as an ordered subsequence instead).
  2. run_routed_moe_cpu_reference_case: the include_next_rmsnorm ? A : B ternary now has identical arms. Replace it with the single name.

Host-side only, no GPU needed. Push to the same branch; I merge after that, and the device re-run (after the leaderboard releases the lane) stays the proof for #444.

…ternary (engine #444)

Review cleanups on #132, no behaviour change:

- `run_dense_matmul_cpu_reference_case` called `require_matmul_route()` twice - the second call was a
  leftover from splitting the one-element subsequence check out of the pair, and sat unindented inside the
  `normalize_input` branch. Removed; the single call before the branch already covers the route.
- `run_routed_moe_cpu_reference_case`'s expected list ended in a ternary whose two arms are now the same
  kernel (`qwen3_moe_routed_down_weighted_reduce_f16_f32`) because the fused next-rmsnorm variant is not
  scheduled for either shape. Replaced with the plain entry and a comment saying why `include_next_rmsnorm`
  no longer selects a kernel there.

Host check: `test-hrx-ops summary: 2 passed, 0 failed, 2 total` (237 device cases skip without a device).
The device re-run is still what #444 needs before it can close.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@bong-water-water-bong
bong-water-water-bong merged commit 830e2c1 into 1bit/hrx-vulkan-patched Oct 23, 2026
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/hrx-444-device branch October 23, 2026 17:42
@bong-water-water-bong

Copy link
Copy Markdown
Author

Merged (squash). The device re-run of test-hrx-ops on gfx1151 after the leaderboard releases the lane remains the proof for #444.

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