[GH-ISSUE #3952] [Engine] 0.1.46 VRAM 0 MiB death spiral at long context; 0.1.43.1 stable at 238K on the same flags #1694

Open
opened 2026-11-04 01:53:14 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @rainmakerhuang-rgb on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3952

The problem

On engine 0.1.46 (CUDA 13.0, sm_89), a long-context request drives VRAM to 0 MiB free, the MTP verify windows collapse one by one, and the engine restarts. The same machine, same model and same flags on engine 0.1.43.1 runs 238K-token contexts for 7 consecutive rounds with no VRAM warning at all.

Hardware / model

  • RTX 5000 Ada Generation Laptop GPU, 16 GB VRAM
  • i9-13900HX, 128 GB RAM, NVMe (model data on a dedicated NVMe volume)
  • Windows 11, engine CUDA 13.0 build (sm_89)
  • Models: Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S (PLE) and unsloth ud-iq4_xs

Flags (identical in both runs, as recorded in the engine started: line of the serve log):
--max-context 262144 --vram-reserve-mib 700 --conversation-cache-mib 16384 --ple-io mmap --spec 4 --kv int8 --kv-resident 32768

0.1.46 — death spiral (2026-10-24 13:13, ud-iq4_xs)

strata serve: WARNING: only 0 MiB of VRAM free at the start of this request (below 1024 MiB): when the card is this full the driver can page GPU memory to system RAM, decode falls to a ...
strata verify: capturing the 6-token window (61 MiB of VRAM free)
strata verify: capturing the 4-token window (49 MiB of VRAM free)
strata verify: capturing the 1-token window (28 MiB of VRAM free)
strata verify: capturing the 5-token window (13 MiB of VRAM free)
strata verify: capturing the 2-token window (0 MiB of VRAM free)
strata verify: capturing the 3-token window (0 MiB of VRAM free)
[strata] 2026-10-24 13:13:26 engine started: ...

The free-VRAM figure only ever goes down inside a request (61 → 49 → 28 → 13 → 0 MiB), the windows keep getting captured, and the engine restarts. After the restart the same request pattern repeats. Raising --vram-reserve-mib to 1094 (ud-iq4_xs) / 1728 (swift) stops the spiral, which is why this reads as a regression in how the verify-window buffers are budgeted rather than a genuine card-full condition.

0.1.43.1 — same flags, 238K context, no incident (2026-10-24 18:43)

Scripted load: 7 rounds, each round appends ~26K prompt tokens, max_tokens=4096.

round prompt tokens generated wall
1 31,262 128 45 s
2 62,510 4,096 93 s
3 97,742 4,096 100 s
4 132,991 4,096 103 s
5 168,240 4,096 90 s
6 203,489 4,096 114 s
7 238,735 4,096 100 s

Zero VRAM free warnings, zero verify-window collapse, zero engine restarts. KV streaming hit VRAM 90–97% of block reads. Round 8 returned HTTP 400 because the next prompt would exceed --max-context 262144 — expected, not a crash.

Historical single-request record on 0.1.43.1 (2026-10-15, same --vram-reserve-mib 700):

strata serve: prompt 113715 tokens = 112386 reused + 1329 read in 2588 ms (513.5 tok/s), 148421 generated in 1661890 ms (89.3 tok/s), drafts accepted 111081 of 111326, 6 checkpoints
strata serve: KV streaming: 96.61% of 1017555948 block reads hit VRAM, 138991.0 MiB read from RAM

148K tokens generated in one request at 700 MiB reserve, no warning.

Two asks

  1. Budget the MTP verify windows against --vram-reserve-mib. On 0.1.46 the windows are captured even when free VRAM is already 0 MiB, so the request that reports "0 MiB free" keeps going and pages. Refusing to capture a window below the reserve (or shrinking the window count) would degrade speed instead of killing the engine.
  2. Stamp the engine version in the engine started: log line. It records the full command line (including --vram-reserve-mib) but not the version, so a bisect like this one has to be argued from file timestamps instead of the log.

Caveat on this report

The 0.1.46 spiral above is from the ud-iq4_xs server (reserve 1094 at the time); the 0.1.43.1 clean run is swift-iq3_s at reserve 700. The engine-version attribution comes from our own swap timeline, not from the log, because the log does not record the version (see ask 2). I can run the same 7-round script against 0.1.46 on swift-iq3_s at reserve 700 to close that gap if it helps.

Originally created by @rainmakerhuang-rgb on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3952 ### The problem On engine **0.1.46** (CUDA 13.0, sm_89), a long-context request drives VRAM to `0 MiB free`, the MTP verify windows collapse one by one, and the engine restarts. The same machine, same model and same flags on engine **0.1.43.1** runs 238K-token contexts for 7 consecutive rounds with no VRAM warning at all. ### Hardware / model - RTX 5000 Ada Generation Laptop GPU, 16 GB VRAM - i9-13900HX, 128 GB RAM, NVMe (model data on a dedicated NVMe volume) - Windows 11, engine CUDA 13.0 build (sm_89) - Models: `Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S` (PLE) and `unsloth ud-iq4_xs` Flags (identical in both runs, as recorded in the `engine started:` line of the serve log): `--max-context 262144 --vram-reserve-mib 700 --conversation-cache-mib 16384 --ple-io mmap --spec 4 --kv int8 --kv-resident 32768` ### 0.1.46 — death spiral (2026-10-24 13:13, ud-iq4_xs) ``` strata serve: WARNING: only 0 MiB of VRAM free at the start of this request (below 1024 MiB): when the card is this full the driver can page GPU memory to system RAM, decode falls to a ... strata verify: capturing the 6-token window (61 MiB of VRAM free) strata verify: capturing the 4-token window (49 MiB of VRAM free) strata verify: capturing the 1-token window (28 MiB of VRAM free) strata verify: capturing the 5-token window (13 MiB of VRAM free) strata verify: capturing the 2-token window (0 MiB of VRAM free) strata verify: capturing the 3-token window (0 MiB of VRAM free) [strata] 2026-10-24 13:13:26 engine started: ... ``` The free-VRAM figure only ever goes down inside a request (61 → 49 → 28 → 13 → 0 MiB), the windows keep getting captured, and the engine restarts. After the restart the same request pattern repeats. Raising `--vram-reserve-mib` to 1094 (ud-iq4_xs) / 1728 (swift) stops the spiral, which is why this reads as a regression in how the verify-window buffers are budgeted rather than a genuine card-full condition. ### 0.1.43.1 — same flags, 238K context, no incident (2026-10-24 18:43) Scripted load: 7 rounds, each round appends ~26K prompt tokens, `max_tokens=4096`. | round | prompt tokens | generated | wall | |---|---|---|---| | 1 | 31,262 | 128 | 45 s | | 2 | 62,510 | 4,096 | 93 s | | 3 | 97,742 | 4,096 | 100 s | | 4 | 132,991 | 4,096 | 103 s | | 5 | 168,240 | 4,096 | 90 s | | 6 | 203,489 | 4,096 | 114 s | | 7 | 238,735 | 4,096 | 100 s | Zero `VRAM free` warnings, zero verify-window collapse, zero engine restarts. KV streaming hit VRAM 90–97% of block reads. Round 8 returned HTTP 400 because the next prompt would exceed `--max-context 262144` — expected, not a crash. Historical single-request record on 0.1.43.1 (2026-10-15, same `--vram-reserve-mib 700`): ``` strata serve: prompt 113715 tokens = 112386 reused + 1329 read in 2588 ms (513.5 tok/s), 148421 generated in 1661890 ms (89.3 tok/s), drafts accepted 111081 of 111326, 6 checkpoints strata serve: KV streaming: 96.61% of 1017555948 block reads hit VRAM, 138991.0 MiB read from RAM ``` 148K tokens generated in one request at 700 MiB reserve, no warning. ### Two asks 1. **Budget the MTP verify windows against `--vram-reserve-mib`.** On 0.1.46 the windows are captured even when free VRAM is already 0 MiB, so the request that reports "0 MiB free" keeps going and pages. Refusing to capture a window below the reserve (or shrinking the window count) would degrade speed instead of killing the engine. 2. **Stamp the engine version in the `engine started:` log line.** It records the full command line (including `--vram-reserve-mib`) but not the version, so a bisect like this one has to be argued from file timestamps instead of the log. ### Caveat on this report The 0.1.46 spiral above is from the ud-iq4_xs server (reserve 1094 at the time); the 0.1.43.1 clean run is swift-iq3_s at reserve 700. The engine-version attribution comes from our own swap timeline, not from the log, because the log does not record the version (see ask 2). I can run the same 7-round script against 0.1.46 on swift-iq3_s at reserve 700 to close that gap if it helps.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6383360220 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@rainmakerhuang-rgb commented on GitHub (Oct 24, 2026):

Same-model A/B — closing the gap from the caveat above

Ran the identical 7-round script (stress700.py) on swift-iq3_s at --vram-reserve-mib 700 on both engines, flags otherwise identical (--max-context 262144 --ple-io mmap). Engine binaries swapped by mirroring engine/; config jsons untouched.

Engine 0.1.46 (2026-10-24 19:07–19:16)

round prompt tokens generated wall
1 31,262 136 58 s
2 62,515 4,096 83 s
3 95,275 4,096 89 s
4 130,525 4,096 81 s
5 165,810 4,096 121 s
6 201,095 4,096 81 s
7 236,380 4,096 67 s

Completed all 7 rounds, but logged 6× WARNING: only 0 MiB of VRAM free at the start of this request. Verify windows still captured at 70–190 MiB with no upload/sync error this time, so the engine survived — but it was running at literally zero free VRAM for several requests.

Engine 0.1.43.1 (2026-10-24 18:43–18:53, table from the original report): 7 rounds, 31,262 → 238,735 prompt tokens, zero VRAM free warnings.

Same model, same flags, same script, same machine. 0.1.43.1 stays comfortably above zero; 0.1.46 repeatedly hits 0 MiB and relies on the driver paging to survive. Combined with the 13:13 spiral above (where the windows did collapse to 0/1/2 tokens and the engine restarted), this reads as the verify-window/KV budget in 0.1.46 consuming the --vram-reserve-mib headroom that 0.1.43.1 respected.

--vram-reserve-mib in the 0.1.46 run was confirmed in the engine started: line as 700, so this is not a config drift.

<!-- gh-comment-id:6383763033 --> @rainmakerhuang-rgb commented on GitHub (Oct 24, 2026): ### Same-model A/B — closing the gap from the caveat above Ran the identical 7-round script (`stress700.py`) on **swift-iq3_s at `--vram-reserve-mib 700`** on both engines, flags otherwise identical (`--max-context 262144 --ple-io mmap`). Engine binaries swapped by mirroring `engine/`; config jsons untouched. **Engine 0.1.46** (2026-10-24 19:07–19:16) | round | prompt tokens | generated | wall | |---|---|---|---| | 1 | 31,262 | 136 | 58 s | | 2 | 62,515 | 4,096 | 83 s | | 3 | 95,275 | 4,096 | 89 s | | 4 | 130,525 | 4,096 | 81 s | | 5 | 165,810 | 4,096 | 121 s | | 6 | 201,095 | 4,096 | 81 s | | 7 | 236,380 | 4,096 | 67 s | Completed all 7 rounds, but logged **6× `WARNING: only 0 MiB of VRAM free at the start of this request`**. Verify windows still captured at 70–190 MiB with no upload/sync error this time, so the engine survived — but it was running at literally zero free VRAM for several requests. **Engine 0.1.43.1** (2026-10-24 18:43–18:53, table from the original report): 7 rounds, 31,262 → 238,735 prompt tokens, **zero `VRAM free` warnings**. Same model, same flags, same script, same machine. 0.1.43.1 stays comfortably above zero; 0.1.46 repeatedly hits 0 MiB and relies on the driver paging to survive. Combined with the 13:13 spiral above (where the windows did collapse to 0/1/2 tokens and the engine restarted), this reads as the verify-window/KV budget in 0.1.46 consuming the `--vram-reserve-mib` headroom that 0.1.43.1 respected. `--vram-reserve-mib` in the 0.1.46 run was confirmed in the `engine started:` line as 700, so this is not a config drift.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6384876032 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Thanks, this follows the format now.
Author
Owner

@rubenbertrams-source commented on GitHub (Oct 26, 2026):

Suggestion: size the headroom per request instead of one fixed --vram-reserve-mib.

The headroom a request needs depends on what that request will do (context length, verify windows, MTP captures), but
the reserve is one number for the whole run. Short chats then give up expert slots they never need, and long ones can
still run out. The pieces for an adaptive reserve seem to exist already:

  1. Before a request (or before capturing a verify window), estimate the transient VRAM it needs from its context length
    and window count – the budget the original report asks for.
  2. If free VRAM minus that estimate is below a small floor, release expert-cache segments first (as --vram-elastic /
    POST /v1/vram already do between requests), instead of capturing the window and collapsing.
  3. Take the segments back after the request, so short chats keep the full expert cache.

That would make --vram-reserve-mib a floor rather than a guess, and the existing "shrinking the expert cache" path at
slot time would cover the in-request case as well.

<!-- gh-comment-id:6421151322 --> @rubenbertrams-source commented on GitHub (Oct 26, 2026): Suggestion: size the headroom per request instead of one fixed `--vram-reserve-mib`. The headroom a request needs depends on what that request will do (context length, verify windows, MTP captures), but the reserve is one number for the whole run. Short chats then give up expert slots they never need, and long ones can still run out. The pieces for an adaptive reserve seem to exist already: 1. Before a request (or before capturing a verify window), estimate the transient VRAM it needs from its context length and window count – the budget the original report asks for. 2. If free VRAM minus that estimate is below a small floor, release expert-cache segments first (as `--vram-elastic` / `POST /v1/vram` already do between requests), instead of capturing the window and collapsing. 3. Take the segments back after the request, so short chats keep the full expert cache. That would make `--vram-reserve-mib` a floor rather than a guess, and the existing "shrinking the expert cache" path at slot time would cover the in-request case as well.
Author
Owner

@rainmakerhuang-rgb commented on GitHub (Nov 1, 2026):

Thanks — that matches what the code says (0.2.2's serve/server.py:2989 turns vram_elastic: true into --vram-elastic, and the POST /v1/vram reserve is at 3760). The 0.1.44.1 engine we run now does not accept --vram-elastic at all (its --help has no elastic/VRAM flag), so this path only exists on the 0.2.x line — i.e. the version showing the symptom.

For now we are staying on engine 0.1.44.1 with the existing flags (--vram-reserve-mib 700 --max-context 262144 --ple-io mmap), which has been running normally for over a week with no 0 MiB warnings.

When we move back to 0.2.x we will re-test with vram_elastic: true and the same 7-round script (31K → 236K prompt tokens) and report whether the 6× 0 MiB of VRAM free disappear. Leaving this open for that result.

<!-- gh-comment-id:6555678789 --> @rainmakerhuang-rgb commented on GitHub (Nov 1, 2026): Thanks — that matches what the code says (0.2.2's `serve/server.py:2989` turns `vram_elastic: true` into `--vram-elastic`, and the `POST /v1/vram` reserve is at 3760). The 0.1.44.1 engine we run now does not accept `--vram-elastic` at all (its `--help` has no elastic/VRAM flag), so this path only exists on the 0.2.x line — i.e. the version showing the symptom. For now we are staying on **engine 0.1.44.1 with the existing flags** (`--vram-reserve-mib 700 --max-context 262144 --ple-io mmap`), which has been running normally for over a week with no `0 MiB` warnings. When we move back to 0.2.x we will re-test with `vram_elastic: true` and the same 7-round script (31K → 236K prompt tokens) and report whether the 6× `0 MiB of VRAM free` disappear. Leaving this open for that result.
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#1694
No description provided.