llama.cpp batch size: ten big models read long prompts 2.5 to 7.3 times faster on one RTX 5090
On one RTX 5090 desktop, a bigger micro-batch (how many prompt tokens llama.cpp reads in one pass) made reading a long prompt the server had not seen, mostly 48,000 tokens, 2.5 to 7.3 times faster than the default on ten of the twelve models whose expert weights sit in system RAM.
- If part of your model sits in system RAM, read the prompt in bigger chunks (
-b 4096 -ub 2048, then-b 4096 -ub 4096, then-b 8192 -ub 8192), and stop at the first that fails. Look for an inherited small value too: two models that had inherited-ub 128read 17.5 and 19.9 times faster once it was raised. How to tune your own - Find each model's own limit at the window you actually use, and test it with real text. Bigger chunks take more graphics-card memory, and one setting that read 150,153 tokens correctly and passed 110 other prompts crashed the server on a single 3,007-token prompt. The crash
- If the whole model fits on the card, expect less. Five of six such models read 3 to 34.5 percent faster, the sixth slower, and all six kept the default. Models on the card
What to do
Two settings decide how llama.cpp reads a prompt.
--batch-size (-b) is the most prompt tokens the
server hands the model in one step; --ubatch-size
(-ub), the micro-batch, is the most tokens that go through
the model's layers in one pass. At the build most of these models ran,
the defaults are 2048 and 512. Keep
-b at least as large as -ub. Each value you try
is one long read; with the stress test, Qwen3-235B took 35 minutes in
all and Qwen3.5-397B 34.
- Check where the weights live. Most of a
mixture-of-experts model's weights are “experts”, of which
each token uses only a few; when the file is bigger than the card, they
usually stay in system RAM. If any do
(
-cmoe,--n-cpu-moe,--fit, or a file bigger than your card), this is worth doing. - Build one long read you can check. A long prompt
(we used 48,000 tokens) with a short code planted in the middle and a
question asking for it; temperature 0; a document the server has not
seen;
max_tokensbig enough for a thinking model (we used 900; why). Readtimings.prompt_per_secondfrom the response, and look for the code in the answer, not only in the reasoning. Time the second read after a start too (why). - Step up one value at a time. Your current setting,
then
-b 4096 -ub 2048,-b 4096 -ub 4096,-b 8192 -ub 8192. Stop at the first value that fails to load, drops the connection mid-read (here, the sign of running out of card memory), loses the code, or reads slower than the one before. - Decide whether the gain is worth its cost. The stop rule finds the fastest value that works, not the one to keep. Here every model with experts in RAM uses a bigger value at the window it was swept at (131,072 for most), where reading got at least twice as fast; none of the six on the card does. At the largest windows some models keep the default or a smaller value, and the two-machine setup kept the default (settings at the larger windows).
- Watch card memory during the read, not just after load. Our peaks ran up to 465 MiB above the load reading. Leave room for anything else on the card.
- Re-run the winner at the window you actually use, with a
long read. The window (context size) is how many tokens the
server can hold. At double the window the same setting took 2,178 to
5,167 MiB more card, and one model that loaded
-ub 4096at 131,072 could not load it at 196,608 (settings at the larger windows). - Test it with real text. Forty to sixty prompts of
real mixed text sized around one and two micro-batches, plus
repetitive input (logs, tables, ledgers), a small
max_tokens, and a restart after any crash, keeping the prompt that caused it. Replay any prompt that ever crashed a server. - Check that the setting reached the server.
llama-server's progress lines advance in steps of
-b(512 on Laguna's inherited-b 512, 2,048 at the default, 4,096 at-b 4096); at our log level the micro-batch itself was not printed. - Judge writing speed on a real reply. Writing the reply (decode) goes one token at a time, and the micro-batch does not enter into it; an answer of 11 to 100 tokens is not a speaking speed.
- If you often edit or regenerate the last message, each edit re-reads about one micro-batch on some models (the cost); a normal next turn does not.
What we found
Against llama.cpp's default, long reads got 2.5 to 7.3 times
faster: from Qwen3-235B's 2.46 to DeepSeek V4 Flash's 7.29,
whose 48,000-token read went from 576.9 seconds to 79.2. Against
an inherited -ub 128, 17.5 and 19.9 times (MiniMax
M2.7 on a 3,658-token read, Laguna S 2.1 on 24,071 tokens). The other two of the twelve, Laguna S 2.1
and MiniMax M2.7, started from -ub 128 rather than the
default, so they are compared against that, on shorter prompts (the M2.7
test did not check the answer). Speeds are
tokens a second (t/s). “Was” is the setting before the tests,
“now” the setting its start script uses at the window given
under the table (some use another value at 262,144; see
settings at the larger windows). Decode figures are
short answers (tokens generated on the second line): they show whether
writing speed moved; it moved less than 7 percent for every value kept
but one (same day, same window).
| Model · file | Read, tokens | Was, t/s | Now, t/s | Setting at that window | Card, MiB | Decode, t/s | Date |
|---|---|---|---|---|---|---|---|
| DeepSeek V4 Flash UD-Q8_K_XL, 161.9 GB e | 48,073 | 83.3 | 607.1 (7.3×) | -b 8192 -ub 8192 | 17,063 → 22,089 after load | 9.91 → 9.58 74, 70 tokens | 20 Sep |
| GLM-5.3-Flash UD-Q3_K_XL, 147.5 GB b | 24,008 → 20,333 | 80.7 | 446.0 (5.5×) | -b 4096 -ub 4096 | 24,352 → 29,872 peak during read | 9.22 → 9.35 62, 60 tokens | 21 Sep |
| Mistral Small 4 119B UD-Q4_K_M, 73.8 GB | 48,697 | 481.3 | 2,192.3 (4.6×) | -b 8192 -ub 8192 | 26,882 → 29,756 peak during read | 21.01 → 20.97 11, 11 tokens | 21 Sep |
| Qwen3.5-397B-A17B UD-IQ3_XXS, 149.8 GB | 48,029 | 224.5 | 932.2 (4.2×) | -b 4096 -ub 4096 | 26,195 → 29,360 peak during read | 16.39 → 16.41 11, 11 tokens | 21 Sep |
| Qwen3.5-122B-A10B UD-Q4_K_S, 73.4 GB | 48,027 | 520.2 | 2,101.7 (4.0×) | -b 4096 -ub 4096 | 26,911 → 29,619 peak during read | 30.81 → 32.72 648, 716 tokens | 21 Sep |
| Ornith-1.5-35B Q6_K, 29.2 GB | 48,027 | 1,860.2 | 6,283.3 (3.4×) | -b 4096 -ub 4096 | 27,304 → 28,691 peak during read | 73.57 → 73.20 87, 83 tokens | 21 Sep |
| Ling-3.0-flash Q4_K_M, 77.8 GB a | 47,992 → 47,986 | 238.2 | 727.7 (3.1×) | -b 4096 -ub 2048 | 7,233 after load; 8,824 peak | 27.46 → 23.25 77, 77 tokens | 20 and 21 Sep |
| Ling-3.0-flash, one day and window a | 3,007 | 201.5 | 444.0 (2.2×) | -b 4096 -ub 2048 | 8,037 → 8,871 peak during read | 24.41 → 23.0 104, 64 tokens | 21 Sep |
| Inkling-Small UD-Q3_K_XL, 119.6 GB e | 48,115 | 123.0 | 337.9 (2.7×) | -b 4096 -ub 2048 | 12,641 → 13,183 after load | 12.23 → 11.77 97, 97 tokens | 20 Sep |
| Qwen3.8-Flash-Next UD-Q3_K_XL, 90.0 GB e | 48,069 | 203.2 | 511.7 (2.5×) | -b 4096 -ub 2048 | 19,444 → 21,394 after load | 18.14 → 18.75 99, 104 tokens | 20 Sep |
| Qwen3-235B-A22B-Instruct-2507 Q4_K_M, 142.2 GB | 48,020 | 285.8 | 703.3 (2.5×) | -b 4096 -ub 2048 | 28,317 → 29,421 peak during read | 8.27 → 8.18 11, 11 tokens | 21 Sep |
| Laguna S 2.1 Q4_K_M, 68.2 GB c | 24,071 | 72.2 at -ub 128 | 1,434.0 (19.9×) | -b 8192 -ub 8192 | 27,973 → 28,272 peak during read | 18.40 → 16.50 12, 12 tokens | 21 Sep |
| MiniMax M2.7 UD-IQ4_XS, 108.4 GB d | 3,658 | 32.3 at -ub 128 | 564.0 (17.5×) | -b 4096 -ub 4096 | 22,530 → 24,359 after load | 9.9 → 9.3 32, 32 tokens | 19 Sep |
Eleven of these files are larger than the card;
Ornith-1.5-35B's keeps 6 of its 41 layers' experts in RAM. Windows:
131,072 tokens, except Ling's 21 September figures (262,144) and Laguna
(32,768). Card memory at load and peak during the read are not
comparable. The code came back at every setting shown except M2.7's,
which was not checked. a Ling's first line spans two passes
and two windows: 238.2 on 20 September (flags copied by hand, 131,072)
and 727.7 on 21 September (its own script, 262,144); the second line is
one pass at one window. -ub 4096 read 1,140.4 on the 20th
and was withdrawn (the crash). b The
default read was a load's first request; the tuned 20,333-token read was
the third on its load, and the fourth, 48,168 tokens, read at 425.1.
c “Was” is its inherited -b 512 -ub 128,
not llama.cpp's default. d Its own test script, a
repeated-paragraph prompt with no answer check; at llama.cpp's default
512 the same prompt read 100.8. e Read at 131,072, half the
262,144-token window these scripts use. There, DeepSeek read 150,324
tokens at 480.0 (below), Qwen3.8-Flash-Next 48,075
at 660.6 against 240.2 at the default (below),
and Inkling-Small only 3,000-token prompts, at 263.6 and 187.9.
Why it helps when experts sit in system RAM
During prompt reading, when an operation's weights live in system RAM
and the batch is large enough, llama.cpp hands it to the graphics card,
carrying those weights across for that pass. The trip costs about the
same for 512 tokens as for 8,192, so a bigger micro-batch pays it fewer
times: a 48,000-token prompt is 94 micro-batches at the default and 12 at
4096 (arithmetic). This is our reading of the code; we did not instrument
the transfer. The cost is card memory, for a working buffer sized to one
micro-batch: on MiniMax M3 split across two machines (20 September) it
asked for 19,785.25 MiB at -ub 4096 (with two different
splits) and exactly half at 2048; all three requests were refused.
At a full window, same file and build
DeepSeek V4 Flash Q8 at a 262,144-token window, every expert in RAM:
on 15 September at the default it read 150,475 tokens in 2,062.2 seconds
(72.97 t/s), all three planted codes returned; on 20 September at
-b 8192 -ub 8192 it read 150,324 tokens in 313.2 seconds
(480.0 t/s), its one code returned: 6.6 times the reading rate. More
than the batch differed: two different synthetic ledgers, thinking off
on the earlier request, other launch flags (both set temperature 0), and
the earlier read was a later request after a 220-second load, the later
one a first request.
Qwen3.8-Flash-Next at the window it uses
Re-measured on 26 September at 262,144, with about 58 to 60 GB of its 90 GB file in memory, it kept the gain:
| Read, tokens | -b 4096 -ub 2048, t/s | Default, t/s | Gain | Codes |
|---|---|---|---|---|
| about 3,000 | 517.6 | 255.7 | 2.02× | 1 of 1 |
| 48,075 | 660.6 | 240.2 | 2.75× | 1 of 1 |
| 229,981 | 535.4 (429.6 s) | 205.5 (1,119.3 s) | 2.61× | 3 of 3 |
Card: 26,795 MiB at load and at most 27,271
after a read with -b 4096 -ub 2048, against 21,333 and
21,694 with the default. Decode 12.3 to 22.6 t/s on
both, on answers of 11 and 33 tokens.
A first request can be slow while the file loads. The bigger setting's server started with none of the file in the page cache (the copy the operating system keeps in RAM). Its first request, 3,035 tokens, read at 87.7 t/s while the file in memory grew from 43.5 to 57.7 GB, most of the time on the first 983 tokens (28.5 of 34.6 seconds); the next 3,019 tokens read at 517.6. The default's server started with 60.05 GB in memory, and its first request read at 253.7, its second at 255.7: a first request is not slow in itself, and this one was slow while the file paged in. Two earlier slow first reads at this window had no page-cache record: 3,041 tokens at 45.4 t/s on 20 September, spending 57.1 of 67.0 seconds on the first 989 tokens and 9.7 on the next 2,048, and 2,999 at 112.3 on a replay; Inkling-Small read 3,033 tokens at 263.6 there (187.9 on its replay). On the seven loads that read both lengths, a 3,000-token first request ran at 49 to 78 percent of the 48,000-token rate. Inkling's fit that; Flash-Next's, 9 and 22 percent of its 511.7, did not.
Models that fit on the card
With no weights to carry across, five gained 3 to 34.5 percent and the sixth read slower. All six kept the default, for reasons their start scripts record: Gemma 4 26B-A4B already read about 9,000 t/s and decoded slower as the batch grew (on 11-token answers); GLM-4.7-Flash and Qwen3.8-27B kept card room (1,371 MiB on Qwen3.8-27B's almost-full card); the rest gained 5.6 percent or less, or read slower.
| Model · file | Window | Default, t/s | Fastest read, t/s | Change | Decode, t/s |
|---|---|---|---|---|---|
| Gemma 4 26B-A4B UD-Q4_K_XL, 17.0 GB | 262,144 | 8,972.3 | 12,063.4 at 2048 | +34.5% | 163.68 → 153.82 11, 11 tokens |
| GLM-4.7-Flash UD-Q4_K_XL, 17.5 GB | 202,752 | 2,594.6 | 3,100.2 at 2048, answer empty (failed) | +19.5%, reading only | 129.60 → 130.09 429, 900 tokens |
| Qwen3.6-27B UD-Q4_K_XL, 17.6 GB | 131,072 | 2,966.5 | 3,133.3 at 2048 | +5.6% | 63.15 → 63.14 182, 166 tokens |
| Gemma 4 31B q4_0, 17.7 GB | 131,072 | 2,687.5 | 2,784.5 at 1024 | +3.6% | 56.45 → 55.92 11, 11 tokens |
| Qwen3.8-27B UD-Q5_K_XL, 20.2 GB | 131,072 | 2,634.8 | 2,717.5 at 2048 | +3.1% | 99.26 → 94.41 106, 106 tokens |
| Muse Glimmer 30B Q4_K_M, 16.8 GB | 131,072 | 2,737.7 | none faster | −0.6% at 1024, −7.1% at 2048 | 193.65 → 179.59 at 1024 and 182.69 at 2048; 139, 139, 138 tokens |
21 September, 48,000-token reads. GLM-4.7-Flash's
2048 spent all 900 tokens reasoning and gave an empty answer, counted for
reading speed only (why); its 1024 and 4096
answered, at 3,022.0 and 3,070.1. Qwen3.8-27B could not load
-ub 4096.
Each model has its own limit
No single value was safe for every model. The limit depends on the model, how it is split between card and RAM, and its window, and the failure can come at load or mid-read.
- At load.
-ub 8192failed on Qwen3.8-Flash-Next (131,072 window, 20 September; a 16,171.13 MiB buffer refused) and, on 21 September, GLM-5.3-Flash (15,424.89), Qwen3.5-397B (3,712.25), Qwen3.5-122B (3,264.25) and Qwen3-235B (2,752.23). Qwen3.8-27B, on the card, failed at-ub 4096(1,568.13). - Mid-read. Inkling-Small at
-ub 8192loaded at 18,130 MiB, then 8,203 tokens into the read asked for 29,242.27 MiB, was refused, and died. The client saw only a dropped connection. - Where 8192 worked. DeepSeek V4 Flash Q8, Laguna S 2.1 at 32,768 tokens, Mistral Small 4, and Ornith-1.5-35B (7,393.7 t/s, but a 30,087 MiB peak, so it uses 4096).
- The window moves the limit. At 262,144 instead of
131,072 the same setting took 2,178 to 5,167 MiB more card after
load: Ling at
-ub 40968,107 to 10,285 MiB, Inkling-Small at 2048 13,183 to 17,281, DeepSeek at 8192 22,089 to 26,023, Flash-Next at 2048 21,394 to 26,561. MiniMax M2.7 at its 196,608 window could not load 4096 (a 2,916.16 MiB buffer refused) or 2048; only 1024 loaded.
Settings at the larger windows
- MiniMax M2.7 at 196,608:
-b 4096 -ub 1024, every expert layer in RAM, 8-bit cache. Loaded at 31,709 MiB, peak 31,907. It read 20,039 tokens at 167.9 t/s, 47,933 at 181.2 and 189,491 at 155.9 (the last in 1,215.4 seconds), returning all three planted codes, with thinking on. Its 40-prompt stress test, on prompts of 534 to 11,160 tokens, ran without a crash, but all 40 answers are recorded empty, so it checked only that the server stayed up. - GLM-5.3-Flash at 262,144:
-ub 1024. Its 131,072 setting,-ub 4096, did not load there (a 13,281.37 MiB buffer refused).-ub 2048read 20,065 to 230,039 tokens at 206.0 to 250.3 t/s, all three codes on the deepest, but peaked at 31,951 MiB, 656 below the card's total; 1024 peaked at 29,261 and read 20,065 and 47,992 tokens at 135.1 and 142.6, and nothing longer. The script uses 1024 for 2,690 MiB more room and, its comment says, to stay off-ub 2048, the value that crashes in llama.cpp report #28282; our reads at 2048 did not crash. At 131,072 the same probe read 47,992 tokens at 404.9 t/s. Its stress test ran without a crash, with 36 of 40 answers empty. - Ornith-1.5-35B at 262,144:
-b 2048 -ub 2048. A 229,090-token document took 71.7 seconds against 151.8 at 2048 / 512, three codes back each time (256K page). - Qwen3.5-122B at 262,144: 512.
-ub 1024took 310.0 seconds against 510.6, but peaked at 31,785 MiB, 822 below the card's total of 32,607 that day (Qwen3.8-27B at 256K package). - Unmeasured above the swept window: Qwen3.5-397B and Mistral Small 4 return to the default above 131,072; Laguna S 2.1 drops from 8192 to 4096 above 32,768.
Two files of one model need two values. DeepSeek V4
Flash IQ3, with 7 of its 43 expert layers on the card, uses
-ub 4096; the Q8 file uses 8192. At 262,144 the IQ3 file
read 48,024 tokens at 426.5 t/s at 2048 and 690.9 at 4096, and 150,103
tokens at 632.1 at 4096 (149,898 at 403.8 at 2048), code returned each
time.
One correct read does not make a setting safe
On 20 September, Ling-3.0-flash at -b 4096 -ub 4096 read
47,992 tokens at 1,140.4 t/s with the code correct, at 131,072. Loaded at
its 262,144 window, the server died on its first request:
CUDA error: an illegal memory access was encountered
On 21 September, through its own script at 262,144 and
-ub 4096, five reads on one load (3,005, 2,991, 19,962,
48,084 and 150,153 tokens, the three long ones at 1,067.6 to 1,173.9
t/s) were all correct. Then a fresh load got the exact 3,007-token ledger
from the 20 September check as its first request, and died
the same way. At 2048, 1024 and 512 that prompt passed (444.0, 325.7 and
201.5 t/s). By hand, with the model's exact launch flags, we narrowed it
down:
- Not the window: it crashed at 4096 with windows of 262,144, 131,072 and 65,536, and at 3072 with 262,144, the only window tried there.
- Not the length alone: ledgers of nine other sizes, 1,760 to 4,001 tokens, passed at 4096, as did real code at exactly 3,006, 3,007 and 3,008 tokens and five other lengths.
- Rare: 60 prompts of real mixed text and 50 random ledgers of 2,134 to 6,541 tokens, 110 in all, passed at 4096 and at 2048.
Ling now uses -b 4096 -ub 2048: 727.7 t/s on 47,986
tokens and 694.6 on 149,711, code correct, 8,824 MiB at peak, crash
prompt passed. The other eleven models with experts in RAM then got the
crash prompt and 40 prompts of real text: twelve runs (DeepSeek's two
files separately), 40 of 40 each, no crash, the code returned on every
replay. The six models on the card
were not stress-tested. A clean stress test is not a proof: forty prompts
per setting found nothing here, and the Ling fault passed 110.
We did not find the cause. The closest public report is llama.cpp
issue #28282, closed for inactivity in November 2026 with no fix recorded: an illegal memory access during
a long prompt read on GLM-5.3-Flash at -ub 2048, same GPU
family, with 512 or 128 as the workaround. It is a different model, and
no shared cause is shown. Our GLM-5.3-Flash at 4096, on its own build,
read 3,019 to 48,168 tokens and passed its 40 stress prompts without
it (the stress log does not print the micro-batch).
repro_ling_crash.py in the package
rebuilds the same request against any running server. The crashes here
come from the logs, not from that script.
Small values nobody had measured
Laguna S 2.1's start script, written in July, set
--batch-size 512 --ubatch-size 128, with no reason recorded,
a micro-batch a quarter of llama.cpp's default.
A 24,071-token read took 333.2 seconds at 72.2 t/s. At 2048 it read
698.4 t/s, at 4096 1,070.5 and at 8192 1,434.0 (16.8 seconds), code
correct each time; the shipped script with no override read 24,013
tokens at 1,406.5. Decode on its 12-token answer fell from 18.40 to 16.50
t/s (15.32 in that run), the one kept value whose decode moved more than 7 percent. The script lets
llama.cpp choose the placement (--fit on, 4,096 MiB
kept free); we suspect the bigger buffer pushed some experts back to
RAM, but the logs do not record the placement.
MiniMax M2.7 was first tried with
-cmoe -ub 128, the same pair of flags as the MiniMax M3
script, again
with no reason recorded. One 3,658-token prompt read 32.3 t/s at 128,
100.8 at the default 512, 184.7 at 1024, 324.3 at 2048 and 564.0 at
4096. At 43,909 tokens, 4096 read 640.2 t/s with every expert layer in
RAM and 656.5 with 59 of 62, the split it now uses; at 128 that read would take about 22.7
minutes (arithmetic, not run). The installed script returned 3 of 3
codes in a 43,679-token document, passed its stress test and returned
the code on the crash prompt.
Two other settings we turned down
DeepSeek V4 Flash Q8, 20 September, 16,011-token reads at 131,072, one-word replies (8 tokens), no answer check:
| Setting | Reading, t/s | Card after load, MiB |
|---|---|---|
| default micro-batch, f16 cache, every expert in RAM | 81.6 | 17,229 |
| default micro-batch, q8_0 K and V cache | 82.4 | 16,662 |
-b 4096 -ub 2048, f16 cache | 260.8 | 17,933 |
-b 4096 -ub 2048, q8_0 K and V cache | 255.1 | 17,465 |
- A compressed (q8_0) cache: no gain, a known risk. 0.9 percent faster at the default, 2.2 percent slower at 2048. Two public reports describe garbage output with a quantized K cache on this architecture: llama.cpp #25382, closed as completed on 7 July, and #26423, from a build with that fix, closed as not planned on 5 August.
- Experts on the card: not measured on this file (correction). Report #25582, from a different machine (closed as not planned on 5 September), describes this model's output degrading as more expert layers run on the card; we turn it down on that report alone. Our IQ3 file, with 7 of 43 expert layers on the card, returned its code at every depth we read, 2,998 to 150,103 tokens, a narrow check, not a quality test.
A thinking model with a small budget returns an empty answer
Our first 48,000-token check on DeepSeek V4 Flash set
max_tokens to 64. Every setting, the default included, came
back empty: the model spent all 64 tokens reasoning. After a settings
change that looks exactly like corruption; here it was the budget. At
900 the same reads used 70 to 79 tokens and returned the code. It
happened once at 900 too: GLM-4.7-Flash at 2048 spent all 900 tokens
reasoning, with the code in its reasoning and an empty answer, while 1024
and 4096 answered in 433 and 488 tokens.
Editing the last message re-reads one micro-batch
For models whose cache cannot be rolled back token by token, or that
use sliding-window attention (DeepSeek V4 Flash does:
deepseek4.attention.sliding_window = 128), llama-server keeps
restore points 4 + n_ubatch tokens and 4 tokens
before the end of every prompt. Measured on DeepSeek V4 Flash IQ3 split
across two machines (below), 262,144
window. For each document, three requests: the cold read; the same
document with a different last question (about 200 words asked for); and
a real next turn, sending back the first request, the reply as returned,
and a short new question.
| Re-read on the second or third request | -ub 512 | -ub 2048 | -ub 4096 |
|---|---|---|---|
| Swapped last question, 3,000-token document | 533 tok, 4.4 s | 2,065 tok, 9.4 s | 3,015 tok (all of it), 12.4 s |
| Swapped last question, 48,000-token document | 533 tok, 10.0 s | 2,065 tok, 28.2 s | no result (why) |
| Real next turn, 3,000-token document | 245 tok, 3.0 s | 227 tok, 2.8 s | 233 tok, 2.9 s |
| Real next turn, 48,000-token document | 238 tok, 5.4 s | 228 tok, 5.0 s | no result |
At 150,103 tokens (-ub 512 only): swapped question 533 tokens in 20.7 seconds, next turn 239 tokens in 9.7 seconds.
A normal next turn re-read only the new 227 to 245 tokens at every setting. A changed last message went back one micro-batch: 3.9 times as many tokens at 2048 as at 512, and 2.8 times the wait on the 48,000-token document. The same restore points apply to every model of those two kinds; we measured DeepSeek only.
Two machines: the one setup that kept the default
DeepSeek V4 Flash IQ3 split across the desktop and an ASUS ROG Flow Z13 laptop over Thunderbolt with llama.cpp's RPC backend (one model spread over two machines), 262,144 window (layers 0 to 7 on the desktop's card, 8 to 17 with their experts in the desktop's RAM, 18 to 42 on the laptop). At 512: 161.8 t/s on a 2,998-token read, 102.5 on 48,024 tokens (468.4 seconds). At 2048: 224.9 and 117.0 (410.5 seconds), 14 percent faster at 48,000 tokens. At 4096: 250.5 on the short read; on the long one, after 40,960 tokens, the desktop logged the laptop's worker as crashed (“Remote RPC server crashed or returned malformed response”); the laptop's log of that moment is not in our records. We kept 512: the split read 150,103 tokens in 2,922.9 seconds (51.4 t/s), code correct, and decoded 12.05 t/s on a reply of about 400 tokens at 48,000 and 7.85 at 150,000. The IQ3 file on the desktop alone at 4096 read the same tokens in 237.5 seconds.
Limits
- One machine, one request at a time. 188 GiB of RAM, one CPU, and a RAM-to-card link we did not measure; the gain depends on how fast weights cross, so a different card or link will move it.
- The builds of that week. Seven llama.cpp commits, three of them forks or a pull-request branch. Defaults change. Public report states are as of 26 September 2026.
- Reading speed, not answer quality. The check is a planted code (one, or three in the longest documents), and the stress tests looked for crashes, not answers. Most decode figures come from answers of 11 to 100 tokens.
- Single runs. The untuned DeepSeek 48,000-token read measured 72.3 t/s in one run and 83.3 in another with the same flags, after loads of 3 minutes 55 seconds and 3 seconds; we use 83.3, the less flattering baseline. Flags were copied by hand at 131,072 on 20 September and run through each model's own script on 21 September; Ling's ratio spans both passes, GLM-5.3-Flash's two read lengths.
- First requests and half windows. Most main-table reads were a load's first request, with the page cache not recorded. Three are at half the window their scripts use; Inkling-Small's long reads at 262,144 were not re-measured.
Corrections and updates
- Two inherited micro-batches nobody had measured.
Laguna S 2.1 ran at
-ub 128from July to 21 September, and MiniMax M2.7 was first judged at-cmoe -ub 128. Measured, those values cost a factor of 19.9 and 17.5 in reading. - “Confirmed” at the served window. After
20 September, three start scripts carried the comment “Confirmed
to LOAD and answer at the full served window (ctx 262144)”. The
run cited for Ling's
-ub 4096(10,285 MiB) died on its first request: the comment took its card figure from the load line of a result file that also records the crash, and the script used 4096 until the afternoon of 21 September. The runs cited for Inkling-Small and Qwen3.8-Flash-Next at 2048 (17,281 and 26,561 MiB) did load and answer, but each was one 3,000-token read, the comments gave reading speeds from 131,072 only, and Flash-Next's 45.4 t/s at 262,144 appeared in neither. Both comments were corrected on 26 September. - An “experts on the card” test that moved no
experts. Our records said moving DeepSeek V4 Flash's experts
onto the card was measured and bought nothing (255.1 against 260.8
t/s). Those runs used
--n-cpu-moe 50on a 43-layer model, so every expert stayed in RAM and card use fell by 468 to 567 MiB; they measured the q8_0 cache. The same records called the reports behind both refusals open: #25382 had been closed as completed on 7 July, before any of these runs, and #25582 as not planned on 5 September. - A speaking figure that was an 11-token answer. We
chose
-ub 2048on Qwen3-235B over 4096 partly because an 11-token answer decoded 12 percent slower at 4096 (7.20 against 8.18 t/s). That is not a speaking measurement. The other reason stands: at 4096 the card peaked at 31,053 MiB. 4096 read 944.2 t/s. The same kind of figure is part of why Gemma 4 26B-A4B kept the default. - Labels in our own test files. Result files of runs
with no override say “llama.cpp default 512” even when the
script set
-ub 128(Laguna) or 4096 (Ling's crash run), and the M2.7 console printed “FIT” for two window settings that failed to load. The server logs are right; the package README lists each case. - Update, 26 September 2026. Measurements added at the larger windows: Qwen3.8-Flash-Next with its page cache recorded, MiniMax M2.7 at 196,608, and GLM-5.3-Flash, Ornith-1.5-35B and Qwen3.5-122B at 262,144. Before this, four scripts returned to the default above 131,072, unmeasured. Settings at the larger windows are in section 03.
How this was measured
Every figure is measured on this machine on the date given, unless it is marked arithmetic.
| Machine | One NVIDIA GeForce RTX 5090 (32 GB), 188 GiB of system RAM. --threads 24 --threads-batch 24, --parallel 1, flash attention on or auto, one model at a time. |
|---|---|
| The read | A synthetic ledger of near-identical numbered lines, seed 20260920, within 2 percent of 48,000 tokens (24,000 on Laguna S 2.1), one code at half depth and the question “quote the sealed reference exactly. Answer with the code only.” Temperature 0, max_tokens 900, a freshly loaded server, nothing in the prompt cache. Speeds are the server's own timings.prompt_per_second and predicted_per_second. From 21 September a non-empty answer had to contain the code; an empty one passed for reading speed if the code was in the reasoning. |
| Dates | 15 September: the DeepSeek depth baseline (a separate study). 19 September: MiniMax M2.7. 20 September: flags copied by hand at 131,072; Laguna could not start, as the copied --n-gpu-layers 999 put all 64,771.15 MiB on the card. 21 September: the rest through their own start scripts, the stress tests and the two-machine runs. 26 September: the larger-window runs, page cache read with mincore (the page-cache reader). |
| Stress test | A fresh load whose first request was Ling's 3,007-token crash prompt, then 40 prompts of real code and text from llama.cpp's source tree, max_tokens 32. |
| Card memory | Raw nvidia-smi MiB, desktop included: once after load on 20 September, peak during the read (sampled every 2 to 5 seconds) on 21 September. |
| Scripts before | Of 25 start scripts, 20 left both settings at the defaults; one set -b 64 -ub 32, two -ub 128, two above the default. |
| Source lines | At d3146f2b5: defaults common/common.h lines 451 and 452; weights carried to the card ggml/src/ggml-backend.cpp lines 966 to 975, the CUDA backend taking any batch of at least 32 tokens (ggml-cuda.cu lines 5536 to 5539 and 5710); restore points tools/server/server-context.cpp lines 3465 to 3472 and 3559 to 3565. |
The builds
Each model ran on the llama.cpp binary its start script names, all built before the sweep.
| Commit | Origin | Models in this study |
|---|---|---|
| d3146f2b5 | ggml-org mainline, build 10919 (a second build of it with RPC enabled) | Ling-3.0-flash, Qwen3.8-Flash-Next, GLM-4.7-Flash, Gemma 4 26B-A4B; with RPC: MiniMax M2.7, MiniMax M3, DeepSeek V4 Flash IQ3 |
| 946fc11d1 | llama.cpp pull request #25731, a draft adding the Inkling architecture | Inkling-Small |
| 04b2b72 | Poolside's llama.cpp fork | Laguna S 2.1 |
| c8e03ce | ggml-org mainline | Qwen3.5-397B-A17B, Qwen3.5-122B-A10B, Qwen3-235B-A22B-Instruct-2507, Qwen3.8-27B, Qwen3.6-27B, Ornith-1.5-35B |
| 5f55650 | ggml-org mainline | DeepSeek V4 Flash Q8, Mistral Small 4 |
| d94f44e | Unsloth's llama.cpp fork, glm5next branch | GLM-5.3-Flash |
| 3cb7ffb | ggml-org | Gemma 4 31B, Muse Glimmer 30B |
Data and sources
- data/README.md: every folder, where files disagree, and every redaction.
- data/NUMBERS.md: every figure on this page, with its file and field.
data/runs/: result files, server logs and card-memory samples.data/tools/: the sweep, stress and turn scripts, the Ling crash reproducer and the page-cache reader.data/derived/: summary tables, model file headers, builds, the start-script count and the source lines.- Read at commit d3146f2b5; llama.cpp pull request #20288 and issues #25382, #26423, #25582 and #28282, checked on 26 September 2026.
If a number on this page disagrees with a file in the package, the file is right and the page is wrong; tell us and we will fix the page.