Repository navigation
tests: the feed-forward large-activation case also runs at decode and small-batch token counts (engine #1962) - #306
Conversation
… small-batch token counts (engine ggml-org#1962) ffn.q4_k.prefill.large_activation ran at 256 and 512 tokens only. It now also runs at 1, 2, 4, 5, 8, 16, 64 and 128, where the decode and small-batch kernels take the gate/up and the down-projection. The case prints the kernels that ran. The fused prefill kernels are still required from 256 tokens up. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
ready for review at b79a603 |
|
VERDICT: READY The substance is right and the reporting is the kind this repo needs: ten token counts (1, 2, 4, 5, 8, 16, 64, 128, 256, 512), the fused-prefill kernel requirements correctly One gap worth closing before or after merge, your call — the new counts have no positive kernel requirement. For REQUIRE(!sequence.empty()); // something on the device ran
REQUIRE(!test_sequence_has(sequence, "loom_libs:ggml_mul_mat_q4_k_f16_wmma_prefill_wave32")); // prefill kernel not taken below 256The second one is the more valuable: it pins the claim the new comment makes ("below 256 tokens the decode and small-batch kernels run") instead of leaving it as prose, and Context for why this matters beyond the test: this case is coverage for ggml-org#1962, the row the release depends on — and on engine#1346 I measured that the batched-NaN |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at b79a603: READY
The large-activation case now runs at decode as well as prefill, and the change is the right shape — a hardcoded prefill-only expectation becomes conditional on the token count:
- REQUIRE(test_sequence_has(sequence, "…swiglu_q4_k_f16_wmma_prefill_wave32"));
+ if (token_count >= 256) {The value is that it is test coverage for a live release blocker's subject (ggml-org#1962) on the second path, not a backend change: ffn.q4_k.prefill.large_activation was pinned where the large-activation kernel was expected, so a decode step with a large activation had nothing asserting which kernel it took. Gate a kernel choice on the shape and leave one shape untested, and the untested one is where it silently picks the wrong kernel.
Refs 1bit-MONSTER/engine#1962 (test coverage only, no backend change).
ffn.q4_k.prefill.large_activation(down(swiglu(gate(x), up(x))), Q4_K resident weights, gated maximum 3.0e5 to 4.0e5, HRX against the CPU) ran at 256 and 512 tokens. This adds 1, 2, 4, 5, 8, 16, 64 and 128, where other kernels take the same chain, and prints which kernels ran. The fused prefill kernels are still required from 256 tokens up.Measured (strixhalo, gfx1151, full build of
b6f65a2+ this change, one gpu-hold ticket, 2026-11-11 07:29Z)Kernels below 256 tokens (from an earlier run of the same cases at the pin): 1 token
ggml_kquant_swiglu_decode_f32+ggml_kquant_mul_mat_decode_f32; 2 to 8 the_decode_tokensforms; 16 to 128 the f32 wmma core.These are passing cases, not a reproduction: they pin that the chain stays finite at every token count. Not covered: the 8-bit-block decode kernels a whole model takes, which need a norm kernel in front of the chain.
🤖 Generated with Claude Code