[GH-ISSUE #496] v1.1.28: DeepSeek decode ~19% slower on a 48 GB GPU, because the new one-GPU path (#476) turns on by default although it never streams there #198

Closed
opened 2026-10-29 21:22:27 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @talisp on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/496

In short

After updating from v1.1.26 to v1.1.28, DeepSeek-V4.1-Flash decodes ~19% slower on our machine (one L40S 48 GB, experts copied into RAM, UD-Q8_K_XL), with the same config and the same benchmark as in #433.

Same machine, config and benchmark Runs (tok/s) Mean
v1.1.26 45.3 / 43.2 / 38.6 42.4
v1.1.28, default (new one-GPU path on) 35.2 / 36.3 / 31.7 34.4 (−19%)
v1.1.28, new path off (DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0) 35.1 / 43.8 39.5 (same as v1.1.26 once the text mix is accounted for, see the update below)

What we think happens:

  • The new path from #476 turns on by itself here (Linux, NVIDIA, one GPU).
  • On this box, the CPU lane computes an expert in ~0.13-0.21 ms, while streaming one costs ~0.78 ms. So the path streams nothing (streams 0 0 0 0 0 0 0 0 0).
  • It still costs VRAM: 1,291 experts fit in VRAM with it on, against 1,333 with it off (v1.1.26: 1,339).
  • With the path off, the speed comes back. Compared at the same share of experts on the CPU lane, v1.1.28 with the path off matches v1.1.26, and the path on costs ~17% (update below).

What we'd suggest:

  • Turn the path on only when the start-up timing says streaming is faster than the CPU lane, or when a meaningful share of the experts would actually stream. Or measure it at start and drop it if it streams nothing.
  • Document DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0 as the way back to v1.1.27's path. We found those names only in the source.

The #476 notes already say "Cards or GPU sets that already keep most experts in VRAM (48 GB and up): helps less". On a 508 GB model, a 48 GB card holds only ~8% of the experts, so the size check alone doesn't catch this case. Here it doesn't just help less: it is slower.

We are happy to test a fix or a branch on this machine. The technical details follow.


Technical notes

Setup

  • Project Maya v1.1.28 (maya-ds4), compared with v1.1.26 runs from two days earlier. Same machine, config and build flow (./maya.sh --setup ... --no-start).
  • 1× NVIDIA L40S-48Q (vGPU, 48 GB), Xeon Platinum 8580 VM, 32 vCPUs (no SMT, 1 NUMA node seen by the guest), ~504 GB RAM, Linux.
  • unsloth DeepSeek-V4.1-Flash-1017 UD-Q8_K_XL (experts MXFP4, 18,800,640 B each).
  • --max-context 262144 --cpu-threads 28 --mmap-experts off --dspark on, env DS4_REQUIRE_ALL_RAM=1 MAYA_DS4_SLOT_KEEP=1 MAYA_DS4_SLOT_CAP=8.

Benchmark

The same script as in #433:

  • through the server, temperature 0;
  • a new ~20K-token prompt, then 3 code-writing requests of 400 tokens;
  • one engine start per run, alternating variants;
  • a random prefix per run, so no cache carries over between runs.
Run Variant Decode, 3 requests (tok/s) Mean Without the 1st Prompt read (20K)
v1.1.26-a v1.1.26 42.7 / 44.9 / 48.3 45.3 46.6 924
v1.1.26-b v1.1.26 41.2 / 43.7 / 44.7 43.2 44.2 983
v1.1.26-c v1.1.26 35.0 / 37.4 / 43.4 38.6 40.4 900
on-1 v1.1.28 default 27.0 / 39.0 / 39.6 35.2 39.3 760
on-2 v1.1.28 default 33.5 / 35.5 / 39.8 36.3 37.6 945
off-1 v1.1.28, path off 32.6 / 32.2 / 40.6 35.1 36.4 1,026
on-3 v1.1.28 default 24.1 / 32.4 / 38.6 31.7 35.5 1,024
off-2 v1.1.28, path off 43.7 / 42.4 / 45.3 43.8 43.8 1,029
  • Prompt reading and resuming kept conversations (#356) did not change: ~1,000 tok/s for a new 20K prompt, 68 new tokens in ~4 s.
  • Real agent traffic since the update, with the path off and contexts under 20K: 41.6 tok/s on average over 6 answers, against 46.0 over 8 answers on v1.1.26. The sample is small.

Engine log, v1.1.28 default

ds4: the one-GPU decode path (in-place pulls, windows streamed, landings): on (Linux, NVIDIA, one GPU)
ds4: 14453 of the CPU lane's 14453 experts copied into RAM (271.7 GB, 1 NUMA part) in 380.2 s
ds4: PCIe lane: CUDA0 MXFP4/MXFP4/MXFP4 18800640 B: an expert 0.046 ms on the CPU lane (+0.031 a call), 0.767 streamed (+1.335 a request), 0.019 on the GPU, 9.40 from the disk -> of 0..6 picks in RAM it streams 0 0 0 0 0 0 0
ds4: CUDA0 layers [0, 42] + head: weights 16.26 GB, experts 25.63 GB (1291 of 15744 in VRAM), caches 0.24 GB, 561 MiB free
ds4: PCIe lane: CUDA0 MXFP4/MXFP4/MXFP4 18800640 B: the CPU lane timed again in decode: an expert 0.135 ms (planned with 0.046; streamed 0.767) -> of 0..8 picks in RAM it streams 0 0 0 0 0 0 0 0 0

With DS4_STREAM_WIN=0 DS4_LAND=0 (and DS4_STREAM_ZC=0):

ds4: the one-GPU decode path (in-place pulls, windows streamed, landings): on (Linux, NVIDIA, one GPU), DS4_STREAM_WIN=0, DS4_LAND=0
ds4: CUDA0 layers [0, 42] + head: weights 16.26 GB, experts 25.93 GB (1333 of 15744 in VRAM), caches 0.24 GB, 564 MiB free

v1.1.26: experts 25.93 GB (1339 of 15744 in VRAM).

Our reading

  • one_gpu_path() (src/ds4/ds4_model.cu, ~L5601) decides from the topology alone: one discrete NVIDIA GPU, Linux, no helper. Then ln_win and ln_land default to it.
  • On this box, the stream lane's own timing says streaming never pays: 0.77 ms streamed against 0.13-0.21 ms on the CPU lane, so 0 of 0..8 picks stream. Yet the landings' recent slots still take VRAM, and the experts in VRAM drop by ~42-48 (≈3.5%).
  • Fewer experts in VRAM alone may not explain a 19% drop. Something on the decode path with landings or verify-window streaming may cost time even when nothing streams, for example the recent-slot fills or the rc_drain wait before a prompt. We have not profiled it.
  • Possible gating: after the start-up PCIe timing, if the lane streams 0 picks at every count, skip the landings and the window streaming and give their VRAM back to the experts. The log line already has the numbers.

Update: no remaining gap with the path off

The 39.5 against 42.4 tok/s came from the text mix, not the version: one "off" run happened to get answers with 55-71% of the experts on the CPU lane. Compared at the same CPU-lane share, v1.1.28 with the path off matches v1.1.26, and the path on is ~17% slower at the same share. The per-answer table is in the first comment.

Originally created by @talisp on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/496 ## In short **After updating from v1.1.26 to v1.1.28, DeepSeek-V4.1-Flash decodes ~19% slower on our machine** (one L40S 48 GB, experts copied into RAM, UD-Q8_K_XL), with the same config and the same benchmark as in #433. | Same machine, config and benchmark | Runs (tok/s) | Mean | |---|---|---| | v1.1.26 | 45.3 / 43.2 / 38.6 | **42.4** | | v1.1.28, default (new one-GPU path on) | 35.2 / 36.3 / 31.7 | **34.4** (−19%) | | v1.1.28, new path off (`DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0`) | 35.1 / 43.8 | **39.5** (same as v1.1.26 once the text mix is accounted for, see the update below) | **What we think happens:** - The new path from #476 turns on by itself here (Linux, NVIDIA, one GPU). - On this box, the CPU lane computes an expert in ~0.13-0.21 ms, while streaming one costs ~0.78 ms. So the path streams nothing (`streams 0 0 0 0 0 0 0 0 0`). - It still costs VRAM: 1,291 experts fit in VRAM with it on, against 1,333 with it off (v1.1.26: 1,339). - With the path off, the speed comes back. Compared at the same share of experts on the CPU lane, v1.1.28 with the path off matches v1.1.26, and the path on costs ~17% (update below). **What we'd suggest:** - Turn the path on only when the start-up timing says streaming is faster than the CPU lane, or when a meaningful share of the experts would actually stream. Or measure it at start and drop it if it streams nothing. - Document `DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0` as the way back to v1.1.27's path. We found those names only in the source. The #476 notes already say "Cards or GPU sets that already keep most experts in VRAM (48 GB and up): helps less". On a 508 GB model, a 48 GB card holds only ~8% of the experts, so the size check alone doesn't catch this case. Here it doesn't just help less: it is slower. We are happy to test a fix or a branch on this machine. The technical details follow. --- ## Technical notes ### Setup - Project Maya v1.1.28 (`maya-ds4`), compared with v1.1.26 runs from two days earlier. Same machine, config and build flow (`./maya.sh --setup ... --no-start`). - 1× NVIDIA L40S-48Q (vGPU, 48 GB), Xeon Platinum 8580 VM, 32 vCPUs (no SMT, 1 NUMA node seen by the guest), ~504 GB RAM, Linux. - unsloth DeepSeek-V4.1-Flash-1017 UD-Q8_K_XL (experts MXFP4, 18,800,640 B each). - `--max-context 262144 --cpu-threads 28 --mmap-experts off --dspark on`, env `DS4_REQUIRE_ALL_RAM=1 MAYA_DS4_SLOT_KEEP=1 MAYA_DS4_SLOT_CAP=8`. ### Benchmark The same script as in #433: - through the server, temperature 0; - a new ~20K-token prompt, then 3 code-writing requests of 400 tokens; - one engine start per run, alternating variants; - a random prefix per run, so no cache carries over between runs. | Run | Variant | Decode, 3 requests (tok/s) | Mean | Without the 1st | Prompt read (20K) | |---|---|---|---|---|---| | v1.1.26-a | v1.1.26 | 42.7 / 44.9 / 48.3 | 45.3 | 46.6 | 924 | | v1.1.26-b | v1.1.26 | 41.2 / 43.7 / 44.7 | 43.2 | 44.2 | 983 | | v1.1.26-c | v1.1.26 | 35.0 / 37.4 / 43.4 | 38.6 | 40.4 | 900 | | on-1 | v1.1.28 default | 27.0 / 39.0 / 39.6 | 35.2 | 39.3 | 760 | | on-2 | v1.1.28 default | 33.5 / 35.5 / 39.8 | 36.3 | 37.6 | 945 | | off-1 | v1.1.28, path off | 32.6 / 32.2 / 40.6 | 35.1 | 36.4 | 1,026 | | on-3 | v1.1.28 default | 24.1 / 32.4 / 38.6 | 31.7 | 35.5 | 1,024 | | off-2 | v1.1.28, path off | 43.7 / 42.4 / 45.3 | 43.8 | 43.8 | 1,029 | - Prompt reading and resuming kept conversations (#356) did not change: ~1,000 tok/s for a new 20K prompt, 68 new tokens in ~4 s. - Real agent traffic since the update, with the path off and contexts under 20K: 41.6 tok/s on average over 6 answers, against 46.0 over 8 answers on v1.1.26. The sample is small. ### Engine log, v1.1.28 default ``` ds4: the one-GPU decode path (in-place pulls, windows streamed, landings): on (Linux, NVIDIA, one GPU) ds4: 14453 of the CPU lane's 14453 experts copied into RAM (271.7 GB, 1 NUMA part) in 380.2 s ds4: PCIe lane: CUDA0 MXFP4/MXFP4/MXFP4 18800640 B: an expert 0.046 ms on the CPU lane (+0.031 a call), 0.767 streamed (+1.335 a request), 0.019 on the GPU, 9.40 from the disk -> of 0..6 picks in RAM it streams 0 0 0 0 0 0 0 ds4: CUDA0 layers [0, 42] + head: weights 16.26 GB, experts 25.63 GB (1291 of 15744 in VRAM), caches 0.24 GB, 561 MiB free ds4: PCIe lane: CUDA0 MXFP4/MXFP4/MXFP4 18800640 B: the CPU lane timed again in decode: an expert 0.135 ms (planned with 0.046; streamed 0.767) -> of 0..8 picks in RAM it streams 0 0 0 0 0 0 0 0 0 ``` With `DS4_STREAM_WIN=0 DS4_LAND=0` (and `DS4_STREAM_ZC=0`): ``` ds4: the one-GPU decode path (in-place pulls, windows streamed, landings): on (Linux, NVIDIA, one GPU), DS4_STREAM_WIN=0, DS4_LAND=0 ds4: CUDA0 layers [0, 42] + head: weights 16.26 GB, experts 25.93 GB (1333 of 15744 in VRAM), caches 0.24 GB, 564 MiB free ``` v1.1.26: `experts 25.93 GB (1339 of 15744 in VRAM)`. ### Our reading - `one_gpu_path()` (`src/ds4/ds4_model.cu`, ~L5601) decides from the topology alone: one discrete NVIDIA GPU, Linux, no helper. Then `ln_win` and `ln_land` default to it. - On this box, the stream lane's own timing says streaming never pays: 0.77 ms streamed against 0.13-0.21 ms on the CPU lane, so 0 of 0..8 picks stream. Yet the landings' recent slots still take VRAM, and the experts in VRAM drop by ~42-48 (≈3.5%). - Fewer experts in VRAM alone may not explain a 19% drop. Something on the decode path with landings or verify-window streaming may cost time even when nothing streams, for example the recent-slot fills or the `rc_drain` wait before a prompt. We have not profiled it. - Possible gating: after the start-up PCIe timing, if the lane streams 0 picks at every count, skip the landings and the window streaming and give their VRAM back to the experts. The log line already has the numbers. ### Update: no remaining gap with the path off The 39.5 against 42.4 tok/s came from the text mix, not the version: one "off" run happened to get answers with 55-71% of the experts on the CPU lane. Compared at the same CPU-lane share, v1.1.28 with the path off matches v1.1.26, and the path on is ~17% slower at the same share. The per-answer table is in the first comment.
Author
Owner

@talisp commented on GitHub (Oct 25, 2026):

A follow-up that narrows this down, and a correction to the "remaining gap" in the first version of this issue (the text above is updated).

Compared answer by answer at the same share of experts on the CPU lane, the new path costs ~17% even when the GPU finds more experts in VRAM. Decode speed depends a lot on how many of a token's experts land on the CPU lane, and that varies with the text. So we grouped each 400-token answer of the benchmark by the CPU-lane share the engine reports (CPU lane X% of the experts):

Experts on the CPU lane v1.1.26 v1.1.28, path on (default) v1.1.28, path off
~34-38% 46.5 / 43.4 39.0 / 39.6 / 35.5 / 39.8 / 38.6 42.4
~45-52% 37.4 / 39.0 / 37.5 33.5 / 32.4 40.6 / 43.7 / 45.2
~55-71% 35.0 / 40.6 / 34.3 / 38.2 27.0 / 24.1 32.6 / 32.2

(tok/s per answer)

  • Path on: at ~34% on the CPU lane, ~38.5 tok/s against 46.5 on v1.1.26. The CPU lane does the same amount of work, so the extra time per token is somewhere else: on the GPU side or in synchronisation. And it happens while the lane streams nothing (streams 0 0 0 0 0 0 0 0 0 throughout).
  • Path off: v1.1.28 is level with v1.1.26, maybe slightly ahead. The lower mean in the first table (39.5) came from one run that drew answers with 55-71% of the experts on the CPU lane.
  • In real traffic since the update (path off, short coding contexts), /metrics shows vram_hit ≈ 0.55 at ~41 tok/s. The hit rate follows the workload, not the version.
  • We see no PCIe lane: the copied experts pinned or pinning ... failed line in the start log with the path on. So we can't tell from the log whether the in-place pulls were set up at all.

Why the same idea helps elsewhere but not here (our reading):

  • #476 continues work its author did earlier in Strata's Qwen engine, on the same RTX 3090 + 6-core Ryzen 5 5600X:
    • Niko1221/Strata#1904: an asynchronous adaptive tier in the arena mode, where every expert sits in RAM and the GPU copies in over PCIe; ×1.07-1.11 cold decode.
    • Niko1221/Strata#1905: pin by need, plus a PCIe share floor.
  • On a 6-core desktop CPU, the CPU lane is the slow side, so pulling experts over PCIe and keeping them in VRAM pays off.
  • Here, 28 lane threads on a Xeon compute an MXFP4 expert in ~0.13-0.21 ms in decode, against ~0.74-0.78 ms to stream one, so the balance reverses. The engine already measures both numbers at start (an expert 0.053 ms on the CPU lane ..., 0.736 streamed).

So a possible default: enable the one-GPU path only when streaming is measured as cheaper for at least some pick counts, i.e. when the lane would stream anything. If it streams 0 at every count, keep v1.1.27's path and its VRAM. That would keep #476's gain on 12-24 GB cards with small CPUs and avoid the loss on big-CPU boxes.

Happy to run a branch with that, or with any diagnostic env you'd like, on this machine.

<!-- gh-comment-id:6404713128 --> @talisp commented on GitHub (Oct 25, 2026): A follow-up that narrows this down, and a correction to the "remaining gap" in the first version of this issue (the text above is updated). **Compared answer by answer at the same share of experts on the CPU lane, the new path costs ~17% even when the GPU finds more experts in VRAM.** Decode speed depends a lot on how many of a token's experts land on the CPU lane, and that varies with the text. So we grouped each 400-token answer of the benchmark by the CPU-lane share the engine reports (`CPU lane X% of the experts`): | Experts on the CPU lane | v1.1.26 | v1.1.28, path on (default) | v1.1.28, path off | |---|---|---|---| | ~34-38% | **46.5** / 43.4 | 39.0 / 39.6 / 35.5 / 39.8 / 38.6 | **42.4** | | ~45-52% | 37.4 / 39.0 / 37.5 | 33.5 / 32.4 | 40.6 / 43.7 / 45.2 | | ~55-71% | 35.0 / 40.6 / 34.3 / 38.2 | 27.0 / 24.1 | 32.6 / 32.2 | (tok/s per answer) - **Path on:** at ~34% on the CPU lane, ~38.5 tok/s against 46.5 on v1.1.26. The CPU lane does the same amount of work, so the extra time per token is somewhere else: on the GPU side or in synchronisation. And it happens while the lane streams nothing (`streams 0 0 0 0 0 0 0 0 0` throughout). - **Path off:** v1.1.28 is level with v1.1.26, maybe slightly ahead. The lower mean in the first table (39.5) came from one run that drew answers with 55-71% of the experts on the CPU lane. - In real traffic since the update (path off, short coding contexts), `/metrics` shows `vram_hit` ≈ 0.55 at ~41 tok/s. The hit rate follows the workload, not the version. - We see no `PCIe lane: the copied experts pinned` or `pinning ... failed` line in the start log with the path on. So we can't tell from the log whether the in-place pulls were set up at all. **Why the same idea helps elsewhere but not here (our reading):** - #476 continues work its author did earlier in Strata's Qwen engine, on the same RTX 3090 + 6-core Ryzen 5 5600X: - Niko1221/Strata#1904: an asynchronous adaptive tier in the arena mode, where every expert sits in RAM and the GPU copies in over PCIe; ×1.07-1.11 cold decode. - Niko1221/Strata#1905: pin by need, plus a PCIe share floor. - On a 6-core desktop CPU, the CPU lane is the slow side, so pulling experts over PCIe and keeping them in VRAM pays off. - Here, 28 lane threads on a Xeon compute an MXFP4 expert in ~0.13-0.21 ms in decode, against ~0.74-0.78 ms to stream one, so the balance reverses. The engine already measures both numbers at start (`an expert 0.053 ms on the CPU lane ..., 0.736 streamed`). **So a possible default:** enable the one-GPU path only when streaming is measured as cheaper for at least some pick counts, i.e. when the lane would stream anything. If it streams 0 at every count, keep v1.1.27's path and its VRAM. That would keep #476's gain on 12-24 GB cards with small CPUs and avoid the loss on big-CPU boxes. Happy to run a branch with that, or with any diagnostic env you'd like, on this machine.
Author
Owner

@mw00 commented on GitHub (Oct 27, 2026):

Thank you for the careful A/B and the per-answer table: it pointed straight at the fix. From v1.1.30 the one-GPU decode path from #476 stays on only where the CPU lane's experts actually stream from RAM. After the PCIe lane's timing at load, a GPU whose plan streams nothing (as on your L40S) goes back to v1.1.27's path for that run. From the next start on, the times file (lane-times.txt in the pack) keeps the path off from the beginning, so its VRAM goes to experts again. The start log says which path runs ("the one-GPU decode path: on/off ..."). SETTINGS.md now documents it and the way back (DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0); deleting lane-times.txt measures again. We'd be glad if you could rerun your benchmark on v1.1.30: the first start measures, and the second should match v1.1.27.

<!-- gh-comment-id:6436265200 --> @mw00 commented on GitHub (Oct 27, 2026): Thank you for the careful A/B and the per-answer table: it pointed straight at the fix. From v1.1.30 the one-GPU decode path from #476 stays on only where the CPU lane's experts actually stream from RAM. After the PCIe lane's timing at load, a GPU whose plan streams nothing (as on your L40S) goes back to v1.1.27's path for that run. From the next start on, the times file (`lane-times.txt` in the pack) keeps the path off from the beginning, so its VRAM goes to experts again. The start log says which path runs ("the one-GPU decode path: on/off ..."). SETTINGS.md now documents it and the way back (`DS4_STREAM_WIN=0 DS4_LAND=0 DS4_STREAM_ZC=0`); deleting `lane-times.txt` measures again. We'd be glad if you could rerun your benchmark on v1.1.30: the first start measures, and the second should match v1.1.27.
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#198
No description provided.