Repository navigation
hrx: read eight adjacent rows in large row64 F32 decode projections - #247
Open
AaronStGeorge wants to merge 1 commit into
Open
AaronStGeorge wants to merge 1 commit into
AaronStGeorge wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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-benchmarkcounters 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.