[GH-ISSUE #2408] [Bug]: CUDA OOM while restoring a long conversation-cache snapshot on a 2-GPU layer split #973

Closed
opened 2026-11-04 01:47:26 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @MarsLuay on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2408

What happened

On a Windows host with an NVIDIA GeForce RTX 3080 Ti + Tesla V100-PCIE-32GB, Strata 0.1.40 failed while serving a conversation that had been restored from the conversation cache. The relevant run used a two-GPU layer split, --layer-split 24, --conversation-cache-slots 2, --conversation-cache-mib 4096, --max-context 262144, --kv int8, --kv-resident 32768, --vram-reserve-mib 700, and speculative decoding.

The engine log shows the cache restore immediately before the failure:

strata serve: conversation cache: parked 148167 tokens in 1573.2 ms; parked=2 bytes=3335695744 evictions=8 snapshot_bytes=3097849640
strata serve: conversation cache: restored 53 tokens (checkpoint) in 70.2 ms; parked=2 bytes=3336615992
...
strata serve: conversation cache: parked 58 tokens in 77.9 ms; parked=2 bytes=475631160 evictions=8 snapshot_bytes=237785056 reused_kv_bytes=793728
strata serve: conversation cache: restored 148167 tokens (live) in 524.1 ms; parked=2 bytes=2737274704
strata serve: prompt 148295 tokens = 148167 reused + 128 read in 3229 ms (39.6 tok/s), 88 generated in 11781 ms (7.5 tok/s), drafts accepted 54 of 61, 6 checkpoints
CUDA error: out of memory
  current device: 1, in function ggml_cuda_set_device
  cudaSetDevice(physical_device)

The process did not return a normal response after this sequence and the runtime started a new engine process afterward.

Expected behavior

A conversation-cache hit is an optimization. If restoring its running state would not leave the configured VRAM reserve on every device in the layer split, Strata should return the parked snapshot to the cache and reread the prompt, rather than turning the request into a process-fatal CUDA OOM.

Why this appears restore-specific

  • The failure follows restored 148167 tokens (live) in the same server log.
  • The failing device is device 1, which is the later stage of the two-GPU split.
  • The configured VRAM reserve is 700 MiB, but the restore path does not appear to gate admission using a free-VRAM check for every split device.
  • This is distinct from a prompt-cache performance issue: the requested behavior is safe fallback, not guaranteed cache reuse.

Reproduction details

This was observed on the hardware and configuration above while exercising a roughly 148K-token conversation with two conversation-cache slots. I do not yet have a minimal deterministic reproducer; the attached sequence is from the engine log. The failure is not claimed to occur on every request.

Suggested direction

Before restoring a parked conversation, sample free VRAM on CUDA0 and each layer-split stage. If any sampled device is below --vram-reserve-mib, skip the restore, put the snapshot back into the conversation cache, and reread the prompt. If a VRAM sample itself fails, preserve the existing behavior rather than rejecting the cache hit based on an incomplete sample.

Originally created by @MarsLuay on GitHub (Oct 14, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2408 ### What happened On a Windows host with an NVIDIA GeForce RTX 3080 Ti + Tesla V100-PCIE-32GB, Strata 0.1.40 failed while serving a conversation that had been restored from the conversation cache. The relevant run used a two-GPU layer split, `--layer-split 24`, `--conversation-cache-slots 2`, `--conversation-cache-mib 4096`, `--max-context 262144`, `--kv int8`, `--kv-resident 32768`, `--vram-reserve-mib 700`, and speculative decoding. The engine log shows the cache restore immediately before the failure: ```text strata serve: conversation cache: parked 148167 tokens in 1573.2 ms; parked=2 bytes=3335695744 evictions=8 snapshot_bytes=3097849640 strata serve: conversation cache: restored 53 tokens (checkpoint) in 70.2 ms; parked=2 bytes=3336615992 ... strata serve: conversation cache: parked 58 tokens in 77.9 ms; parked=2 bytes=475631160 evictions=8 snapshot_bytes=237785056 reused_kv_bytes=793728 strata serve: conversation cache: restored 148167 tokens (live) in 524.1 ms; parked=2 bytes=2737274704 strata serve: prompt 148295 tokens = 148167 reused + 128 read in 3229 ms (39.6 tok/s), 88 generated in 11781 ms (7.5 tok/s), drafts accepted 54 of 61, 6 checkpoints CUDA error: out of memory current device: 1, in function ggml_cuda_set_device cudaSetDevice(physical_device) ``` The process did not return a normal response after this sequence and the runtime started a new engine process afterward. ### Expected behavior A conversation-cache hit is an optimization. If restoring its running state would not leave the configured VRAM reserve on every device in the layer split, Strata should return the parked snapshot to the cache and reread the prompt, rather than turning the request into a process-fatal CUDA OOM. ### Why this appears restore-specific - The failure follows `restored 148167 tokens (live)` in the same server log. - The failing device is device 1, which is the later stage of the two-GPU split. - The configured VRAM reserve is 700 MiB, but the restore path does not appear to gate admission using a free-VRAM check for every split device. - This is distinct from a prompt-cache performance issue: the requested behavior is safe fallback, not guaranteed cache reuse. ### Reproduction details This was observed on the hardware and configuration above while exercising a roughly 148K-token conversation with two conversation-cache slots. I do not yet have a minimal deterministic reproducer; the attached sequence is from the engine log. The failure is not claimed to occur on every request. ### Suggested direction Before restoring a parked conversation, sample free VRAM on CUDA0 and each layer-split stage. If any sampled device is below `--vram-reserve-mib`, skip the restore, put the snapshot back into the conversation cache, and reread the prompt. If a VRAM sample itself fails, preserve the existing behavior rather than rejecting the cache hit based on an incomplete sample.
Author
Owner

@talisp commented on GitHub (Oct 14, 2026):

A related case on a different configuration, in case it helps: 2x NVIDIA A2 16 GB, Linux, v0.1.42, --layer-split auto, --kv int8 --kv-resident 32768, --vram-reserve-mib 700, --pipeline-windows 2, Q8_0 (188 GB, experts streamed from SSD, 62 GiB RAM).

It is not a cache restore, but it ends the same way: at 256K the engine exited during a conversation checkpoint save (snapshot running-state copy: out of memory, one line above the client-visible saving a checkpoint part failed).

Two observations that may bear on the expected behaviour described here (check the reserve before the copy, and fall back):

  • "VRAM free at start" did not predict the failure: UD-IQ4_XS ran 64K to 1M with 137 to 149 MiB free; Q8_0 passed 64K with 29 MiB free and failed 128K with 383 MiB free.
  • --vram-reserve-mib 1000 removed the failures for us (64K to 1M, one run per context). At 128K, --vram-reserve-mib 1500, --pipeline-windows 0 and --prefill 1024 also passed (one run each).

More detail and the rest of the battery: #2446. Not tested on 0.1.43 or later. (Drafted by an AI assistant from our logs; the account owner reads replies.)

<!-- gh-comment-id:6170939159 --> @talisp commented on GitHub (Oct 14, 2026): A related case on a different configuration, in case it helps: 2x NVIDIA A2 16 GB, Linux, v0.1.42, `--layer-split auto`, `--kv int8 --kv-resident 32768`, `--vram-reserve-mib 700`, `--pipeline-windows 2`, Q8_0 (188 GB, experts streamed from SSD, 62 GiB RAM). It is not a cache restore, but it ends the same way: at 256K the engine exited during a conversation checkpoint save (`snapshot running-state copy: out of memory`, one line above the client-visible `saving a checkpoint part failed`). Two observations that may bear on the expected behaviour described here (check the reserve before the copy, and fall back): - "VRAM free at start" did not predict the failure: UD-IQ4_XS ran 64K to 1M with 137 to 149 MiB free; Q8_0 passed 64K with 29 MiB free and failed 128K with 383 MiB free. - `--vram-reserve-mib 1000` removed the failures for us (64K to 1M, one run per context). At 128K, `--vram-reserve-mib 1500`, `--pipeline-windows 0` and `--prefill 1024` also passed (one run each). More detail and the rest of the battery: #2446. Not tested on 0.1.43 or later. (Drafted by an AI assistant from our logs; the account owner reads replies.)
Author
Owner

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

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. 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:6271019118 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. 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#973
No description provided.