[GH-ISSUE #3744] [Engine] session files (SAVE/RESTORE) refuse multi-GPU layer-split runs — request per-device session files #1570

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

Originally created by @exotic16 on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3744

One line: session files are the only way to resume a conversation across restarts/machines, but generate.cpp refuses them whenever layers are split across GPUs — which is the only way a model+KV too big for one card can be served at all.

Where it refuses

At 011c9e60 (engine 0.1.47), src/program/generate.cpp ~line 11941:

if (!stages.empty() || multi_gpu) { refuse("session files do not support --layer-split"); continue; }
if (o.peer_device >= 1)          { refuse("session files do not support --peer-device"); continue; }
if (o.batch > 0)                 { refuse("session files do not support --batch (parallel requests)"); continue; }
if (o.prompt_cache <= 0)         { refuse("session files need --prompt-cache > 0"); continue; }

serve/server.py already implements the full llama-server-shaped surface (POST /slots/0?action=save|restore {"filename":...}, --slot-save-path DIR, --session-min-free-mib, --session-save-reclaim) — only the engine side refuses. We wired the whole client/API/backup side first and Phase-0-benched the engine before deploying, so we know everything works up to this gate.

Our setup (where it hurts)

Two Linux hosts, each serving the SAME model at --max-context 262144 --kv int8 --layer-split auto over two NVIDIA cards (64 GB + 24 GB on one host, 16 GB + 12 GB on the other; model+KV exceed any single card, so a split is mandatory):

  • RAM tier works great: --conversation-cache-mib 49152 --conversation-cache-slots 8 --conversation-cache-park-gain 4096 --prompt-cache-spread → ~95–97 % of prompt tokens reused, warm TTFT ~0.5 s vs ~89 s cold.
  • But an engine restart (updates happen often — upstream moves fast!) silently drops every RAM park: each live chat then pays one full re-prefill (60–90 s at ~140 K tokens). The RAM budget also bounds how many chats stay warm; the smaller host (91 GB RAM) is eviction-bound.
  • Disk SAVE/RESTORE would convert eviction/restart/machine-switch cost from ~90 s rebuild to ~1–2 s restore. We cannot use it on either host purely because of the multi-GPU gate.

Request

Session files that carry per-device/per-stage conversation state (KV blocks per card + the conversation identity), stamped with the same build/topology identity the engine already uses to refuse mismatches:

  1. SAVE on a layer-split run writes one session (dir or container) with a section per stage/device.
  2. RESTORE requires the same build and the same card topology — mismatch keeps the current, correct behavior: refuse the file, cold-prefill instead, never misapply.
  3. Bonus if cheap: restore onto a different topology when the KV fits (device mapping rewrite), which would also make cross-box chat migration trivial — same model builds across our hosts differ only in card sizes.

Scope suggestion: same-topology save/restore first; it alone unlocks restart-resume and eviction overflow, which is what we actually need.

Acceptance test we would run

Open a conversation with an exact-answer fact, POST /slots/0?action=save, restart the engine, action=restore, continue the chat: the follow-up must (a) answer the exact fact, (b) show reused ≈ full prompt in /metrics, (c) first token in seconds not a minute — and a restore under a different build must be refused with a cold-prefill fallback, not corrupted output.

Versions: engine 0.1.47 / 011c9e60, llama-server-shaped serve API, --layer-split auto, --kv int8, Linux, CUDA.

Originally created by @exotic16 on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3744 **One line:** session files are the only way to resume a conversation across restarts/machines, but `generate.cpp` refuses them whenever layers are split across GPUs — which is the *only* way a model+KV too big for one card can be served at all. ## Where it refuses At `011c9e60` (engine 0.1.47), `src/program/generate.cpp` ~line 11941: ```cpp if (!stages.empty() || multi_gpu) { refuse("session files do not support --layer-split"); continue; } if (o.peer_device >= 1) { refuse("session files do not support --peer-device"); continue; } if (o.batch > 0) { refuse("session files do not support --batch (parallel requests)"); continue; } if (o.prompt_cache <= 0) { refuse("session files need --prompt-cache > 0"); continue; } ``` `serve/server.py` already implements the full llama-server-shaped surface (`POST /slots/0?action=save|restore {"filename":...}`, `--slot-save-path DIR`, `--session-min-free-mib`, `--session-save-reclaim`) — only the engine side refuses. We wired the whole client/API/backup side first and Phase-0-benched the engine before deploying, so we know everything works up to this gate. ## Our setup (where it hurts) Two Linux hosts, each serving the SAME model at `--max-context 262144 --kv int8 --layer-split auto` over two NVIDIA cards (64 GB + 24 GB on one host, 16 GB + 12 GB on the other; model+KV exceed any single card, so a split is mandatory): - RAM tier works great: `--conversation-cache-mib 49152 --conversation-cache-slots 8 --conversation-cache-park-gain 4096 --prompt-cache-spread` → ~95–97 % of prompt tokens reused, warm TTFT ~0.5 s vs ~89 s cold. - But an engine restart (updates happen often — upstream moves fast!) silently drops every RAM park: each live chat then pays one full re-prefill (60–90 s at ~140 K tokens). The RAM budget also bounds how many chats stay warm; the smaller host (91 GB RAM) is eviction-bound. - Disk SAVE/RESTORE would convert eviction/restart/machine-switch cost from ~90 s rebuild to ~1–2 s restore. We cannot use it on either host purely because of the multi-GPU gate. ## Request Session files that carry **per-device/per-stage conversation state** (KV blocks per card + the conversation identity), stamped with the same build/topology identity the engine already uses to refuse mismatches: 1. `SAVE` on a layer-split run writes one session (dir or container) with a section per stage/device. 2. `RESTORE` requires the same build **and the same card topology** — mismatch keeps the current, correct behavior: refuse the file, cold-prefill instead, never misapply. 3. Bonus if cheap: restore onto a different topology when the KV fits (device mapping rewrite), which would also make cross-box chat migration trivial — same model builds across our hosts differ only in card sizes. Scope suggestion: same-topology save/restore first; it alone unlocks restart-resume and eviction overflow, which is what we actually need. ## Acceptance test we would run Open a conversation with an exact-answer fact, `POST /slots/0?action=save`, restart the engine, `action=restore`, continue the chat: the follow-up must (a) answer the exact fact, (b) show `reused` ≈ full prompt in `/metrics`, (c) first token in seconds not a minute — and a restore under a *different* build must be refused with a cold-prefill fallback, not corrupted output. Versions: engine 0.1.47 / `011c9e60`, llama-server-shaped serve API, `--layer-split auto`, `--kv int8`, Linux, CUDA.
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:6659691346 --> @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#1570
No description provided.