Skip to content

ggml-hrx: PrismML tile bytes for the low-token SwiGLU (PQ2_0 1.7B decode) - #74

Merged
bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-prism-tile-bytes
Oct 2, 2026
Merged

bong-water-water-bong merged 1 commit into
1bit/hrx-vulkan-patchedfrom
1bit/hrx-prism-tile-bytes

Conversation

@bong-water-water-bong

Copy link
Copy Markdown

ggml-hrx: PrismML tile bytes for the low-token SwiGLU (PQ2_0 1.7B decode)

ggml_dequant_weight_tile_bytes had no case for PQ2_0 (format 72) or PTQ1_0
(73) and returned 0. #62 added both to ggml_dequant_weight_row_bytes but not
here. The low-token SwiGLU (ggml_mul_mat_swiglu_f32_f32_lowtoken_dot, 1-5
tokens) sizes a weight row as K/256 x tile bytes, so every row read row 0's
weights and the output collapsed ("red color color color the the the").
PQ2_0 is two 34-byte blocks per 256 values (68), PTQ1_0 two 28-byte blocks
(56).

Only models whose decode SwiGLU reaches that kernel were hit. On
Ternary-Bonsai-1.7B, the hidden-2048 qwen decode norm publishes a q8_1 copy
of its output, kquant decode steps aside, and the gate/up pair lands in the
low-token SwiGLU. The 27B files and TQ1_0/TQ2_0 took kquant decode.

Decode-shaped llama-perplexity (-c 128 -b 128 -ub 1, wikitext-2):
Ternary-Bonsai-1.7B PQ2_0, 4 chunks:
HRX0 before PPL 1,225,624 +/- 189,778
HRX0 after PPL 20.6537 +/- 4.797
CPU PPL 20.6972 +/- 4.810
Ternary-Bonsai-2-27B PTQ1_0, 2 chunks, low-token SwiGLU forced
(GGML_HRX_DISABLE_DISPATCH=kquant.swiglu):
HRX0 before PPL 18,534.8; after 11.1754 (default routing 11.1756)
Greedy, "The three primary colors of light are": before " red color color
color color theit the the ..."; after " red, green, and blue. These colors
are used to create all other colors through mixing." (= CPU).

Reviewed (PR-Agent duty): tile bytes match the row-bytes path (34 / 28 bytes per 128-value block, so 68 / 56 per 256). Found by the release format-matrix smoke test.

🤖 Generated with Claude Code

…ode)

ggml_dequant_weight_tile_bytes had no case for PQ2_0 (format 72) or PTQ1_0
(73) and returned 0. #62 added both to ggml_dequant_weight_row_bytes but not
here. The low-token SwiGLU (ggml_mul_mat_swiglu_f32_f32_lowtoken_dot, 1-5
tokens) sizes a weight row as K/256 x tile bytes, so every row read row 0's
weights and the output collapsed ("red color color color the the the").
PQ2_0 is two 34-byte blocks per 256 values (68), PTQ1_0 two 28-byte blocks
(56).

Only models whose decode SwiGLU reaches that kernel were hit. On
Ternary-Bonsai-1.7B, the hidden-2048 qwen decode norm publishes a q8_1 copy
of its output, kquant decode steps aside, and the gate/up pair lands in the
low-token SwiGLU. The 27B files and TQ1_0/TQ2_0 took kquant decode.

Decode-shaped llama-perplexity (-c 128 -b 128 -ub 1, wikitext-2):
  Ternary-Bonsai-1.7B PQ2_0, 4 chunks:
    HRX0 before  PPL 1,225,624 +/- 189,778
    HRX0 after   PPL 20.6537 +/- 4.797
    CPU          PPL 20.6972 +/- 4.810
  Ternary-Bonsai-2-27B PTQ1_0, 2 chunks, low-token SwiGLU forced
  (GGML_HRX_DISABLE_DISPATCH=kquant.swiglu):
    HRX0 before  PPL 18,534.8; after 11.1754 (default routing 11.1756)
Greedy, "The three primary colors of light are": before " red color color
color color theit the the ..."; after " red, green, and blue. These colors
are used to create all other colors through mixing." (= CPU).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ggml label Oct 2, 2026
@bong-water-water-bong
bong-water-water-bong merged commit f5b7f4a into 1bit/hrx-vulkan-patched Oct 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant