The new llama.cpp prerelease improves how CPU language model execution reads weights, the model values set during training, for matrix multiplication. This operation multiplies rows and columns to obtain values. The contributor reported performance gains of up to 23% on Nvidia Grace CPUs. That percentage uses the modified build as its denominator, not the baseline; measured against the baseline, the same two-thread step (1.63 to 2.12 t/s) is about 30.06% higher throughput. The change applies without enabling a new option.

1. Weight reads split into two streams

The change focuses on the order of weight data loads in CPU matrix multiplication. Instead of sequential reads, it spaces two read addresses farther apart. This lets hardware prefetching, which fetches upcoming data in advance, track each stream separately.

The change targets ggml_compute_forward_mul_mat_one_chunk. The path that processes two rows together is compiled for arm64, targeting 64-bit ARM processors with 8-bit integer matrix multiplication extensions. The contributor said it was verified on Grace, which supports these extensions.

2. Grace measurements varied by thread count

Performance was compared on Nvidia Grace at 3.3GHz with Rocky Linux 9.8 and gcc 15.2. The model was unsloth/gemma-4-31B-it-GGUF, with batch size 2, 16 input tokens, and 512 generated tokens. The baseline was b11269, with weight repacking, which rearranges weights for computation, disabled.

Table: Generation throughput by thread count

Conditions: Nvidia Grace @ 3.3GHz, Rocky Linux 9.8, gcc 15.2, unsloth/gemma-4-31B-it-GGUF, BatchSize 2, NumInput 16, NumPredict 512, LLAMA_ARG_REPACK=0, baseline b11269

Units: S_TG t/s, contributor-reported improvement % (calculated as (modified - baseline) / modified, not relative to the baseline build)

Grace CPU generation throughput by thread count1: b11269 (S_TG t/s) 0.92, Modified build (S_TG t/s) 1.11; 2: b11269 (S_TG t/s) 1.63, Modified build (S_TG t/s) 2.12; 4: b11269 (S_TG t/s) 3.31, Modified build (S_TG t/s) 4.18; 8: b11269 (S_TG t/s) 6.35, Modified build (S_TG t/s) 7.75; 16: b11269 (S_TG t/s) 12.08, Modified build (S_TG t/s) 14.10; 32: b11269 (S_TG t/s) 20.53, Modified build (S_TG t/s) 23.56; 64: b11269 (S_TG t/s) 28.94, Modified build (S_TG t/s) 29.70b11269 (S_TG t/s)Modified build (S_TG t/s)10.921.1121.632.1243.314.1886.357.751612.0814.103220.5323.566428.9429.70
Grace CPU generation throughput by thread count
Grace measurements varied by thread count
Thread countb11269 (S_TG t/s)Modified build (S_TG t/s)Reported improvement (%)
10.921.1117.12
21.632.1223.11
43.314.1820.81
86.357.7518.06
1612.0814.1014.33
3220.5323.5612.86
6428.9429.702.56

The contributor's table showed the largest gain at two threads, while the reported gain at 64 threads was 2.56%. Generation throughput rose with more threads in both builds, but the relative benefit declined after two threads. Thus, the thread settings for the largest gain and highest throughput differ.

The percentages in the table are the contributor's reported figures, calculated as (modified build - baseline) / modified build rather than as an increase over the baseline. Measured against the baseline instead, the two-thread step from 1.63 to 2.12 t/s is about 30.06% higher throughput, so the reported 23.11% is smaller than the baseline-relative gain.

3. Measurements used the same baseline build and benchmark

The PR ran llama-batched-bench on b11269 and the modified build with matching input and generated token counts and thread counts. The published command was as follows.

numactl -C ${AFFINITY} --membind=${MEMBIND} llama-batched-bench \
--model ${MODEL_DIR}/${MODEL} \
-npp 16 \
-ntg 512 \
--threads ${OMP_NUM_THREADS} \
-npl 2 \
--ctx-size 16896 \
--seed 0 \
--verbose

The output quality comparison used matrixportalx/Llama-3.3-8B-Instruct-Q4_K_M-GGUF separately from performance testing. Perplexity (PPL), the quality metric published by the contributor, matched between the baseline and modified builds at every batch size.

Table: Output quality metric comparison by batch size

Conditions: Model matrixportalx/Llama-3.3-8B-Instruct-Q4_K_M-GGUF, comparison of baseline b11269 and the modified build

Unit: PPL

Measurements used the same baseline build and benchmark
Batch sizeb11269Modified build
19.22279.2227
29.22279.2227
49.22279.2227
89.22279.2227

4. Usage stays the same, but internal maintenance is more complex

The benefit is higher CPU throughput from changing the weight read order. The trade-off is that internal result placement and maintenance require more care. Automated code review flagged the logic for returning results from paired, distant rows to their original positions as hard to follow. The contributor said variable names were cleaned up and comments added.

The performance figures came from Grace with weight repacking disabled. The contributor described the gain as occurring when memory bandwidth, the amount of data memory can deliver per second, is not the bottleneck. Automated review noted that this approach was not applied to the separate matrix multiplication path for MoE models, which use multiple experts.

No new dependencies or model-specific options were added for users. b12620 is a prerelease with CPU builds for multiple operating systems. Users can continue their existing workflow with a build suited to their configuration.

This change raises CPU throughput by improving read order without new settings, while adoption should reflect reported gains and thread configuration.