[GH-ISSUE #1975] [Regression] v0.1.43 adaptive overlap reduces IQ3_S decode ~26% on RTX 5090 #785

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

Originally created by @oal on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1975

[Regression] v0.1.43 adaptive overlap reduces IQ3_S decode ~26% on RTX 5090

Hardware / setup

  • RTX 5090, 32 GB VRAM; NVIDIA driver 610.57.04
  • Ryzen 9 9950X, 16 cores; 123 GiB usable RAM
  • Fedora host, Ubuntu 26.04 NVIDIA distrobox
  • Qwen3.8-Flash-Next GSQ-RCO IQ3_S, CPU vision
  • 409,600 max context, int8 KV, 32,768 resident KV cells
  • 2,048 MiB VRAM reserve
  • Existing calibration: --adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97

Results

After upgrading from v0.1.42, typical decode fell from roughly 160–200 TPS to 100–130 TPS.

Controlled tests within v0.1.43, changing only STRATA_ADAPT_OVERLAP:

Setting Mean decode
STRATA_ADAPT_OVERLAP=1 126 TPS
STRATA_ADAPT_OVERLAP=0 170 TPS

Protocol: four engine starts in on/off/off/on order; calibration’s three prompts prefixed with synthetic documents at 4K and 100K tokens; temperature 0; 512-token output cap; one warm-up round followed by two measured rounds. No competing agent workload.

Output-identical 512-token samples also showed 128 TPS enabled vs 189–195 TPS disabled, so differing answers do not explain the entire gap.

Disabling overlap restored live API code tests to 215–222 TPS at 100K, without recalibration or downgrade.

Could the new adaptive-overlap synchronization path regress on this hardware?

Originally created by @oal on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1975 # [Regression] v0.1.43 adaptive overlap reduces IQ3_S decode ~26% on RTX 5090 ## Hardware / setup - RTX 5090, 32 GB VRAM; NVIDIA driver **610.57.04** - Ryzen 9 9950X, 16 cores; **123 GiB usable RAM** - Fedora host, Ubuntu 26.04 NVIDIA distrobox - Qwen3.8-Flash-Next GSQ-RCO **IQ3_S**, CPU vision - 409,600 max context, int8 KV, 32,768 resident KV cells - 2,048 MiB VRAM reserve - Existing calibration: `--adapt-every 1 --adapt-swaps 160 --adapt-decay 0.97` ## Results After upgrading from v0.1.42, typical decode fell from roughly 160–200 TPS to 100–130 TPS. Controlled tests **within v0.1.43**, changing only `STRATA_ADAPT_OVERLAP`: | Setting | Mean decode | |---|---:| | `STRATA_ADAPT_OVERLAP=1` | 126 TPS | | `STRATA_ADAPT_OVERLAP=0` | 170 TPS | Protocol: four engine starts in **on/off/off/on** order; calibration’s three prompts prefixed with synthetic documents at 4K and 100K tokens; temperature 0; 512-token output cap; one warm-up round followed by two measured rounds. No competing agent workload. Output-identical 512-token samples also showed **128 TPS enabled vs 189–195 TPS disabled**, so differing answers do not explain the entire gap. Disabling overlap restored live API code tests to **215–222 TPS at 100K**, without recalibration or downgrade. Could the new adaptive-overlap synchronization path regress on this hardware?
Author
Owner

@oal commented on GitHub (Oct 11, 2026):

Follow-up: the evidence points to CUDA's lazily created callback worker inheriting the decoding host's single-CPU affinity.

  • ExpertPool pins the host to CPU 0 on this machine.
  • adapt() submits its first cudaLaunchHostFunc later; the worker can inherit CPU 0.
  • The host spins for the callback while that worker competes for the same CPU, holding up subsequent copies on its stream.

Standalone reproduction on CUDA 13.3.33, 200 unprofiled callback/spin handshakes:

First callback submitted Observed callback affinity Median latency
After caller pinning CPU 0 only 985 us
Before caller pinning CPUs 0–31 4 us

Smaller proposed fix: warm up and synchronize one no-op CUDA host callback before constructing ExpertPool. Draft PR #1983 adds a 12-line Linux/CUDA opt-in (STRATA_ADAPT_CALLBACK_WARMUP=1), the standalone reproducer and a benchmark report. Per-layer callbacks/waits, swap selection and residency updates remain unchanged; no default changes.

New normal/warm-up/warm-up/normal inference tests, same binary/calibration, fixed --pcie-frac 0.4, temperature 0, 512-token caps, no competing inference workload, warm-up rounds excluded:

Case Normal callbacks Early warm-up Measured requests/setting
4K, three prompts 143 TPS 208 TPS 12
100K, warmed code prompt 233 TPS 252 TPS 4

Adaptive-gate waiting fell from 4.357 ms/window to 0.000343 ms/window (including warm-up). These are a separate paired suite, not replacements for the original 126/170 TPS figures.

Limitations: inference A/B used an experimental binary with its GPU-signal alternative disabled in every arm; the minimal PR patch compiled separately. Some outputs matched, but full-suite bit-exactness is not claimed because cache capacities and existing-path outputs also varied. Clean minimal-PR inference validation, other GPUs/drivers and HIP/SYCL builds remain pending, hence the draft status. Production remains on the original overlap-off workaround.

<!-- gh-comment-id:6112374681 --> @oal commented on GitHub (Oct 11, 2026): Follow-up: the evidence points to **CUDA's lazily created callback worker inheriting the decoding host's single-CPU affinity**. - `ExpertPool` pins the host to CPU 0 on this machine. - `adapt()` submits its first `cudaLaunchHostFunc` later; the worker can inherit CPU 0. - The host spins for the callback while that worker competes for the same CPU, holding up subsequent copies on its stream. Standalone reproduction on CUDA 13.3.33, 200 unprofiled callback/spin handshakes: | First callback submitted | Observed callback affinity | Median latency | |---|---|---:| | After caller pinning | CPU 0 only | 985 us | | Before caller pinning | CPUs 0–31 | 4 us | **Smaller proposed fix:** warm up and synchronize one no-op CUDA host callback **before constructing ExpertPool**. Draft PR **#1983** adds a 12-line Linux/CUDA opt-in (`STRATA_ADAPT_CALLBACK_WARMUP=1`), the standalone reproducer and a benchmark report. Per-layer callbacks/waits, swap selection and residency updates remain unchanged; no default changes. New normal/warm-up/warm-up/normal inference tests, same binary/calibration, fixed `--pcie-frac 0.4`, temperature 0, 512-token caps, no competing inference workload, warm-up rounds excluded: | Case | Normal callbacks | Early warm-up | Measured requests/setting | |---|---:|---:|---:| | 4K, three prompts | 143 TPS | 208 TPS | 12 | | 100K, warmed code prompt | 233 TPS | 252 TPS | 4 | Adaptive-gate waiting fell from **4.357 ms/window to 0.000343 ms/window** (including warm-up). These are a separate paired suite, not replacements for the original 126/170 TPS figures. Limitations: inference A/B used an experimental binary with its GPU-signal alternative disabled in every arm; the minimal PR patch compiled separately. Some outputs matched, but full-suite bit-exactness is not claimed because cache capacities and existing-path outputs also varied. Clean minimal-PR inference validation, other GPUs/drivers and HIP/SYCL builds remain pending, hence the draft status. Production remains on the original overlap-off workaround.
Author
Owner

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

Thank you for the report and for digging into it (including the callback timing), oal. It is the same cause as #1964: the host thread is pinned to one CPU, the CUDA callback thread is created later and inherits that CPU, and the adaptive overlap's per-layer callbacks then fight the host's spin-wait.

The fix is in 0.1.43.1 (out now), built on your PR: the callback thread is started before the host is pinned (on by default, STRATA_ADAPT_CALLBACK_WARMUP=0 turns it off), and the overlap's per-layer signal no longer needs a driver callback thread at all (a 4-byte stream-ordered copy into pinned memory; STRATA_ADAPT_SIGNAL=host brings the host functions back). Swaps, residency and answers do not change. On a 20-core RTX 3060 desktop the warm-up alone gave 36.5 -> 46.5 tok/s and the pinned-copy signal brought it to 56.5 = overlap off.

I am keeping #1975 open until you have confirmed the update on the 5090; #1964 carries the same fix.

One more change in 0.1.43.1: after more reports (#2010) the overlap is opt-in again on every machine (STRATA_ADAPT_OVERLAP=1 turns it on, PR #2011). With the fix above, turning it on is safe on desktops again; please measure it on yours.

<!-- gh-comment-id:6129306015 --> @Niko1221 commented on GitHub (Oct 12, 2026): Thank you for the report and for digging into it (including the callback timing), oal. It is the same cause as #1964: the host thread is pinned to one CPU, the CUDA callback thread is created later and inherits that CPU, and the adaptive overlap's per-layer callbacks then fight the host's spin-wait. The fix is in 0.1.43.1 (out now), built on your PR: the callback thread is started before the host is pinned (on by default, STRATA_ADAPT_CALLBACK_WARMUP=0 turns it off), and the overlap's per-layer signal no longer needs a driver callback thread at all (a 4-byte stream-ordered copy into pinned memory; STRATA_ADAPT_SIGNAL=host brings the host functions back). Swaps, residency and answers do not change. On a 20-core RTX 3060 desktop the warm-up alone gave 36.5 -> 46.5 tok/s and the pinned-copy signal brought it to 56.5 = overlap off. I am keeping #1975 open until you have confirmed the update on the 5090; #1964 carries the same fix. One more change in 0.1.43.1: after more reports (#2010) the overlap is opt-in again on every machine (`STRATA_ADAPT_OVERLAP=1` turns it on, PR #2011). With the fix above, turning it on is safe on desktops again; please measure it on yours.
Author
Owner

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

Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta.

If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment /reopen. A check runs and reopens it.

<!-- gh-comment-id:6270664355 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for the report. This is fixed in 0.2.0-beta (or an earlier release), and we're closing it as part of the tracker reset for 0.2.0-beta. If it still happens on 0.2.0-beta, add the area prefix to the title ([Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]), put the Strata version and your hardware in the issue form fields, and comment `/reopen`. A check runs and reopens it.
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#785
No description provided.