[PR #223] [CLOSED] Multi gpu: Layer split: pinned arena, lent prompt buffers, tested planner (2 x 2080 Ti decode +34%, 29K prompts +61%) #2510

Closed
opened 2026-11-04 02:00:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/223
Author: @giostrives
Created: 9/30/2026
Status: ❌ Closed

Base: main ← Head: multi-gpu-split


📝 Commits (5)

  • e08ffbd verify: cudaFuncGetName only with CUDA 12.3+ (an sm_75 build with CUDA 12.0 failed)
  • bb321e5 layer split: pin the whole expert arena outside Windows
  • b578d5e layer split: every card lends its prompt buffers from its own cache
  • 251fb73 layer split auto: the planner in layer_split.hpp, tested, with a hand-off term
  • 6bc110a bench: the layer split on 2 x RTX 2080 Ti, before and after (bench/results/2026-09-30-layer-split-2080ti)

📊 Changes

26 files changed (+5690 additions, -186 deletions)

View changed files

📝 CMakeLists.txt (+4 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/README.md (+98 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/0127-lend-one.json (+165 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/0127-lend-split.json (+213 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/0127-one.json (+375 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/0127-split.json (+472 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/base-one.json (+372 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/base-split.json (+468 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/lend-split.json (+11 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/pcie-default.json (+308 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/pcie0.40.json (+309 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/pcie0.55.json (+309 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/remote.json (+184 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/v1-split.json (+469 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/v2-auto.json (+469 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/v2-k18.json (+226 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/v2-k31.json (+226 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/data/v2-k36.json (+226 -0)
➕ bench/results/2026-09-30-layer-split-2080ti/split_bench.py (+194 -0)
📝 docs/MULTI_GPU.md (+30 -10)

...and 6 more files

📄 Description

On 2 x RTX 2080 Ti the layer split was barely faster than one card for decode and about 30% slower for prompts. This branch fixes how the split is set up. On this setup the split is now the faster configuration for both decode and long prompts.

Changes

  1. layer split: pin the whole expert arena outside Windows (bb321e5). The 8 GiB pin cap is a WDDM workaround and now applies on Windows only. With the cap on Linux, only the first ~10 layers' misses could take the PCIe share, and the prompt path staged ~80% of the streamed experts through host copies.
  2. layer split: every card lends its prompt buffers from its own cache (b578d5e). Each card used to reserve 2048-token buffers for the whole session (~1.5 GiB a card), and prompts ran in 2048-token chunks. Now every card lends its buffers from its expert cache, and all cards read the same chunk, the largest every card can lend.
  3. layer split auto: the planner in layer_split.hpp, tested (251fb73). This is layer_split::Planner, with unit tests in src/program/layer_split_test.cpp. It adds a hand-off term per later card and makes the routing-curve exponent a parameter. The commit also fixes the later card's reserve, which counted the drafter twice: it was 1 GiB and is now 128 MiB.
  4. bench: the layer split on 2 x RTX 2080 Ti (6bc110a). Harness, raw results and tables in bench/results/2026-09-30-layer-split-2080ti/, plus a section in docs/MULTI_GPU.md. Most of the added lines are here.

Related

The first commit is the same fix as #209 (cudaFuncGetName guarded for CUDA < 12.3). If #209 lands first, I'll drop the commit and rebase. Otherwise this MR carries it, and #209 can be closed as superseded.

Results

Qwen3.8-Flash-Next IQ2_XS, 2 x RTX 2080 Ti 11 GB, i7-7700K, 32K context, int8 KV, --spec 4. Same harness for every row, and every needle was found.

Setup Decode tok/s Hits Prompt 2.7K tok/s Prompt 8K tok/s Prompt 16K tok/s Prompt 29K tok/s
1 GPU 33.9 64% 618 712 795 801
2 GPUs, before (K=31) 35.8 69% 391 497 537 535
2 GPUs, after (auto K=25) 45.3-47.3 80-82% 609-627 826-829 1,120-1,126 1,290
  • Decode on this machine is bound by the CPU pool, so the split pays through fewer CPU misses (hit rate 64% → 80-82%).
  • The K sweep agrees with auto's pick: K=18 41.4, K=25 45-47, K=31 45.2, K=36 42.2 tok/s.
  • On 0.1.27: one card 35.7 tok/s decode, the split 47.3. At 29K, prompts read 832 vs 1,304 tok/s.

Testing

  • layer_split_test covers the planner. In the published tree it builds with g++ -std=c++20 -Iinclude src/program/layer_split_test.cpp && ./a.out.
  • The full -DSTRATA_BUILD_TESTS=ON build does not work in the published tree, because some sources are not shipped. This is not new to this branch.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/223 **Author:** [@giostrives](https://github.com/giostrives) **Created:** 9/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `multi-gpu-split` --- ### 📝 Commits (5) - [`e08ffbd`](https://github.com/Niko1221/Strata/commit/e08ffbd934bcc235119340511c448b3a6f4ad951) verify: cudaFuncGetName only with CUDA 12.3+ (an sm_75 build with CUDA 12.0 failed) - [`bb321e5`](https://github.com/Niko1221/Strata/commit/bb321e511a81dae39b163d1de39fcb486755c132) layer split: pin the whole expert arena outside Windows - [`b578d5e`](https://github.com/Niko1221/Strata/commit/b578d5e1770e5fe4d9da64199f6b32ae499c29a4) layer split: every card lends its prompt buffers from its own cache - [`251fb73`](https://github.com/Niko1221/Strata/commit/251fb734066c9c0e230e3055d0ae18c9f3f6325a) layer split auto: the planner in layer_split.hpp, tested, with a hand-off term - [`6bc110a`](https://github.com/Niko1221/Strata/commit/6bc110a61b5e7872284c167504309b5213132879) bench: the layer split on 2 x RTX 2080 Ti, before and after (bench/results/2026-09-30-layer-split-2080ti) ### 📊 Changes **26 files changed** (+5690 additions, -186 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+4 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/README.md` (+98 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/0127-lend-one.json` (+165 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/0127-lend-split.json` (+213 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/0127-one.json` (+375 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/0127-split.json` (+472 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/base-one.json` (+372 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/base-split.json` (+468 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/lend-split.json` (+11 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/pcie-default.json` (+308 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/pcie0.40.json` (+309 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/pcie0.55.json` (+309 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/remote.json` (+184 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/v1-split.json` (+469 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/v2-auto.json` (+469 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/v2-k18.json` (+226 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/v2-k31.json` (+226 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/data/v2-k36.json` (+226 -0) ➕ `bench/results/2026-09-30-layer-split-2080ti/split_bench.py` (+194 -0) 📝 `docs/MULTI_GPU.md` (+30 -10) _...and 6 more files_ </details> ### 📄 Description On 2 x RTX 2080 Ti the layer split was barely faster than one card for decode and about 30% slower for prompts. This branch fixes how the split is set up. On this setup the split is now the faster configuration for both decode and long prompts. Changes 1. layer split: pin the whole expert arena outside Windows (bb321e5). The 8 GiB pin cap is a WDDM workaround and now applies on Windows only. With the cap on Linux, only the first ~10 layers' misses could take the PCIe share, and the prompt path staged ~80% of the streamed experts through host copies. 2. layer split: every card lends its prompt buffers from its own cache (b578d5e). Each card used to reserve 2048-token buffers for the whole session (~1.5 GiB a card), and prompts ran in 2048-token chunks. Now every card lends its buffers from its expert cache, and all cards read the same chunk, the largest every card can lend. 3. layer split auto: the planner in layer_split.hpp, tested (251fb73). This is layer_split::Planner, with unit tests in src/program/layer_split_test.cpp. It adds a hand-off term per later card and makes the routing-curve exponent a parameter. The commit also fixes the later card's reserve, which counted the drafter twice: it was 1 GiB and is now 128 MiB. 4. bench: the layer split on 2 x RTX 2080 Ti (6bc110a). Harness, raw results and tables in bench/results/2026-09-30-layer-split-2080ti/, plus a section in docs/MULTI_GPU.md. Most of the added lines are here. Related The first commit is the same fix as #209 (cudaFuncGetName guarded for CUDA < 12.3). If #209 lands first, I'll drop the commit and rebase. Otherwise this MR carries it, and #209 can be closed as superseded. Results Qwen3.8-Flash-Next IQ2_XS, 2 x RTX 2080 Ti 11 GB, i7-7700K, 32K context, int8 KV, --spec 4. Same harness for every row, and every needle was found. | Setup | Decode tok/s | Hits | Prompt 2.7K tok/s | Prompt 8K tok/s | Prompt 16K tok/s | Prompt 29K tok/s | |---|---:|---:|---:|---:|---:|---:| | 1 GPU | 33.9 | 64% | 618 | 712 | 795 | 801 | | 2 GPUs, before (K=31) | 35.8 | 69% | 391 | 497 | 537 | 535 | | 2 GPUs, after (auto K=25) | 45.3-47.3 | 80-82% | 609-627 | 826-829 | 1,120-1,126 | 1,290 | - Decode on this machine is bound by the CPU pool, so the split pays through fewer CPU misses (hit rate 64% → 80-82%). - The K sweep agrees with auto's pick: K=18 41.4, K=25 45-47, K=31 45.2, K=36 42.2 tok/s. - On 0.1.27: one card 35.7 tok/s decode, the split 47.3. At 29K, prompts read 832 vs 1,304 tok/s. Testing - layer_split_test covers the planner. In the published tree it builds with g++ -std=c++20 -Iinclude src/program/layer_split_test.cpp && ./a.out. - The full -DSTRATA_BUILD_TESTS=ON build does not work in the published tree, because some sources are not shipped. This is not new to this branch. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:51 +07:00
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#2510
No description provided.