Skip to content

hrx: the IQ3_XXS table decode binds the six buffers its kernel launches with (engine#679) - #487

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-i679/iq3s-table-bindings
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
cl-i679/iq3s-table-bindings

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

Overview

ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table (ours, #216, on by default for IQ3_XXS routed gate/up since #281) builds the IQ3_XXS grid in workgroup memory and launches with six buffers. The #327 AMD-pin merge added a seventh codebook binding for AMD's tiled/skinny kernels and applied it to every IQ3_XXS dispatch, including the table kernel. The first graph then fails the program's ABI check:

command 169 kernel loom_libs:ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table has 7 bindings but its ABI requires 6

On the rc-2026-11-22-c35 package this makes every Flash-Next UD-IQ3_XXS request return HTTP 500 on HRX (engine#679). The codebook binding now goes only to the kernels that take it. GGML_HRX_IQ3S_TABLE_DECODE=0 was the workaround.

Measured (strixhalo, gfx1151, box-hold gpu, MES failures 0 -> 0, amdgpu error lines 0 -> 0)

  • test-backend-ops -b HRX0 -o MUL_MAT_VEC_FUSION, IQ3_XXS routed cases (m=80 and m=512, n=640, k=2560, 16 experts, 10 used):
    • fork 7737fa3 (unfixed, table decode on): FAIL on both cases, 1/2 backends passed
    • this branch, table decode on: OK, 2 runs; with GGML_HRX_IQ3S_TABLE_DECODE=0: OK, 2 runs
  • Flash-Next UD-IQ3_XXS through llama-server (engine main b262ae18 + this branch, plus fork qwen4exp: the fused top-k mask's zero base row is one host input, not a FILL per QSA layer (engine#679) #483's libllama), -c 32768 -np 1 -ub 2048, interleaved chain/table/table/chain, 512 greedy tokens, 4 runs per arm, decode tok/s:
prompt tokens table decode (default, this PR) select chain (=0)
211 18.97-19.00 19.01-19.26
18,781 18.00-18.63 18.30-18.95

The table decode serves again but is not faster than the chain on this model. Greedy text differs between the two decode paths (first differing token 64 at 211 tokens, 10 at 18,781), each path repeat-identical, both coherent; the op-level comparison above against the CPU reference passes for both. Whether the table decode should stay the default is a separate question; this PR only makes the default work.

No new test: the existing MUL_MAT_VEC_FUSION cases catch it (fail before, pass after).

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES. Claude Code (Claude Opus 5.5) found the cause from the error and the kernel's launch signature, wrote the change and ran the measurements on the box.

🤖 Generated with Claude Code

…es with (engine#679)

ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table (ours, #216) builds the IQ3_XXS
grid in workgroup memory and launches with six buffers. The #327 AMD-pin merge
added a seventh codebook binding for AMD's tiled/skinny kernels and applied it
to every IQ3_XXS dispatch, so with the table decode on by default the first
Flash-Next UD-IQ3_XXS graph fails:

  command 169 kernel loom_libs:ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table
  has 7 bindings but its ABI requires 6

(rc-2026-11-22-c35 package on strixhalo, every request HTTP 500). The codebook
binding now goes only to the kernels that take it;
GGML_HRX_IQ3S_TABLE_DECODE=0 was the workaround.

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

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (review by lane cl-kernel; comment-only because this is the same account).

  • Correctness: checked against the base 7737fa364. The table kernel is chosen only when the gate or up weight is IQ3_XXS, and in that case the old code always appended the codebook, giving 7 bindings. The manifest entry ggml_mul_mat_id_swiglu_f32_f32_wmma_iq3s_table lists 6 (input, expert_table, partition_table, gate_weight, up_weight, output), and the .loom body declares the same 6 buffers and builds the grid in workgroup memory. With this change the table kernel gets exactly 6. The selector kernels keep the 7th slot: the grid for IQ3_XXS, a dummy input otherwise. No other dispatch selects the table kernel.
  • Measurements: they support the change. MUL_MAT_VEC_FUSION IQ3_XXS cases fail on the pin and pass with the fix, both with table decode on and with =0. Flash-Next serves on the default path again. The PR correctly does not claim a speed-up (table vs chain: 18.97-19.00 vs 19.01-19.26 at 211 tokens).
  • Duplicate: #485 has the same code hunk, and the two conflict. Keep this one and close #485 (see the review there).
  • Merge order: first. #486's three routed_pair.iq3_xxs.* rows pass only with this fix.

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