[GH-ISSUE #4915] [Engine] --layer-split auto never trims CUDA0's dense weights: with an explicit split, 2x 2080 Ti gets +945 expert slots on CUDA0 and +6-12% decode #2258

Open
opened 2026-11-04 01:57:59 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @rafatxf on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4915

Area

[Engine]

What do you want to do?

--trim-stage-weights / STRATA_STAGE_TRIM=1 (#559, #639) never trims CUDA0 under --layer-split auto, which is the default:

const bool stage_trim = trim_asked && multi_gpu && !split_auto && !split_at.empty();

The comment above that line explains why. CUDA0's arena is built before the split search, and CUDA0 is "the cheapest card to leave alone". On a 2-card Qwen3.8-Flash-Next split that last part does not hold. CUDA0 is where most of the trim's VRAM is. Giving the split explicitly, so that CUDA0 trims too, is the largest decode gain I found on this rig.

I'd like CUDA0 to trim under auto as well. One way is to load CUDA0's dense weights after the split search, as the later cards already do when the trim is asked. If that is too invasive, a startup line or setup hint that names the explicit split auto picked would already help people find it.

Rig and settings.

  • 2x RTX 2080 Ti 22 GB on NVLink, PCIe 3.0 x8 each, i7-6700 (4 cores), 56 GB DDR4-3200.
  • Unsloth Qwen3.8-Flash-Next UD-IQ4_XS: gate/up IQ3_S, down IQ4_NL, dense Q8_0.
  • Strata 0.2.7, engine 0.1.52, built for sm_75.
  • Arguments: --max-context 393216 --kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.7 --pcie-frac 0.30 --pipeline-windows 2 --resident-budget-gib 29 --adapt-async 1 --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97.
  • Env: STRATA_SM75_PERF=1 STRATA_EXP_MODE=8 STRATA_IQ256_GATHER=1 STRATA_IQ_MT_MIN=1.

--layer-split auto picks K=24 here, so the explicit arm is --layer-split 24.

Expert-cache slots (engine log):

arm CUDA0 CUDA1
no trim 6669 6014
STRATA_STAGE_TRIM=1, --layer-split auto 6669 6983
STRATA_STAGE_TRIM=1, --layer-split 24 7614 6983

Decode at 1024 new tokens, in tok/s. Each arm is a fresh engine with every arm starting from a dropped page cache. Run-to-run noise between engine starts is about ±5%. The CPU column is the CPU-lane expert computations for the code prompt.

arm (rounds) short es short code 16K CPU experts (code)
no trim (2) 70.5 86.7 63.8 37.1K
trim, auto (3) 72.6 90.9 65.5 28.6K
trim, --layer-split 24 (3) 72.9 97.4 69.4 23.1K

The explicit split cuts the CPU-lane expert computations by another 12-20% against auto on every prompt. On this box the CPU lane sets the decode window: each layer waits about 0.2 ms for its 1-2 CPU experts.

  • The 16K prompt reads in 14-16 s with trim in either arm, against 16.1-16.2 s without it. The prompt numbers did not separate auto from the explicit split.
  • Validated in production with the explicit split: tool calls, images, a 174K-token needle (2/2) and a two-turn agent prompt with a reused 96K prefix.

What do you do today instead?

I run --layer-split 24 explicitly with STRATA_STAGE_TRIM=1. That works, but it gives up auto's re-planning when the context or the cards change.

Reproduction status: measured locally on the rig above; every number is from my runs.

Originally created by @rafatxf on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4915 ### Area [Engine] ### What do you want to do? `--trim-stage-weights` / `STRATA_STAGE_TRIM=1` (#559, #639) never trims CUDA0 under `--layer-split auto`, which is the default: ``` const bool stage_trim = trim_asked && multi_gpu && !split_auto && !split_at.empty(); ``` The comment above that line explains why. CUDA0's arena is built before the split search, and CUDA0 is "the cheapest card to leave alone". On a 2-card Qwen3.8-Flash-Next split that last part does not hold. CUDA0 is where most of the trim's VRAM is. Giving the split explicitly, so that CUDA0 trims too, is the largest decode gain I found on this rig. I'd like CUDA0 to trim under `auto` as well. One way is to load CUDA0's dense weights after the split search, as the later cards already do when the trim is asked. If that is too invasive, a startup line or setup hint that names the explicit split `auto` picked would already help people find it. **Rig and settings.** - 2x RTX 2080 Ti 22 GB on NVLink, PCIe 3.0 x8 each, i7-6700 (4 cores), 56 GB DDR4-3200. - Unsloth Qwen3.8-Flash-Next UD-IQ4_XS: gate/up IQ3_S, down IQ4_NL, dense Q8_0. - Strata 0.2.7, engine 0.1.52, built for sm_75. - Arguments: `--max-context 393216 --kv int8 --kv-resident 32768 --spec 4 --spec-min-p 0.7 --pcie-frac 0.30 --pipeline-windows 2 --resident-budget-gib 29 --adapt-async 1 --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97`. - Env: `STRATA_SM75_PERF=1 STRATA_EXP_MODE=8 STRATA_IQ256_GATHER=1 STRATA_IQ_MT_MIN=1`. `--layer-split auto` picks K=24 here, so the explicit arm is `--layer-split 24`. **Expert-cache slots** (engine log): | arm | CUDA0 | CUDA1 | |---|---:|---:| | no trim | 6669 | 6014 | | `STRATA_STAGE_TRIM=1`, `--layer-split auto` | 6669 | 6983 | | `STRATA_STAGE_TRIM=1`, `--layer-split 24` | **7614** | 6983 | **Decode** at 1024 new tokens, in tok/s. Each arm is a fresh engine with every arm starting from a dropped page cache. Run-to-run noise between engine starts is about ±5%. The CPU column is the CPU-lane expert computations for the code prompt. | arm (rounds) | short es | short code | 16K | CPU experts (code) | |---|---:|---:|---:|---:| | no trim (2) | 70.5 | 86.7 | 63.8 | 37.1K | | trim, `auto` (3) | 72.6 | 90.9 | 65.5 | 28.6K | | trim, `--layer-split 24` (3) | 72.9 | **97.4** | **69.4** | **23.1K** | The explicit split cuts the CPU-lane expert computations by another 12-20% against `auto` on every prompt. On this box the CPU lane sets the decode window: each layer waits about 0.2 ms for its 1-2 CPU experts. - The 16K prompt reads in 14-16 s with trim in either arm, against 16.1-16.2 s without it. The prompt numbers did not separate `auto` from the explicit split. - Validated in production with the explicit split: tool calls, images, a 174K-token needle (2/2) and a two-turn agent prompt with a reused 96K prefix. ### What do you do today instead? I run `--layer-split 24` explicitly with `STRATA_STAGE_TRIM=1`. That works, but it gives up `auto`'s re-planning when the context or the cards change. Reproduction status: measured locally on the rig above; every number is from my runs.
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#2258
No description provided.