[GH-ISSUE #235] A layer split does not scale past two GPUs: three V100s decode only +14%, prefill flat #93

Open
opened 2026-10-29 21:20:42 +07:00 by bsakaguchi · 1 comment
Owner

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

A layer split barely gains from a third GPU, and prefill does not gain from any extra GPU. Measured on one PC with three Tesla V100s, so the cards, the model and the settings are the same in every row.

Measurements

HP Z8 G4: 3x Tesla V100-PCIE-32GB (PCIe 3.0 x16 each, no NVLink; the engine passes the split's boundaries through the host), 2x Xeon Gold 6138, 183 GB RAM. Maya v1.1.15, Maya-S24, 32K context, the setup's settings (--expert-cache auto, --prefill auto, KV streaming, the shipped expert profile), MTP, the model read from RAM. ./maya.sh --bench:

V100s decode prefill 2K prefill 8K experts in VRAM
1 (v1.1.13, before #196's faster V100 prompts) 27.2 tok/s 287 tok/s 561 tok/s ~70% (the rest on the CPU lane / PCIe)
2 54.6 tok/s 446 tok/s 586 tok/s ~87%
3 62.0 tok/s (61.9 / 62.2) 443 tok/s 587 tok/s 100% (291 slots a layer)

What stands out

  1. Prefill is flat from two GPUs to three at 8K (586 / 587 tok/s), and barely above one V100 on an older build (561). An 8K-token prompt is one chunk (--prefill auto: chunks of 8192), and a chunk goes through the split's parts in turn, so one card works while the others wait. Only prompts of several chunks overlap the parts.
  2. The third GPU adds ~14% decode although it removes every RAM-tier fetch and the CPU lane: the whole model is in VRAM. With two parts the split plans the pipelined decode: a token costs the slower part - the two cards work on consecutive tokens (a token 5.3 ms predicted (CUDA0 5.0 ms | CUDA1 5.3 ms)). With three parts its prediction is the sum of the parts, a token 8.9 ms predicted (CUDA0 3.1 ms | CUDA1 2.7 ms | CUDA2 3.1 ms): the three cards run one after another. And a token measures ~15.6-15.9 ms (glm stat: decode 15.63 ms/tok), well above even that sum.

Where to look

  • Prefill: cut a prompt into more pieces than the split has parts, so every card reads while the next one works (the direction of #138), and check what the smaller pieces cost on each card.
  • Decode: a pipeline as deep as the split - with three parts, three tokens in flight, so every card works on one of them - and where the ~16 ms of a token go today (each part's kernels, the two 64 KB host hops, the waits between parts, MTP's verify).

A profile of a three-part decode and an 8K prompt on this machine will follow here.

Originally created by @mw00 on GitHub (Oct 16, 2026). Original GitHub issue: https://github.com/mw00/project-maya/issues/235 A layer split barely gains from a third GPU, and prefill does not gain from any extra GPU. Measured on one PC with three Tesla V100s, so the cards, the model and the settings are the same in every row. ## Measurements HP Z8 G4: 3x Tesla V100-PCIE-32GB (PCIe 3.0 x16 each, no NVLink; the engine passes the split's boundaries through the host), 2x Xeon Gold 6138, 183 GB RAM. Maya v1.1.15, Maya-S24, 32K context, the setup's settings (`--expert-cache auto`, `--prefill auto`, KV streaming, the shipped expert profile), MTP, the model read from RAM. `./maya.sh --bench`: | V100s | decode | prefill 2K | prefill 8K | experts in VRAM | | ---: | ---: | ---: | ---: | --- | | 1 (v1.1.13, before #196's faster V100 prompts) | 27.2 tok/s | 287 tok/s | 561 tok/s | ~70% (the rest on the CPU lane / PCIe) | | 2 | 54.6 tok/s | 446 tok/s | 586 tok/s | ~87% | | 3 | 62.0 tok/s (61.9 / 62.2) | 443 tok/s | 587 tok/s | 100% (291 slots a layer) | ## What stands out 1. **Prefill is flat from two GPUs to three** at 8K (586 / 587 tok/s), and barely above one V100 on an older build (561). An 8K-token prompt is one chunk (`--prefill auto`: chunks of 8192), and a chunk goes through the split's parts in turn, so one card works while the others wait. Only prompts of several chunks overlap the parts. 2. **The third GPU adds ~14% decode** although it removes every RAM-tier fetch and the CPU lane: the whole model is in VRAM. With two parts the split plans `the pipelined decode: a token costs the slower part` - the two cards work on consecutive tokens (`a token 5.3 ms predicted (CUDA0 5.0 ms | CUDA1 5.3 ms)`). With three parts its prediction is the **sum** of the parts, `a token 8.9 ms predicted (CUDA0 3.1 ms | CUDA1 2.7 ms | CUDA2 3.1 ms)`: the three cards run one after another. And a token measures ~15.6-15.9 ms (`glm stat: decode 15.63 ms/tok`), well above even that sum. ## Where to look - **Prefill:** cut a prompt into more pieces than the split has parts, so every card reads while the next one works (the direction of #138), and check what the smaller pieces cost on each card. - **Decode:** a pipeline as deep as the split - with three parts, three tokens in flight, so every card works on one of them - and where the ~16 ms of a token go today (each part's kernels, the two 64 KB host hops, the waits between parts, MTP's verify). A profile of a three-part decode and an 8K prompt on this machine will follow here.
Author
Owner

@prismaillya17 commented on GitHub (Oct 26, 2026):

Another data point for this, on mixed cards: 2x RTX 5090 32 GB (PCIe 5.0 x8 each) + RTX 4090 48 GB (PCIe 4.0 x4), i7-13700K, 188 GB, Maya v1.1.26. Full numbers in the speed report: https://github.com/mw00/project-maya/issues/498

Decode, single request (--bench)

Model Drafting 2 GPUs (5090 x2) 3 GPUs (+4090)
Maya-S v2 MTP 86.5 110.2 (+27%)
Maya-M-Derisked MTP 62.3 92.1 (+48%)
Maya-S v2 DFlash2 71.2 148.6
Maya-M-Derisked DFlash2 49.0 123.4

Here the third card does pay, but it matches your reading: the gain comes from emptying the RAM tier (Maya-S VRAM hit 85-92% -> 98-99%; Maya-M still keeps ~3 ms of CPU lane in an ~8 ms token), not from the cards working together. The planner prints a token 15.8 ms predicted (CUDA0 8.5 ms | CUDA1 8.3 ms | CUDA2 9.1 ms) for Maya-M with DFlash2, and the 4090 is the slowest part.

Prefill confirms point 1. With --prefill 32768 a 16K prompt is one chunk and the three parts run in turn: Maya-S 3 GPUs 5.87 s (2790 tok/s, parts 1.89 + 1.69 + 1.95 s), slower than two GPUs (2.67-2.86K). With --prefill auto (two 8K chunks) the parts overlap: 3.33-3.63K on Maya-S, and Maya-M-Derisked 4.33 s for 16K (3782 tok/s; parts 1.54 / 1.64 / 2.48 s). So more chunks than parts is the fix there; the 4090 part is the slowest stage because its x4 link stages the prompt's experts at ~5.2 GB/s.

On the decode side, a comparison from the same box with Strata v0.2.2 (Qwen3.8-Flash-Next, --pipeline-windows 2, which the engine caps at 2 windows): with the model already 100% resident on the two 5090s, adding the 4090 as a third stage made decode slower (code / prose / rewrite 366 / 308 / 614 -> 280 / 245 / 364 tok/s; UD-Q4_K_XL, 98.9% of routed mass resident on two cards: 255 / 232 / 389 -> 213 / 200 / 288), while 3-stage prefill was faster (7.7K -> 8.7-9.7K). That looks like the same lesson as your "a pipeline as deep as the split": two windows in flight over three stages leave one card idle each round, so depth = number of parts seems to matter.

Happy to run a prototype of a three-deep decode pipeline on this mixed 5090/4090 split.

<!-- gh-comment-id:6407300336 --> @prismaillya17 commented on GitHub (Oct 26, 2026): Another data point for this, on mixed cards: 2x RTX 5090 32 GB (PCIe 5.0 x8 each) + RTX 4090 48 GB (PCIe 4.0 x4), i7-13700K, 188 GB, Maya v1.1.26. Full numbers in the speed report: https://github.com/mw00/project-maya/issues/498 **Decode, single request (`--bench`)** | Model | Drafting | 2 GPUs (5090 x2) | 3 GPUs (+4090) | | --- | --- | ---: | ---: | | Maya-S v2 | MTP | 86.5 | 110.2 (+27%) | | Maya-M-Derisked | MTP | 62.3 | 92.1 (+48%) | | Maya-S v2 | DFlash2 | 71.2 | 148.6 | | Maya-M-Derisked | DFlash2 | 49.0 | 123.4 | Here the third card does pay, but it matches your reading: the gain comes from emptying the RAM tier (Maya-S VRAM hit 85-92% -> 98-99%; Maya-M still keeps ~3 ms of CPU lane in an ~8 ms token), not from the cards working together. The planner prints `a token 15.8 ms predicted (CUDA0 8.5 ms | CUDA1 8.3 ms | CUDA2 9.1 ms)` for Maya-M with DFlash2, and the 4090 is the slowest part. **Prefill confirms point 1.** With `--prefill 32768` a 16K prompt is one chunk and the three parts run in turn: Maya-S 3 GPUs 5.87 s (2790 tok/s, parts 1.89 + 1.69 + 1.95 s), *slower* than two GPUs (2.67-2.86K). With `--prefill auto` (two 8K chunks) the parts overlap: 3.33-3.63K on Maya-S, and Maya-M-Derisked 4.33 s for 16K (3782 tok/s; parts 1.54 / 1.64 / 2.48 s). So more chunks than parts is the fix there; the 4090 part is the slowest stage because its x4 link stages the prompt's experts at ~5.2 GB/s. **On the decode side, a comparison from the same box with Strata v0.2.2** (Qwen3.8-Flash-Next, `--pipeline-windows 2`, which the engine caps at 2 windows): with the model already 100% resident on the two 5090s, adding the 4090 as a third stage made decode *slower* (code / prose / rewrite 366 / 308 / 614 -> 280 / 245 / 364 tok/s; UD-Q4_K_XL, 98.9% of routed mass resident on two cards: 255 / 232 / 389 -> 213 / 200 / 288), while 3-stage prefill was faster (7.7K -> 8.7-9.7K). That looks like the same lesson as your "a pipeline as deep as the split": two windows in flight over three stages leave one card idle each round, so depth = number of parts seems to matter. Happy to run a prototype of a three-deep decode pipeline on this mixed 5090/4090 split.
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#93
No description provided.