[GH-ISSUE #4073] [Engine] Ordinary batch: checkpoint-copy OOM after graph-cache growth in v0.2.3.1 #1770

Closed
opened 2026-11-04 01:53:54 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @gyroid-eth on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4073

Related (closed): #997. The observed failure here is in a later checkpoint-copy operation, after graph-instantiation OOM recovery had already occurred.

What happened

An eight-slot, two-GPU server stopped during asynchronous multi-turn agent traffic. It had logged repeated graph-instantiation OOM recoveries, but subsequently failed while saving a conversation checkpoint. Expected behavior was continued serving with bounded resource use; the instantiate-on-OOM recovery did not protect this later CUDA operation.

Smallest steps or command that reproduce it

This describes one locally observed incident, not a deterministic minimal reproducer:

  1. Start the model with eight slots and the settings below. Batch-MTP is disabled; solo MTP remains enabled.
  2. Run eight independent conversations with asynchronous arrivals and multi-turn continuations, changing the sets of slots decoding together.
  3. After approximately 32 minutes, one request with 24,962 input tokens was decoding while another was reading its 20,439-token prompt. The latter request failed during checkpoint saving, and the server stopped.

Area

[Engine] — server and native engine.

Desktop app, Terminal or source?

Source checkout for serving; the original failure used Qwen engine 0.1.48. Patch validation used an isolated native build from the same source revision.

Reproduction status

Reproduced locally: one observed failure. A repeatable minimal reproducer has not yet been established. Source analysis and patched-run observations are separated below.

Strata version

Strata v0.2.3.1, commit 7ddc17a38fe7f31637e895ecfba58c2cd43d65ec; Qwen engine 0.1.48.

Graphics card, memory and system

  • Two RTX 3090 cards, 24 GB VRAM each, PCIe 4.0 x16 each, no NVLink; configured power limit 250 W per card.
  • EPYC 7402P; 256 GB DDR4-2400 across eight channels; Linux.

Model, size and settings

Qwen3.8-Flash-Next UD-Q4_K_XL, native pack, int8 KV, solo MTP/spec4, batch-MTP disabled. A steering projection affecting 41 layers was enabled in the original and patched configurations.

Relevant resolved settings:

--batch 8
--max-context 262144
--kv-resident 32768
--layer-split auto
--expert-cache auto
--prefill auto
--prefill-pipe 1536
--vram-reserve-mib 1024
--vram-reserve-later-mib 1280
--kv int8
--spec 4
--spec-min-p 0.70
--ple-io ram
--pcie-frac 0.20

The resolved layer split was 23, with one serial batch group. Expert caches were 12.82 + 9.89 GiB; native free VRAM after loading was 749 / 817 MiB.

Logs

Final native errors:

checkpoint save: conversation snapshot running-state copy: out of memory
saving a checkpoint part failed

Before the failure, there were 13 graph-instantiation OOM recovery messages, reporting 55–57 layout entries kept. There were 126 batch-capture log lines across both stages and 63 distinct slot-row lists. These are log observations, not a direct count of live CUDA graph objects.

Peak sampled NVML memory use was 24,122 / 24,126 MiB. Host MemAvailable remained above 109 GiB, swap was unused, and the saved kernel log contained no Xid, AER or OS-OOM entry.

Source findings at the tested commit

  • Batch limit wiring and first-stage wiring: set_batch_graph_limit(64) is conditional on batch-MTP. Ordinary batch retains the default zero limit.
  • Existing LRU and OOM recovery: the recovery frees older layouts when graph instantiation runs out of memory. It does not run around the later conversation-copy operation.
  • Checkpoint payloads use host vectors (checkpoint state). The reported error wraps stream creation, asynchronous copy and synchronization (copy helper). It does not identify the exact failing CUDA API or establish that checkpoint payloads were newly allocated in VRAM.

Graph pressure is directly observed; its precise causal contribution to the final copy failure is not isolated.

Local patch and validation

Inspired by the bounded-cache proposal in #997, a small local patch wires the existing synchronized LRU limit into both first-stage and downstream-stage verifiers for ordinary batch as well as batch-MTP. Kernels and cache keys are unchanged.

The local patch adds STRATA_BATCH_GRAPHS: default 16 layouts per verifier, integer range 0–256, with 0 meaning unbounded; invalid input falls back to 16 with a diagnostic. At the limit, a new layout evicts the least recently used graph pair before capture. The budget counts layouts, not bytes; it does not bound other CUDA allocations. The tested settings were 8 and 16.

The isolated CUDA 13 / sm_86 build succeeded. CPU parser/LRU checks with CUDA calls stubbed also passed; those checks are separate from GPU validation. One initial replay stopped because its fixture truncated an expected JSON response; that failed attempt was preserved and excluded from the results below. A separate corrected replay used each cap once:

Local layout cap Duration Completed, correctly bound JSON responses Cap evictions per GPU Entries kept before replacement capture Final NVML upper envelope, MiB
8 25 minutes 394 631 7 23,574 / 23,520
16 25 minutes 336 475 15 23,658 / 23,608

Both runs continued beyond cap eviction on both GPUs; neither invoked graph-instantiation OOM recovery or recorded a native error. Each GPU's NVML p95 and maximum were unchanged across the final two complete five-minute bins. Completed-token throughput was 65.85 / 69.17 tokens/s, respectively, but response lengths and realized histories differed, and run order was fixed. This is not a causal performance comparison.

Both patched runs also used STRATA_HANDOFF_PIPE=2 and STRATA_HANDOFF_PIPE_WORKER=1; the inherited environment of the original failed process was not saved, so it cannot be confirmed as identical. The persistent-worker contribution has not been measured separately. These warm replays do not establish long-term stability or coverage of long cold-prefill periodic checkpoints.

Subsequent normal-service observation

On 2026-10-25, 16:35–17:28 JST (07:35–08:28 UTC), the cap-8 build was run as the normal service with the same eight-slot configuration, reserve values and persistent-worker settings above. The saved observation covers approximately 53 minutes of service uptime, including idle time, rather than 53 minutes of continuous load.

This included an eight-agent file-reading/code-inspection/report-writing workload from 17:02:32 to 17:24:41 JST. Agents were stopped in sequence after crossing an observed 9K output-token budget, so this was not a full 30-minute load or eight simultaneous decoders throughout. The final saved service observation recorded 131 cap evictions per GPU, zero graph-instantiation OOM recoveries and zero native errors, with the service still running. Sampled peak NVML use in the workload/termination-confirmation window was 23,596 / 23,540 MiB. These are cumulative service counters and a bounded observation period, not proof of long-term stability or task completion.

As a separate observational comparison, over equal 18m51s windows before the first budget stop, same-engine-clock admitted→reading medians were 21.42 seconds with the earlier four-slot configuration and 0.0165 seconds with this eight-slot configuration. The earlier cohort had 86 observations out of 96 requests, five deadline-censored and five with no reading endpoint; the later cohort had 117/117 observations. Multiple settings and realized histories differed, so this cannot be attributed to the graph cap or slot count alone. Here, admitted denotes management admission, not completed slot acquisition.

Question

Would applying a configurable budget through the existing LRU to the ordinary batch path be an appropriate upstream fix to investigate? The local default of 16 was a test choice, not a proposal to change the upstream default without review. Is there also a preferred way to retain headroom for checkpoint-copy and other CUDA operations that occur outside graph-instantiation OOM recovery?

Originally created by @gyroid-eth on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4073 Related (closed): [#997](https://github.com/Niko1221/Strata/issues/997). The observed failure here is in a later checkpoint-copy operation, after graph-instantiation OOM recovery had already occurred. ### What happened An eight-slot, two-GPU server stopped during asynchronous multi-turn agent traffic. It had logged repeated graph-instantiation OOM recoveries, but subsequently failed while saving a conversation checkpoint. Expected behavior was continued serving with bounded resource use; the instantiate-on-OOM recovery did not protect this later CUDA operation. ### Smallest steps or command that reproduce it This describes one locally observed incident, not a deterministic minimal reproducer: 1. Start the model with eight slots and the settings below. Batch-MTP is disabled; solo MTP remains enabled. 2. Run eight independent conversations with asynchronous arrivals and multi-turn continuations, changing the sets of slots decoding together. 3. After approximately 32 minutes, one request with 24,962 input tokens was decoding while another was reading its 20,439-token prompt. The latter request failed during checkpoint saving, and the server stopped. ### Area [Engine] — server and native engine. ### Desktop app, Terminal or source? Source checkout for serving; the original failure used Qwen engine 0.1.48. Patch validation used an isolated native build from the same source revision. ### Reproduction status Reproduced locally: one observed failure. A repeatable minimal reproducer has not yet been established. Source analysis and patched-run observations are separated below. ### Strata version Strata v0.2.3.1, commit `7ddc17a38fe7f31637e895ecfba58c2cd43d65ec`; Qwen engine 0.1.48. ### Graphics card, memory and system - Two RTX 3090 cards, 24 GB VRAM each, PCIe 4.0 x16 each, no NVLink; configured power limit 250 W per card. - EPYC 7402P; 256 GB DDR4-2400 across eight channels; Linux. ### Model, size and settings Qwen3.8-Flash-Next UD-Q4_K_XL, native pack, int8 KV, solo MTP/spec4, batch-MTP disabled. A steering projection affecting 41 layers was enabled in the original and patched configurations. Relevant resolved settings: ```text --batch 8 --max-context 262144 --kv-resident 32768 --layer-split auto --expert-cache auto --prefill auto --prefill-pipe 1536 --vram-reserve-mib 1024 --vram-reserve-later-mib 1280 --kv int8 --spec 4 --spec-min-p 0.70 --ple-io ram --pcie-frac 0.20 ``` The resolved layer split was 23, with one serial batch group. Expert caches were 12.82 + 9.89 GiB; native free VRAM after loading was 749 / 817 MiB. ### Logs Final native errors: ```text checkpoint save: conversation snapshot running-state copy: out of memory saving a checkpoint part failed ``` Before the failure, there were **13 graph-instantiation OOM recovery messages**, reporting 55–57 layout entries kept. There were 126 batch-capture log lines across both stages and 63 distinct slot-row lists. These are log observations, not a direct count of live CUDA graph objects. Peak sampled NVML memory use was 24,122 / 24,126 MiB. Host MemAvailable remained above 109 GiB, swap was unused, and the saved kernel log contained no Xid, AER or OS-OOM entry. ### Source findings at the tested commit - [Batch limit wiring](https://github.com/Niko1221/Strata/blob/7ddc17a38fe7f31637e895ecfba58c2cd43d65ec/src/program/generate.cpp#L9085) and [first-stage wiring](https://github.com/Niko1221/Strata/blob/7ddc17a38fe7f31637e895ecfba58c2cd43d65ec/src/program/generate.cpp#L9166): `set_batch_graph_limit(64)` is conditional on batch-MTP. Ordinary batch retains the default zero limit. - [Existing LRU and OOM recovery](https://github.com/Niko1221/Strata/blob/7ddc17a38fe7f31637e895ecfba58c2cd43d65ec/src/core/verify.cpp#L3642-L3721): the recovery frees older layouts when graph instantiation runs out of memory. It does not run around the later conversation-copy operation. - Checkpoint payloads use host vectors ([checkpoint state](https://github.com/Niko1221/Strata/blob/7ddc17a38fe7f31637e895ecfba58c2cd43d65ec/src/core/conversation_state.cpp#L165-L183)). The reported error wraps stream creation, asynchronous copy and synchronization ([copy helper](https://github.com/Niko1221/Strata/blob/7ddc17a38fe7f31637e895ecfba58c2cd43d65ec/src/core/conversation_copy.hpp#L23-L48)). It does not identify the exact failing CUDA API or establish that checkpoint payloads were newly allocated in VRAM. Graph pressure is directly observed; its precise causal contribution to the final copy failure is not isolated. ### Local patch and validation Inspired by the [bounded-cache proposal in #997](https://github.com/Niko1221/Strata/issues/997#issuecomment-6028700969), a small local patch wires the existing synchronized LRU limit into both first-stage and downstream-stage verifiers for ordinary batch as well as batch-MTP. Kernels and cache keys are unchanged. The local patch adds `STRATA_BATCH_GRAPHS`: default **16 layouts per verifier**, integer range **0–256**, with **0 meaning unbounded**; invalid input falls back to 16 with a diagnostic. At the limit, a new layout evicts the least recently used graph pair before capture. The budget counts layouts, not bytes; it does not bound other CUDA allocations. The tested settings were 8 and 16. The isolated CUDA 13 / sm_86 build succeeded. CPU parser/LRU checks with CUDA calls stubbed also passed; those checks are separate from GPU validation. One initial replay stopped because its fixture truncated an expected JSON response; that failed attempt was preserved and excluded from the results below. A separate corrected replay used each cap once: | Local layout cap | Duration | Completed, correctly bound JSON responses | Cap evictions per GPU | Entries kept before replacement capture | Final NVML upper envelope, MiB | |---|---:|---:|---:|---:|---:| | 8 | 25 minutes | 394 | 631 | 7 | 23,574 / 23,520 | | 16 | 25 minutes | 336 | 475 | 15 | 23,658 / 23,608 | Both runs continued beyond cap eviction on both GPUs; neither invoked graph-instantiation OOM recovery or recorded a native error. Each GPU's NVML p95 and maximum were unchanged across the final two complete five-minute bins. Completed-token throughput was 65.85 / 69.17 tokens/s, respectively, but response lengths and realized histories differed, and run order was fixed. This is **not a causal performance comparison**. Both patched runs also used `STRATA_HANDOFF_PIPE=2` and `STRATA_HANDOFF_PIPE_WORKER=1`; the inherited environment of the original failed process was not saved, so it cannot be confirmed as identical. The persistent-worker contribution has not been measured separately. These warm replays do not establish long-term stability or coverage of long cold-prefill periodic checkpoints. ### Subsequent normal-service observation On **2026-10-25, 16:35–17:28 JST (07:35–08:28 UTC)**, the cap-8 build was run as the normal service with the same eight-slot configuration, reserve values and persistent-worker settings above. The saved observation covers approximately 53 minutes of service uptime, including idle time, rather than 53 minutes of continuous load. This included an eight-agent file-reading/code-inspection/report-writing workload from **17:02:32 to 17:24:41 JST**. Agents were stopped in sequence after crossing an observed 9K output-token budget, so this was not a full 30-minute load or eight simultaneous decoders throughout. The final saved service observation recorded **131 cap evictions per GPU, zero graph-instantiation OOM recoveries and zero native errors**, with the service still running. Sampled peak NVML use in the workload/termination-confirmation window was 23,596 / 23,540 MiB. These are cumulative service counters and a bounded observation period, **not proof of long-term stability or task completion**. As a separate observational comparison, over equal 18m51s windows before the first budget stop, same-engine-clock admitted→reading medians were 21.42 seconds with the earlier four-slot configuration and 0.0165 seconds with this eight-slot configuration. The earlier cohort had 86 observations out of 96 requests, five deadline-censored and five with no reading endpoint; the later cohort had 117/117 observations. Multiple settings and realized histories differed, so this cannot be attributed to the graph cap or slot count alone. Here, admitted denotes management admission, not completed slot acquisition. ### Question Would applying a configurable budget through the existing LRU to the ordinary batch path be an appropriate upstream fix to investigate? The local default of 16 was a test choice, not a proposal to change the upstream default without review. Is there also a preferred way to retain headroom for checkpoint-copy and other CUDA operations that occur outside graph-instantiation OOM recovery?
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659946958 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1770
No description provided.