[GH-ISSUE #445] Large arena prefill regression on Linux: 42-43 GiB pin threshold stalls GPU #207

Closed
opened 2026-11-04 01:40:55 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @mohammedalsayegh on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/445

Greetings!

first, thanks for the great work!

Found a performance regression testing on multiple P100s (sm_60 / Pascal). Unclear if Pascal-specific or affects newer architectures.

Commit ed6c124 ("#253: the 8 GiB arena pin cap only under WDDM") causes large expert arenas to lose most prompt speed on Linux. The environment variable from that commit recovers performance, so this likely needs a different default or release note.

Setup

Model Qwen3.8-Flash-Next IQ3_S (arena_gb 50.3)
GPUs 3 × Tesla P100-PCIE-16GB (sm_60)
Topology GPU0 in PCIe x4, GPU1/2 in x16 — auto layer split
RAM 125 GB
CPU Xeon E5-2699 v3 (AVX2 only)
CUDA / driver 12.0 / 580.178.04
Engine -DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=60

Key Triggers

  • Arena Size: Performance cliff at ~84% of arena size. Smaller CI arenas won't reproduce this.
  • Layer Split: Required condition per ed6c124.
  • RAM Headroom: Available RAM stays 67-68 GB — this is a threshold issue, not exhaustion.
  • Architecture: sm_60 without AVX-512. GPU arch might matter; CPU likely doesn't.

Results

Median of ≥2 rounds, fresh ~7.3K-token prompts (cached prompts ~0.45s, not measured).

build STRATA_ARENA_PIN_GIB prefill tok/s
30ec18e (v0.1.30) — 179.7
ed6c124 (first bad) — 134.6
c499bd1 (v0.1.32) — 133.5
aeb35be (v0.1.33) — 127.0
aeb35be, unmodified 40 192.2

Same pattern at 69,144 tokens: 125.0 → 204.3 tok/s. Gap widens at larger prompts.

Why this matters

#253 was resolved but didn't fix this for my setup. With layer split, default pins entire arena (past 42-43 GiB cliff): 127 tok/s default vs 192 tok/s with undocumented variable. Severely hinders large-context performance. Unclear if this affects single-GPU or only multi-GPU, but #253's fix clearly didn't cover all cases.

Discrete Performance Threshold

STRATA_ARENA_PIN_GIB 4 8 16 32 40 41 42 43 44 unset
prefill 177.8 179.6 183.3 184.2 192.2 fast fast slow 134.0 127.0
prompt loan 1.49 1.49 1.49 1.49 1.49 1.49 1.49 0.68 0.68 0.68

Degradation is discrete (loan halves between 42-43 GiB), consistent across 7.3K and 69K tokens. RAM stable at 67-68 GB confirms threshold logic issue.

STRATA_PREFILL_TIMING=1 shows 96.5% loss in embed+steps ("gap where GPU waits" per prefill.cpp comments) — GPU stalls on host expert feed, not slower kernels. These env vars didn't help: STRATA_OLD_GROUPED=1, STRATA_REFILL_SERIAL=1, STRATA_STAGER_THREADS=4, STRATA_SPLIT_OWN=0, STRATA_PREFILL_AUTO_MAX=8192, STRATA_PREFILL_LEND_PCT (60-90).

Where to Look

Loan halves at 83-85% arena pinned. generate.cpp has pinned_share() >= 0.9 ? 90 : 85 threshold. Values are close but STRATA_PREFILL_LEND_PCT didn't affect loan, so likely different thresholds. Coupling between arena pin % and prompt loan logic is probably there.

Originally created by @mohammedalsayegh on GitHub (Oct 2, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/445 Greetings! first, thanks for the great work! Found a performance regression testing on multiple P100s (sm_60 / Pascal). Unclear if Pascal-specific or affects newer architectures. Commit `ed6c124` ("#253: the 8 GiB arena pin cap only under WDDM") causes large expert arenas to lose most prompt speed on Linux. The environment variable from that commit recovers performance, so this likely needs a different default or release note. ## Setup | | | |---|---| | Model | Qwen3.8-Flash-Next **IQ3_S** (`arena_gb` 50.3) | | GPUs | 3 × Tesla P100-PCIE-16GB (sm_60) | | Topology | GPU0 in PCIe x4, GPU1/2 in x16 — auto layer split | | RAM | 125 GB | | CPU | Xeon E5-2699 v3 (AVX2 only) | | CUDA / driver | 12.0 / 580.178.04 | | Engine | `-DSTRATA_EXPERIMENTAL_SM60=ON -DCMAKE_CUDA_ARCHITECTURES=60` | ### Key Triggers - **Arena Size:** Performance cliff at ~84% of arena size. Smaller CI arenas won't reproduce this. - **Layer Split:** Required condition per `ed6c124`. - **RAM Headroom:** Available RAM stays 67-68 GB — this is a threshold issue, not exhaustion. - **Architecture:** sm_60 without AVX-512. GPU arch might matter; CPU likely doesn't. ## Results Median of ≥2 rounds, fresh ~7.3K-token prompts (cached prompts ~0.45s, not measured). | build | `STRATA_ARENA_PIN_GIB` | prefill tok/s | |---|---|---| | `30ec18e` (v0.1.30) | — | **179.7** | | `ed6c124` (first bad) | — | 134.6 | | `c499bd1` (v0.1.32) | — | 133.5 | | `aeb35be` (v0.1.33) | — | 127.0 | | **`aeb35be`, unmodified** | **40** | **192.2** | Same pattern at 69,144 tokens: 125.0 → 204.3 tok/s. Gap widens at larger prompts. ## Why this matters #253 was resolved but didn't fix this for my setup. With layer split, default pins entire arena (past 42-43 GiB cliff): 127 tok/s default vs 192 tok/s with undocumented variable. Severely hinders large-context performance. Unclear if this affects single-GPU or only multi-GPU, but #253's fix clearly didn't cover all cases. ## Discrete Performance Threshold | `STRATA_ARENA_PIN_GIB` | 4 | 8 | 16 | 32 | 40 | 41 | 42 | **43** | 44 | unset | |---|---|---|---|---|---|---|---|---|---|---| | prefill | 177.8 | 179.6 | 183.3 | 184.2 | **192.2** | fast | fast | **slow** | 134.0 | 127.0 | | prompt loan | 1.49 | 1.49 | 1.49 | 1.49 | **1.49** | 1.49 | 1.49 | **0.68** | 0.68 | 0.68 | Degradation is discrete (loan halves between 42-43 GiB), consistent across 7.3K and 69K tokens. RAM stable at 67-68 GB confirms threshold logic issue. `STRATA_PREFILL_TIMING=1` shows 96.5% loss in `embed+steps` ("gap where GPU waits" per `prefill.cpp` comments) — GPU stalls on host expert feed, not slower kernels. These env vars didn't help: `STRATA_OLD_GROUPED=1`, `STRATA_REFILL_SERIAL=1`, `STRATA_STAGER_THREADS=4`, `STRATA_SPLIT_OWN=0`, `STRATA_PREFILL_AUTO_MAX=8192`, `STRATA_PREFILL_LEND_PCT` (60-90). ## Where to Look Loan halves at 83-85% arena pinned. `generate.cpp` has `pinned_share() >= 0.9 ? 90 : 85` threshold. Values are close but `STRATA_PREFILL_LEND_PCT` didn't affect loan, so likely different thresholds. Coupling between arena pin % and prompt loan logic is probably there.
Author
Owner

@mohammedalsayegh commented on GitHub (Oct 2, 2026):

Same with Q4 model, after change value of STRATA_ARENA_PIN_GIB to 68 while evenly distributed expert on three of P100, the PP increased to ~260 TPS and peaked to more than ~300 TPS on longer context

<!-- gh-comment-id:5946882634 --> @mohammedalsayegh commented on GitHub (Oct 2, 2026): Same with Q4 model, after change value of STRATA_ARENA_PIN_GIB to 68 while evenly distributed expert on three of P100, the PP increased to ~260 TPS and peaked to more than ~300 TPS on longer context
Author
Owner

@Niko1221 commented on GitHub (Oct 2, 2026):

Thanks for the careful sweep. The cliff lines up with an internal rule. Your arena is 46.85 GiB, and 0.9 of it is 42.2 GiB: when 90% or more of the experts are pinned, the prompt path takes a 384-slot streaming ring instead of 96 (and a larger lend). On a split with three 16 GB cards, that larger ring eats most of each stage's cache, which fits the prompt loan halving in your log. Could you run once with "STRATA_SPLIT_RING": "96" in the config's env (and STRATA_ARENA_PIN_GIB unset), and post the streamed ring, prompt chunk auto and borrows lines for both models? If it restores the 192 tok/s, the fix is that a split keeps the 96 ring regardless of how much is pinned.

<!-- gh-comment-id:5947589118 --> @Niko1221 commented on GitHub (Oct 2, 2026): Thanks for the careful sweep. The cliff lines up with an internal rule. Your arena is 46.85 GiB, and 0.9 of it is 42.2 GiB: when 90% or more of the experts are pinned, the prompt path takes a 384-slot streaming ring instead of 96 (and a larger lend). On a split with three 16 GB cards, that larger ring eats most of each stage's cache, which fits the prompt loan halving in your log. Could you run once with `"STRATA_SPLIT_RING": "96"` in the config's `env` (and `STRATA_ARENA_PIN_GIB` unset), and post the `streamed ring`, `prompt chunk auto` and `borrows` lines for both models? If it restores the 192 tok/s, the fix is that a split keeps the 96 ring regardless of how much is pinned.
Author
Owner

@mohammedalsayegh commented on GitHub (Oct 2, 2026):

The root cause turned out to be on my end rather than the engine's, and knowing about STRATA_SPLIT_RING helped as I was configuring it the wrong way. It would be great if this was documented for others later with certain setups.

The actual cause was a boot service of mine, set_gpu_clocks.service, running nvidia-smi -i 0 -ac 715,544 to stop all three cards from boosting at once on a power-capped setup.

That left GPU0 locked at 544 of its 1328 MHz for months, across every reboot, since -ac persists in the driver. Your SMs × clock division then did exactly what it was supposed to with a card reporting 0.54 GHz: CUDA0 got 2 of 48 layers while the other two took 23 each. On the Q4 with the pin unset in both cases, I got 176.5 tok/s with the lock and 266.6 without (+51%), using the same model and settings.

I ran your test on both models with STRATA_ARENA_PIN_GIB unset, and the override demonstrably took effect (borrows dropped ~400 slots / 0.7 GiB either way):

model ring 384 ring 96
IQ3_S (46.85 GiB) 232.8 tok/s 236.3 tok/s
Q4 (71.73 GiB) 266.6 tok/s 254.4 tok/s

Prompt chunk was set to auto (8192 tokens) in all four runs, and streamed ring 96 slots were logged for the overridden ones. So forcing 96 helped neither model and cost the Q4 ~4.5% (non-overlapping ranges), while on the IQ3_S the +1.5% is inside the noise margin — I wouldn't make it unconditional. Your pinned_share >= 0.9 threshold picked correctly in both cases.

Two smaller things, if useful: cudaDevAttrClockRate at generate.cpp:2040 looks like a spec value rather than a live clock. It read 1.33 GHz for a card running at 1189 MHz, while still catching the hard lock. This means thermal or power throttling is invisible to the split planner, which is fine, just leaving a note for later when someone finds this while checking the root of an issue.

It would be great to document STRATA_SPLIT_RING. A note that it's the manual escape hatch for when the auto-planner can't resolve a clock-skewed or power-capped split would be genuinely helpful. It would have saved me an hour of guessing, lol.

Thanks for your time and effort on the project!

<!-- gh-comment-id:5955141891 --> @mohammedalsayegh commented on GitHub (Oct 2, 2026): The root cause turned out to be on my end rather than the engine's, and knowing about `STRATA_SPLIT_RING` helped as I was configuring it the wrong way. It would be great if this was documented for others later with certain setups. The actual cause was a boot service of mine, `set_gpu_clocks.service`, running `nvidia-smi -i 0 -ac 715,544` to stop all three cards from boosting at once on a power-capped setup. That left GPU0 locked at 544 of its 1328 MHz for months, across every reboot, since `-ac` persists in the driver. Your SMs × clock division then did exactly what it was supposed to with a card reporting 0.54 GHz: CUDA0 got 2 of 48 layers while the other two took 23 each. On the Q4 with the pin unset in both cases, I got 176.5 tok/s with the lock and 266.6 without (+51%), using the same model and settings. I ran your test on both models with `STRATA_ARENA_PIN_GIB` unset, and the override demonstrably took effect (borrows dropped ~400 slots / 0.7 GiB either way): | model | ring 384 | ring 96 | |---|---|---| | IQ3_S (46.85 GiB) | 232.8 tok/s | 236.3 tok/s | | Q4 (71.73 GiB) | 266.6 tok/s | 254.4 tok/s | Prompt chunk was set to auto (8192 tokens) in all four runs, and streamed ring 96 slots were logged for the overridden ones. So forcing 96 helped neither model and cost the Q4 ~4.5% (non-overlapping ranges), while on the IQ3_S the +1.5% is inside the noise margin — I wouldn't make it unconditional. Your `pinned_share >= 0.9` threshold picked correctly in both cases. Two smaller things, if useful: `cudaDevAttrClockRate` at generate.cpp:2040 looks like a spec value rather than a live clock. It read 1.33 GHz for a card running at 1189 MHz, while still catching the hard lock. This means thermal or power throttling is invisible to the split planner, which is fine, just leaving a note for later when someone finds this while checking the root of an issue. It would be great to document `STRATA_SPLIT_RING`. A note that it's the manual escape hatch for when the auto-planner can't resolve a clock-skewed or power-capped split would be genuinely helpful. It would have saved me an hour of guessing, lol. Thanks for your time and effort on the project!
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#207
No description provided.