Skip to content

hrx: read eight adjacent rows in large row64 F32 decode projections - #247

Open
AaronStGeorge wants to merge 1 commit into
hrx-graph-develop-v2from
users/astgeorg/row64-f32-decode-reader
Open

AaronStGeorge wants to merge 1 commit into
hrx-graph-develop-v2from
users/astgeorg/row64-f32-decode-reader

Conversation

@AaronStGeorge

Copy link
Copy Markdown
Collaborator

The single-token F32 matmul reader now computes eight adjacent output rows per wave for packed Q4_K and Q6_K weights when K ≥ 10,240 and N ≥ 2,560. Eight lanes share each dot product. The reader reuses the existing row64 dequantization and publishes adjacent outputs together for callers such as fused RoPE. Smaller projections keep the two-row reader. The Gemma4 family opt-in is a separate change. Gemma4 tracking issue

Decode throughput on gfx1151

Median tokens/s across four processes per arm, five warmed TG128 measurements per process. The experiment enabled Gemma4 row64 in both reader arms.

Manifest model Native Previous row64 New reader
Gemma4 12B 26.02 24.95 26.32
Gemma4 E4B 57.90 56.51 58.91
Gemma4 E2B 97.27 96.08 96.85

The eight-row prototype slowed E2B. The size condition restores the previous reader for that model. All 16 captured E2B vector shader binaries matched the previous binaries. The final 12B and E4B captures matched the faster prototype.

Prefill tradeoff: 12B PP128 held at 768 tokens/s on both row64 arms. E4B PP66 initially measured −10.7%. Two longer repeats measured −4.4% and −4.3%. The standalone PP66 graph contains 18 eligible one-token projections. The dedicated repeat used eight processes per arm and 80 prompts per process. Three of its four balanced blocks were slower. E2B PP66 initially measured −24.7% and repeated at −2.0%, with no eligible projection in its captured prompt graph. E4B and E2B PP512 both measured within 2% of the previous reader in the longer repeat.

What changed in the memory traffic

On captured 12B FFN-down projections at K=15,360 and N=3,840, the old reader requested weight data for only two adjacent rows per wave. Legacy loom-benchmark counters from all eight L2 banks showed excess requests. With 16 rotating buffer sets, the new reader brought requests to L2 on Q4_K down from about 1.48M to 0.26M per dispatch. On Q6_K, external read bytes fell from about 101.3 MB to 48.5 MB for 48.4 MB of packed weights. Uninstrumented timings were measured separately.

Both perplexity regimes passed against Vulkan on all three manifest models. The captured Q4 and Q6 projections passed the independent CPU numerical oracle over all 3,840 outputs. The final build passed 52 focused tests and additional fused Q/K/V publication checks. Hardware measurements used gfx1151.

Across 18 synchronized prompt-to-decode runs, both row64 arms retained the same weight bytes with zero duplicate-weight warnings. On 12B after PP66, both retained 8.47 GB versus 12.43 GB with native layout.

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