llama.cpp has released a new version that improves GPU efficiency for AI models that split computation among multiple experts. Developers running these models get improved work scheduling and a fix for a half-precision performance regression.

1. Rescheduling expert workloads by tile

For CUDA matrix multiplication in mixture-of-experts models, an auxiliary operation now preassigns small computation bundles called tiles. Matrix multiplication multiplies numbers arranged in rows and columns. Previously, only each expert's computation range was passed along. The new approach reduces the main operation's tile count and overhead while making work distribution among experts more flexible.

2. Throughput measured on a medium-sized mixture-of-experts model

According to the pull request (PR) author, the data layout change itself improves performance by 2–4%. The remaining gains come from reducing wasted computation with smaller tiles. The optimization favoring small tiles, previously limited to certain GPUs, now applies to a broader range of GPUs.

Below are some of the PR author's measurements for a medium-sized model. The model is gemma4 26B.A4B, with Q4_0 quantization, a process that reduces the numerical precision of the model.

The test processed an 8192-token prompt with a microbatch size of 64, the size of each processing chunk. The table compares the existing master with bea596f39, showing each GPU's change relative to its own baseline.

Table: Medium-sized mixture-of-experts model throughput by GPU

Conditions: gemma4 26B.A4B Q4_0, pp8192, microbatch 64, master versus bea596f39 (PR benchmark table)

Units: Throughput in tokens per second (t/s), speedup as a multiplier

Medium-sized mixture-of-experts model throughput changes by GPUMI60 / MI50: Speedup 1.43; MI100: Speedup 1.26; P40: Speedup 1.40; RTX 3090: Speedup 1.21; RTX 4090: Speedup 1.03; RTX 5090: Speedup 1.04; RX 6800: Speedup 1.47; RX 9060 XT: Speedup 1.02; Strix Halo: Speedup 1.03; V100-PCIE-32GB: Speedup 1.00MI60 / MI501.43MI1001.26P401.40RTX 30901.21RTX 40901.03RTX 50901.04RX 68001.47RX 9060 XT1.02Strix Halo1.03V100-PCIE-32GB1.00
Medium-sized mixture-of-experts model throughput changes by GPU
Throughput measured on a medium-sized mixture-of-experts model
GPUmasterbea596f39Speedup
MI60 / MI50453.58649.181.43
MI100765.78962.421.26
P40428.34600.661.40
RTX 30901611.881950.451.21
RTX 40903785.173906.791.03
RTX 50904690.154870.641.04
RX 6800408.49601.581.47
RX 9060 XT920.30936.631.02
Strix Halo631.28647.921.03
V100-PCIE-32GB625.76625.111.00

With the same model and settings, the RX 6800 reached 1.47x its baseline throughput, while the MI60 / MI50 reached 1.43x. Some other listed devices showed little change, indicating that the optimization's impact varies by hardware.

3. Fixing the F16 regression by skipping empty work

A half-precision (F16) performance regression was reported during PR review. The proposed fix immediately ends computation for experts with no assigned columns. The code change is as follows.

    const int expert_end   = ts.col_high;
    const int ncols_expert = expert_end - expert_start;

    if (ncols_expert == 0) {
        return;
    }

    GGML_UNUSED(channel_ratio);

Below are measurements showing a regression on a small mixture-of-experts model, with throughput ratios below 1 relative to the baseline.

Table: Throughput regression examples before the F16 fix

Conditions: granitemoe 3B.A800M F16, pp8192, microbatch 32, master versus bea596f39 (PR benchmark table)

Units: Throughput in tokens per second (t/s), speedup as a multiplier

Throughput ratios relative to baseline before the F16 fixRTX 3090: Speedup 0.80; RTX 4090: Speedup 0.84RTX 30900.80RTX 40900.84
Throughput ratios relative to baseline before the F16 fix
Fixing the F16 regression by skipping empty work
GPUmasterbea596f39Speedup
RTX 30902655.922111.880.80
RTX 40903686.063096.570.84

The fix to skip empty work was added after bea596f39, so this table shows results before the fix. The PR author said measurements on Granite 3.0 vary widely because whether the fixup kernel runs has a major impact on total time.

4. Weighing both benefits and costs

Small tiles reduce waste by assigning work more closely to the computation range. In exchange, precomputing and storing the new layout information moves into an auxiliary operation. The changed code also allocates temporary memory for per-tile information instead of per-expert computation ranges.

Verification tests on dense models, which compute without routing work among experts, showed little change. In the PR's llama 8B Q4_0 test with pp1024, throughput ratios relative to baseline were 0.99–1.03.

This improvement focuses on reducing wasted computation in mixture-of-experts models rather than broadly accelerating dense models. The b12144 release notes include both the CUDA changes and the half-precision regression fix.

b12144 improves CUDA processing for mixture-of-experts models and fixes an F16 regression, but practical performance should be assessed for each GPU and model setup.