[GH-ISSUE #4170] [Engine] dsv41 0.1.51: decode on fresh prompts waits on serial store reads (disk queue < 0.4 on a 990 Pro); DS4_AHEAD=1 is 10% slower (RTX 5090, Windows) #1830

Open
opened 2026-11-04 01:54:26 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @Guilzx9r on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4170

All numbers measured on my machine unless marked "derived" (computed from measured counters).

Setup

  • Strata 0.2.6 / Control 0.1.51, engine strata-dsv41 0.1.51, build 562a0c2ed716+dsv41+cuda13.0, NVIDIA driver 617.42, Windows 11.
  • Hardware:
    • RTX 5090 32 GB, PCIe 4.0 x16 (board limit).
    • Ryzen 7 7800X3D.
    • 128 GB DDR5 (4 × 32 GB at 3600 MT/s).
    • Samsung 990 Pro 2 TB, PCIe 4.0 x4 (behind the B650 chipset), model on this drive.
  • Model: DeepSeek V4.1 Flash 1017, pack ist-das-2.25bpw, context 256k.
  • Launch: --set reserve-mib=8192 --set ssd-cache=96 --speed faster (experts 5).
  • Engine log at start:
    • RAM store: up to 8436 slots of 11.4 MB (96.0 GB), policy 0, 8 reader threads, unbuffered reads
    • RAM store: 8180 of the profile's hottest experts read in (74.8 GB) in 12.8 s
    • 13906 routed experts on the CPU lane (135.3 GB, in place in the model's files), 8 threads
    • CUDA0 … experts 14.53 GB (1454 of 15360 in VRAM)

Observation

On repeated prompts decode runs at about 25 tok/s; on never-seen prompts it drops to about 15 tok/s. That second case is what an agent workload (Hermes) actually sees. During the slow case the SSD is far from busy.

Method:

  • Windows PhysicalDisk counters for the model drive, sampled every 0.7 s.
  • Each phase uses only the samples inside its own requests' time window.
  • Two baseline runs (A1, A2), each a fresh launch with the same expert profile file.
  • Same prompts, temperature 0, no reasoning, 256 tokens per request.
Phase Decode tok/s Disk read MB/s (mean) Peak MB/s Reads/s KB/read Disk queue MB read per token (derived)
Repeated prompts, A1 25.0 222 640 497 1552 0.04 8.9
Repeated prompts, A2 24.9 270 1060 529 1401 0.12 10.9
Fresh prompts, A1 15.1 739 3869 861 957 0.38 49.0
Fresh prompts, A2 16.1 764 1320 870 973 0.26 47.3
Store preload at start (25/10 run) — 4300 (avg) 5900 — 2900 1.8 —

Derived

  • Per-read service time. By Little's law (time per read = queue ÷ reads per second), fresh-prompt reads take about 0.30–0.44 ms each for about 1 MB. So roughly one read is in flight at a time.
  • Data per token. About 48 MB per token is read from the SSD on fresh prompts, about 5 experts' worth at about 9.7 MB each.
  • Time per token. Fresh decode costs about 64 ms per token against about 40 ms on repeated prompts, so about 24 ms more. About 50 reads of about 1 MB at 0.3–0.44 ms each, one after another, is about 15–22 ms. That is most of the gap.
  • Unused headroom. The same drive delivers 4.3 GB/s average (5.9 GB/s peak) at queue depth 1.8 during the store preload, against 0.74–0.76 GB/s during fresh decode.

What is not the limit (measured)

  • RAM bandwidth.

    • A C# probe (built-in .NET, 4 GB buffer, engine stopped) reads 48–51 GB/s, against 57.6 GB/s theoretical at 3600 MT/s dual channel. Random latency is 104 ns (4 KB pages).
    • On cached decode, a 2-thread memory-read load (38 GB/s) cost about 21%, while a 2-thread CPU-only load cost about 1%. So cached decode is partly RAM-sensitive.
    • Fresh-prompt decode is dominated by the SSD wait above.
  • PCIe 4.0 x16 (GPU). nvidia-smi dmon during decode: host→GPU 0.33 GB/s mean (1.3 GB/s peak), about 1–4% of the link, warm and fresh alike. Only a 13.7k-token prompt read uses it heavily: 13.3 GB/s mean, peaks 26–33 GB/s.

  • GPU power. Power limit 400 W: decode draws 142–171 W at 2931 MHz, with no power, thermal or hardware throttling.

  • More store reader threads. With queue < 0.4 the 8 store readers are mostly idle. I did not test DS4_STORE_THREADS > 8 for that reason.

  • Router lookahead into the store (DS4_AHEAD=1, A/B/A, environment of the test process only):

    Run Repeated prompts Fresh prompts
    A1 25.0 tok/s 15.1 tok/s
    DS4_AHEAD=1 22.5 tok/s 14.8 tok/s
    A2 24.9 tok/s 16.2 tok/s
    • It reads 20–25% more from disk.
    • Outputs are identical: the text hash matched for all 13 requests in the three runs.
    • This matches your note in init_store() ("measured 4.5 against 4.7 tok/s… DS4_AHEAD=1 turns them on"). Keeping it off is right here too.

Question

On a miss, the decode path seems to wait on the store reads of a layer about one at a time: queue 0.26–0.38 while the drive can sustain 4–6 GB/s at queue about 2.

  1. Could the misses of a layer (and/or the 1 MB pieces of one expert) be issued together, so the NVMe queue fills while the CPU lane waits?
  2. Is the per-layer dependency the hard limit, so that only better guesses (lookahead) can hide it?
  3. Are the st.ahead_* counters (ahead_pf, ahead_hit…) exposed anywhere (log or /metrics)? I could not find where they are printed.

I can rerun any of this with a build or a flag you suggest and post the numbers.

Originally created by @Guilzx9r on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4170 All numbers measured on my machine unless marked "derived" (computed from measured counters). ## Setup - Strata 0.2.6 / Control 0.1.51, engine `strata-dsv41` 0.1.51, build `562a0c2ed716+dsv41+cuda13.0`, NVIDIA driver 617.42, Windows 11. - Hardware: - RTX 5090 32 GB, PCIe 4.0 x16 (board limit). - Ryzen 7 7800X3D. - 128 GB DDR5 (4 × 32 GB at 3600 MT/s). - Samsung 990 Pro 2 TB, PCIe 4.0 x4 (behind the B650 chipset), model on this drive. - Model: DeepSeek V4.1 Flash 1017, pack `ist-das-2.25bpw`, context 256k. - Launch: `--set reserve-mib=8192 --set ssd-cache=96 --speed faster` (experts 5). - Engine log at start: - `RAM store: up to 8436 slots of 11.4 MB (96.0 GB), policy 0, 8 reader threads, unbuffered reads` - `RAM store: 8180 of the profile's hottest experts read in (74.8 GB) in 12.8 s` - `13906 routed experts on the CPU lane (135.3 GB, in place in the model's files), 8 threads` - `CUDA0 … experts 14.53 GB (1454 of 15360 in VRAM)` ## Observation On repeated prompts decode runs at about 25 tok/s; on never-seen prompts it drops to about 15 tok/s. That second case is what an agent workload (Hermes) actually sees. During the slow case the SSD is far from busy. Method: - Windows PhysicalDisk counters for the model drive, sampled every 0.7 s. - Each phase uses only the samples inside its own requests' time window. - Two baseline runs (A1, A2), each a fresh launch with the same expert profile file. - Same prompts, temperature 0, no reasoning, 256 tokens per request. | Phase | Decode tok/s | Disk read MB/s (mean) | Peak MB/s | Reads/s | KB/read | Disk queue | MB read per token (derived) | |---|---|---|---|---|---|---|---| | Repeated prompts, A1 | 25.0 | 222 | 640 | 497 | 1552 | 0.04 | 8.9 | | Repeated prompts, A2 | 24.9 | 270 | 1060 | 529 | 1401 | 0.12 | 10.9 | | Fresh prompts, A1 | 15.1 | 739 | 3869 | 861 | 957 | 0.38 | 49.0 | | Fresh prompts, A2 | 16.1 | 764 | 1320 | 870 | 973 | 0.26 | 47.3 | | Store preload at start (25/10 run) | — | 4300 (avg) | 5900 | — | 2900 | 1.8 | — | ### Derived - **Per-read service time.** By Little's law (time per read = queue ÷ reads per second), fresh-prompt reads take about 0.30–0.44 ms each for about 1 MB. So roughly one read is in flight at a time. - **Data per token.** About 48 MB per token is read from the SSD on fresh prompts, about 5 experts' worth at about 9.7 MB each. - **Time per token.** Fresh decode costs about 64 ms per token against about 40 ms on repeated prompts, so about 24 ms more. About 50 reads of about 1 MB at 0.3–0.44 ms each, one after another, is about 15–22 ms. That is most of the gap. - **Unused headroom.** The same drive delivers 4.3 GB/s average (5.9 GB/s peak) at queue depth 1.8 during the store preload, against 0.74–0.76 GB/s during fresh decode. ## What is not the limit (measured) - **RAM bandwidth.** - A C# probe (built-in .NET, 4 GB buffer, engine stopped) reads 48–51 GB/s, against 57.6 GB/s theoretical at 3600 MT/s dual channel. Random latency is 104 ns (4 KB pages). - On cached decode, a 2-thread memory-read load (38 GB/s) cost about 21%, while a 2-thread CPU-only load cost about 1%. So cached decode is partly RAM-sensitive. - Fresh-prompt decode is dominated by the SSD wait above. - **PCIe 4.0 x16 (GPU).** `nvidia-smi dmon` during decode: host→GPU 0.33 GB/s mean (1.3 GB/s peak), about 1–4% of the link, warm and fresh alike. Only a 13.7k-token prompt read uses it heavily: 13.3 GB/s mean, peaks 26–33 GB/s. - **GPU power.** Power limit 400 W: decode draws 142–171 W at 2931 MHz, with no power, thermal or hardware throttling. - **More store reader threads.** With queue < 0.4 the 8 store readers are mostly idle. I did not test `DS4_STORE_THREADS` > 8 for that reason. - **Router lookahead into the store** (`DS4_AHEAD=1`, A/B/A, environment of the test process only): | Run | Repeated prompts | Fresh prompts | |---|---|---| | A1 | 25.0 tok/s | 15.1 tok/s | | `DS4_AHEAD=1` | 22.5 tok/s | 14.8 tok/s | | A2 | 24.9 tok/s | 16.2 tok/s | - It reads 20–25% more from disk. - Outputs are identical: the text hash matched for all 13 requests in the three runs. - This matches your note in `init_store()` ("measured 4.5 against 4.7 tok/s… DS4_AHEAD=1 turns them on"). Keeping it off is right here too. ## Question On a miss, the decode path seems to wait on the store reads of a layer about one at a time: queue 0.26–0.38 while the drive can sustain 4–6 GB/s at queue about 2. 1. Could the misses of a layer (and/or the 1 MB pieces of one expert) be issued together, so the NVMe queue fills while the CPU lane waits? 2. Is the per-layer dependency the hard limit, so that only better guesses (lookahead) can hide it? 3. Are the `st.ahead_*` counters (ahead_pf, ahead_hit…) exposed anywhere (log or /metrics)? I could not find where they are printed. I can rerun any of this with a build or a flag you suggest and post the numbers.
Author
Owner

@nayuta-yanagisawa commented on GitHub (Oct 27, 2026):

Same here on Linux with 0.2.7 (5e8a4cca, built locally): RTX 3090 24 GB, Ryzen 7 7700X, 64 GB DDR5, Lexar NM790 on PCIe 4.0, IST-DAS 2.00 bpw, --ssd-cache 40, the store preloaded from an expert profile. Through the server (six fresh prompts, 512 tokens each, four rounds), DS4_AHEAD=1 decodes 11.1 tok/s against 13.0 without it (−14%).

I measured where the time goes with the engine's own statistics (strata-dsv41 --ids ... --n 512, greedy, two prompts, two rounds each). The loss has two parts.

  1. With the lookahead on, the CPU lane waits for all of a layer's store reads before it computes anything. cpu_experts takes the hold.wait_all() path whenever it is given an order (ord != nullptr, since 6fcde7e3), and the lookahead passes one unless DS4_AHEAD_ORDER=0. So the miss split, which computes the RAM hits while the misses load, never runs. This is about two thirds of the loss here.
  2. The guesses make the SSD read about half again as much (274 against 179 MB a token). They cut the misses from 18 to 10 a token, but about 6 guesses a token go unused, and the store evicts 32 experts a token instead of 21. This is the other third.
Engine alone, ms a token (mean of 4 runs)
Lookahead off 75.3
DS4_AHEAD=1 91.5
DS4_AHEAD=1 DS4_AHEAD_ORDER=0 80.6
DS4_AHEAD=1, guesses made and ordered but not read (a local diagnostic switch) 85.5

With the order off and three guesses a layer (DS4_AHEAD_ORDER=0 DS4_AHEAD_EXTRA=-3), the lookahead came out level with it off (78.1 against 79.8 ms, measured alongside). So on this machine it does not pay, and keeping it off with the store is right. Holding the guesses' reads until no demand read is running (a patch I tried) changed little: −11% instead of −13% through the server.

On your machine, DS4_AHEAD=1 DS4_AHEAD_ORDER=0 would show whether the first part applies there too.

Not tested: Windows, other drives, store sizes other than 40 GB, the rank skips. I can attach the individual runs and logs.

<!-- gh-comment-id:6451163735 --> @nayuta-yanagisawa commented on GitHub (Oct 27, 2026): Same here on Linux with 0.2.7 (5e8a4cca, built locally): RTX 3090 24 GB, Ryzen 7 7700X, 64 GB DDR5, Lexar NM790 on PCIe 4.0, IST-DAS 2.00 bpw, `--ssd-cache 40`, the store preloaded from an expert profile. Through the server (six fresh prompts, 512 tokens each, four rounds), `DS4_AHEAD=1` decodes 11.1 tok/s against 13.0 without it (−14%). I measured where the time goes with the engine's own statistics (`strata-dsv41 --ids ... --n 512`, greedy, two prompts, two rounds each). The loss has two parts. 1. With the lookahead on, the CPU lane waits for all of a layer's store reads before it computes anything. `cpu_experts` takes the `hold.wait_all()` path whenever it is given an order (`ord != nullptr`, since 6fcde7e3), and the lookahead passes one unless `DS4_AHEAD_ORDER=0`. So the miss split, which computes the RAM hits while the misses load, never runs. This is about two thirds of the loss here. 2. The guesses make the SSD read about half again as much (274 against 179 MB a token). They cut the misses from 18 to 10 a token, but about 6 guesses a token go unused, and the store evicts 32 experts a token instead of 21. This is the other third. | Engine alone, ms a token (mean of 4 runs) | | | --- | --- | | Lookahead off | 75.3 | | `DS4_AHEAD=1` | 91.5 | | `DS4_AHEAD=1 DS4_AHEAD_ORDER=0` | 80.6 | | `DS4_AHEAD=1`, guesses made and ordered but not read (a local diagnostic switch) | 85.5 | With the order off and three guesses a layer (`DS4_AHEAD_ORDER=0 DS4_AHEAD_EXTRA=-3`), the lookahead came out level with it off (78.1 against 79.8 ms, measured alongside). So on this machine it does not pay, and keeping it off with the store is right. Holding the guesses' reads until no demand read is running (a patch I tried) changed little: −11% instead of −13% through the server. On your machine, `DS4_AHEAD=1 DS4_AHEAD_ORDER=0` would show whether the first part applies there too. Not tested: Windows, other drives, store sizes other than 40 GB, the rank skips. I can attach the individual runs and logs.
Author
Owner

@StackArc3 commented on GitHub (Oct 30, 2026):

Same engine on a smaller card, Windows, and a different regime from the one in the opening post: here the store reads were bandwidth-bound, not serial. The wait sat at the ceiling of the drive's PCIe link, and moving the drive to a faster slot halved it. All numbers measured on my machine unless marked derived.

Setup

  • Engine strata-dsv41 built from source at dfbd8342 (v0.2.7.1 plus the six-shard layout commit), CUDA 13.4, Windows 11.
  • RTX 5070 Ti 16 GB, Ryzen 9 5900XT, 64 GB DDR4, WD Black SN850P 2 TB holding the model.
  • Pack ist-das-2.00bpw, --ssd-cache 24, faster mode (5 experts). Engine log: 670 of 15360 in VRAM, 14690 routed experts on the CPU lane (126.7 GB), RAM store: up to 2336 slots of 10.3 MB (24.0 GB), policy 0, 8 reader threads, unbuffered reads.
  • Engine run directly (--ids, 256 greedy tokens, one prompt), DS4_PROF=1, store cold at every start, the same expert profile file copied fresh for every run. Three runs per setting, settings interleaved. Every run kept. The output ids are the same in every run quoted here.
  • Drive ceiling from my own test program: unbuffered random reads of 3 MiB from one model shard, 4 to 64 threads, 10 s per setting.

The board (B550) has one M.2 slot on the CPU at PCIe 4.0 x4 and one on the chipset at 3.0 x4. The model drive was measured in the chipset slot, then moved to the CPU slot and measured again. Same binary, same command, same output hash. Medians of three runs.

PCIe 3.0 x4 PCIe 4.0 x4
Drive test, 3 MiB random reads, MB/s 3,265 7,100 to 7,212
Decode tok/s 6.91 9.55
Decode ms a token 144.2 104.3
CPU lane ms a token 128.1 83.6
of it, waiting on store reads 87.3 45.4
Store misses a token 30.3 30.3
MB read a token 260.7 260.7
Store preload, 18.1 GB 6.2 s 3.1 s

Derived: 260.7 MB a token in 87.3 ms is 3.0 GB/s, at the drive's ceiling on the 3.0 link. On the 4.0 link it is 5.7 GB/s, about 80 percent of the new ceiling. The 24 GB store, the 32 GB store and the start-up preload all move 5.7 to 5.8 GB/s on the new link, so the engine's store path now tops out somewhat under the drive. Where the remaining 1.3 GB/s goes I did not profile.

So with 16 GB of VRAM and 30 misses a token the question is bytes a token against link bandwidth, not queue depth. Your 5090 runs with a queue under 0.4 because it misses 5 experts a token; this card misses 30 and keeps the link full. The practical check for anyone on a desktop board: which M.2 slot the model drive is in. Mine had been in the chipset slot.

Your question 1: issuing the pieces together

I tried it. A local opt-in patch (46 lines, DS4_STORE_SPLIT=<bytes>) cuts each matrix read (about 3 MB, three per expert) into pieces of that size and pushes all the pieces to the reader pool at once, so the NVMe queue holds many reads per miss. Measured on the 3.0 link, cache on, medians of three interleaved runs:

Piece size Decode tok/s
Whole matrices (baseline) 6.91
2 MiB 6.67
1 MiB 5.93
512 KiB 4.95

Slower at every size. The drive is not the reason: in the drive test, 512 KiB reads reach the same 3,265 MB/s ceiling from 8 threads up. My reading, not profiled: on a saturated link more reads in flight cannot add bandwidth, and the per-piece handling costs. I have not re-run the patch on the 4.0 link, where the balance might be different, and I am not proposing it.

More reader threads do not help on either link. DS4_STORE_THREADS 8, 16, 32 on the 4.0 link: medians 9.54, 9.61, 9.51 tok/s, store wait 42 to 46 ms in all nine runs.

Store size

On the 4.0 link, --ssd-cache 32 against 24: 10.63 against 9.53 tok/s, misses 24.1 against 30.3 a token, 207 against 261 MB a token, store wait 35.7 against 45.2 ms. Bytes a token is the lever that still works here.

Lookahead

Same sign as both of you. DS4_AHEAD=1 on the 4.0 link, medians of three interleaved rounds: 8.15 against 9.46 tok/s (−14 percent), slower in every round. Misses fall from 30.3 to 13.7 a token, but MB a token rise from 261 to 412 (+58 percent) and the store wait from 45.9 to 62.1 ms. The store line at the end of the run says 8,786 to 8,788 prefetched, 6,051 to 6,053 used, 2,317 given up unused (26 percent) over 256 tokens. The lookahead lines: the guesses a layer before held 73.3 percent of the picks, two layers before 0.0 percent; by the guess's rank, 96, 89, 77, 61 and 44 percent of ranks 1 to 5 were picked. Output ids identical with and without it.

On the order switch described above: an earlier batch on this machine, official engine 0.1.52, same pack, 24 GB store, 3.0 link, ran DS4_AHEAD=1 DS4_AHEAD_ORDER=0 against the plain engine, three runs each, interleaved with other settings. With the order off the lookahead still lost: 6.23, 6.28, 6.24 against 7.42, 7.41, 7.42 tok/s (−16 percent), misses 13.1 against 30.4 a token, 397 against 261 MB a token, store wait 104 to 105 against 81 ms. My reading: on a link the reads already fill, the wait_all path is not what costs; the extra bytes are. DS4_AHEAD=1 with the order on was not run on that engine, and DS4_AHEAD_ORDER=0 was not run on the source build or the 4.0 link, so the two lookahead results here are not a direct pair.

Your question 3: the counters

The engine prints them itself at the end of a direct strata-dsv41 --ids ... --n N run, on standard error, whenever --ssd-cache is on: the store: line (hits and misses a token, MB a token, ms waited, prefetched, used, given up unused, slots, evictions, failed reads) and, with DS4_AHEAD=1, two lookahead: lines (share of picks guessed one and two layers before; share picked by the guess's rank). They come from ds4_main.cpp around the decode summary. I did not look for them in the server or /metrics.

Not tested

One prompt, one model, one machine, faster mode only. Store sizes other than 24 and 32 GB. DS4_AHEAD_EXTRA. The lookahead order switch on the 4.0 link. The split patch on the 4.0 link. Linux.

<!-- gh-comment-id:6515508984 --> @StackArc3 commented on GitHub (Oct 30, 2026): Same engine on a smaller card, Windows, and a different regime from the one in the opening post: here the store reads were bandwidth-bound, not serial. The wait sat at the ceiling of the drive's PCIe link, and moving the drive to a faster slot halved it. All numbers measured on my machine unless marked derived. ## Setup - Engine `strata-dsv41` built from source at dfbd8342 (v0.2.7.1 plus the six-shard layout commit), CUDA 13.4, Windows 11. - RTX 5070 Ti 16 GB, Ryzen 9 5900XT, 64 GB DDR4, WD Black SN850P 2 TB holding the model. - Pack `ist-das-2.00bpw`, `--ssd-cache 24`, faster mode (5 experts). Engine log: `670 of 15360 in VRAM`, `14690 routed experts on the CPU lane (126.7 GB)`, `RAM store: up to 2336 slots of 10.3 MB (24.0 GB), policy 0, 8 reader threads, unbuffered reads`. - Engine run directly (`--ids`, 256 greedy tokens, one prompt), `DS4_PROF=1`, store cold at every start, the same expert profile file copied fresh for every run. Three runs per setting, settings interleaved. Every run kept. The output ids are the same in every run quoted here. - Drive ceiling from my own test program: unbuffered random reads of 3 MiB from one model shard, 4 to 64 threads, 10 s per setting. ## The same engine on two links The board (B550) has one M.2 slot on the CPU at PCIe 4.0 x4 and one on the chipset at 3.0 x4. The model drive was measured in the chipset slot, then moved to the CPU slot and measured again. Same binary, same command, same output hash. Medians of three runs. | | PCIe 3.0 x4 | PCIe 4.0 x4 | |---|---|---| | Drive test, 3 MiB random reads, MB/s | 3,265 | 7,100 to 7,212 | | Decode tok/s | 6.91 | 9.55 | | Decode ms a token | 144.2 | 104.3 | | CPU lane ms a token | 128.1 | 83.6 | | of it, waiting on store reads | 87.3 | 45.4 | | Store misses a token | 30.3 | 30.3 | | MB read a token | 260.7 | 260.7 | | Store preload, 18.1 GB | 6.2 s | 3.1 s | Derived: 260.7 MB a token in 87.3 ms is 3.0 GB/s, at the drive's ceiling on the 3.0 link. On the 4.0 link it is 5.7 GB/s, about 80 percent of the new ceiling. The 24 GB store, the 32 GB store and the start-up preload all move 5.7 to 5.8 GB/s on the new link, so the engine's store path now tops out somewhat under the drive. Where the remaining 1.3 GB/s goes I did not profile. So with 16 GB of VRAM and 30 misses a token the question is bytes a token against link bandwidth, not queue depth. Your 5090 runs with a queue under 0.4 because it misses 5 experts a token; this card misses 30 and keeps the link full. The practical check for anyone on a desktop board: which M.2 slot the model drive is in. Mine had been in the chipset slot. ## Your question 1: issuing the pieces together I tried it. A local opt-in patch (46 lines, `DS4_STORE_SPLIT=<bytes>`) cuts each matrix read (about 3 MB, three per expert) into pieces of that size and pushes all the pieces to the reader pool at once, so the NVMe queue holds many reads per miss. Measured on the 3.0 link, cache on, medians of three interleaved runs: | Piece size | Decode tok/s | |---|---| | Whole matrices (baseline) | 6.91 | | 2 MiB | 6.67 | | 1 MiB | 5.93 | | 512 KiB | 4.95 | Slower at every size. The drive is not the reason: in the drive test, 512 KiB reads reach the same 3,265 MB/s ceiling from 8 threads up. My reading, not profiled: on a saturated link more reads in flight cannot add bandwidth, and the per-piece handling costs. I have not re-run the patch on the 4.0 link, where the balance might be different, and I am not proposing it. More reader threads do not help on either link. `DS4_STORE_THREADS` 8, 16, 32 on the 4.0 link: medians 9.54, 9.61, 9.51 tok/s, store wait 42 to 46 ms in all nine runs. ## Store size On the 4.0 link, `--ssd-cache 32` against 24: 10.63 against 9.53 tok/s, misses 24.1 against 30.3 a token, 207 against 261 MB a token, store wait 35.7 against 45.2 ms. Bytes a token is the lever that still works here. ## Lookahead Same sign as both of you. `DS4_AHEAD=1` on the 4.0 link, medians of three interleaved rounds: 8.15 against 9.46 tok/s (−14 percent), slower in every round. Misses fall from 30.3 to 13.7 a token, but MB a token rise from 261 to 412 (+58 percent) and the store wait from 45.9 to 62.1 ms. The store line at the end of the run says 8,786 to 8,788 prefetched, 6,051 to 6,053 used, 2,317 given up unused (26 percent) over 256 tokens. The lookahead lines: the guesses a layer before held 73.3 percent of the picks, two layers before 0.0 percent; by the guess's rank, 96, 89, 77, 61 and 44 percent of ranks 1 to 5 were picked. Output ids identical with and without it. On the order switch described above: an earlier batch on this machine, official engine 0.1.52, same pack, 24 GB store, 3.0 link, ran `DS4_AHEAD=1 DS4_AHEAD_ORDER=0` against the plain engine, three runs each, interleaved with other settings. With the order off the lookahead still lost: 6.23, 6.28, 6.24 against 7.42, 7.41, 7.42 tok/s (−16 percent), misses 13.1 against 30.4 a token, 397 against 261 MB a token, store wait 104 to 105 against 81 ms. My reading: on a link the reads already fill, the `wait_all` path is not what costs; the extra bytes are. `DS4_AHEAD=1` with the order on was not run on that engine, and `DS4_AHEAD_ORDER=0` was not run on the source build or the 4.0 link, so the two lookahead results here are not a direct pair. ## Your question 3: the counters The engine prints them itself at the end of a direct `strata-dsv41 --ids ... --n N` run, on standard error, whenever `--ssd-cache` is on: the `store:` line (hits and misses a token, MB a token, ms waited, prefetched, used, given up unused, slots, evictions, failed reads) and, with `DS4_AHEAD=1`, two `lookahead:` lines (share of picks guessed one and two layers before; share picked by the guess's rank). They come from `ds4_main.cpp` around the decode summary. I did not look for them in the server or `/metrics`. ## Not tested One prompt, one model, one machine, faster mode only. Store sizes other than 24 and 32 GB. `DS4_AHEAD_EXTRA`. The lookahead order switch on the 4.0 link. The split patch on the 4.0 link. Linux.
Author
Owner

@StackArc3 commented on GitHub (Oct 30, 2026):

The piece-size patch on the 4.0 link, at 2 MiB only: median decode 8.00 against 9.59 tok/s, 17 percent lower. Same setup as my comment above, cache on, 24 GB store, three interleaved rounds, figures in run order.

Whole matrices 2 MiB pieces
Decode tok/s 9.36, 9.59, 9.72 8.00, 8.31, 7.93
Median 9.59 8.00 (−17 percent)
Store wait ms a token 47.9, 47.1, 45.8 66.6, 63.8, 66.5
Misses a token 30.3, 31.2, 30.3 30.4, 30.3, 31.2
MB read a token 261, 268, 261 261, 261, 268
Store preload of 18.1 GB at start 3.1 to 3.2 s 4.1 s

On the 3.0 link the same pair was 6.91 against 6.67 (−3.5 percent). Splitting each matrix read into pieces costs more on the faster link, not less; where the extra wait goes is not profiled. 1 MiB and 512 KiB were not re-run on the 4.0 link.

Output: four of the six runs gave the same output hash as my earlier runs on this link. Baseline round 2 and split round 3 gave one other hash, the same for both; those are the two runs with 31.2 misses. The baseline shows it without the patch. With the expert cache on, this engine's output on this machine varies run to run (six of six identical with --no-expert-cache, measured in an earlier batch); I did not look into it further here.

<!-- gh-comment-id:6518623523 --> @StackArc3 commented on GitHub (Oct 30, 2026): The piece-size patch on the 4.0 link, at 2 MiB only: median decode 8.00 against 9.59 tok/s, 17 percent lower. Same setup as my comment above, cache on, 24 GB store, three interleaved rounds, figures in run order. | | Whole matrices | 2 MiB pieces | |---|---|---| | Decode tok/s | 9.36, 9.59, 9.72 | 8.00, 8.31, 7.93 | | Median | 9.59 | 8.00 (−17 percent) | | Store wait ms a token | 47.9, 47.1, 45.8 | 66.6, 63.8, 66.5 | | Misses a token | 30.3, 31.2, 30.3 | 30.4, 30.3, 31.2 | | MB read a token | 261, 268, 261 | 261, 261, 268 | | Store preload of 18.1 GB at start | 3.1 to 3.2 s | 4.1 s | On the 3.0 link the same pair was 6.91 against 6.67 (−3.5 percent). Splitting each matrix read into pieces costs more on the faster link, not less; where the extra wait goes is not profiled. 1 MiB and 512 KiB were not re-run on the 4.0 link. Output: four of the six runs gave the same output hash as my earlier runs on this link. Baseline round 2 and split round 3 gave one other hash, the same for both; those are the two runs with 31.2 misses. The baseline shows it without the patch. With the expert cache on, this engine's output on this machine varies run to run (six of six identical with `--no-expert-cache`, measured in an earlier batch); I did not look into it further here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1830
No description provided.