Rebase Scout shards to BF16-direct + F64x8 SIMD pipeline#54
Merged
Conversation
run_llama4_shard() now uses stream_index_gguf_bf16() instead of stream_index_gguf(). Changes: - BF16-direct: no f32 intermediate allocation (saves 283 MB/tensor) - F64x8 SIMD: 8 rows projected in parallel per zmm register - Strided octave (stride=16): 97% fewer BF16→f64 conversions - Halftone drop: 9 of 17 golden positions, odd bins interpolated - Exact shard sizes: SCOUT_SHARD_SIZES const replaces 44 GB estimate - Reusable u16 buffer inside indexer (no per-tensor alloc) Both Scout shard tests and Maverick test now use the same BF16-direct pipeline. The old f32 path remains for non-BF16 formats (IQ1_S, Q8_0, etc).
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.
Summary
Rebases
run_llama4_shard()from the legacy f32 path (stream_index_gguf) to the BF16-direct pipeline (stream_index_gguf_bf16).Both Scout and Maverick now use the same optimized pipeline:
Vec<f32>intermediate (saves 283 MB per tensor)SCOUT_SHARD_SIZESconst replaces 44 GB estimateWhy golden step matters at this ratio
At 4,735× compression, every Base17 bin feeds the palette clustering.
Golden step (11 mod 17) visits all 17 residues → full-rank palette centroids.
Fibonacci had 4 dead bins → 23.5% of the CAM distance matrix was comparing noise floor to noise floor.
What stays on the f32 path
test_stream_index_llama4_scout_from_hf(IQ1_S format, not BF16)test_stream_index_openchat_q8(Q8_0 format)test_stream_index_synthetic_gguf(synthetic F32)These correctly use the old path because their dtypes need actual dequantization.