[PR #1887] [CLOSED] [Engine] Remote stage: conversation checkpoints across the link (--prompt-cache), stacked on #1748 #3737

Closed
opened 2026-11-07 15:30:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1887
Author: @lask3802
Created: 10/10/2026
Status: ❌ Closed

Base: main ← Head: remote-stage-ckpt


📝 Commits (10+)

  • 6946676 Remote stage: run the later layers of a layer split on another PC over TCP
  • 2ba81af Remote stage tools: a node agent, a layer shipper and a split tuner
  • 5657d79 Remote stage docs and measurements: two and three PCs, two models
  • f6241ba stage_ship: pieces in flight at once; the agent checks each piece's sha256
  • fecb3c7 Remote stage: follow 0.1.43's decode defaults on both PCs
  • 9822a07 Remote stage: images (--vision) - the worker's layers get the main's positions
  • 6efea4a Remote stage docs: images, and the checks after the rebase onto 0.1.43
  • ef046e0 Remote stage: a stuck worker ends as a stuck main process does; parking turned off, not refused
  • ae6634f Remote stage: a worker's agent starts an ended worker again
  • 8aeb39e Remote stage: the main process connects again, a new main takes a silent worker over

📊 Changes

29 files changed (+9889 additions, -325 deletions)

View changed files

📝 CMakeLists.txt (+16 -1)
📝 docs/MULTI_GPU.md (+14 -1)
➕ docs/REMOTE_STAGE.md (+608 -0)
➕ docs/remote-stage/CHECKPOINTS.md (+412 -0)
➕ docs/remote-stage/ENGINEERING.md (+836 -0)
📝 include/strata/core/conversation_cache.hpp (+3 -0)
📝 include/strata/core/conversation_snapshot.hpp (+7 -0)
📝 include/strata/core/expert_source.hpp (+12 -1)
📝 include/strata/core/verify.hpp (+42 -0)
➕ include/strata/net/stage_ckpt_store.hpp (+87 -0)
➕ include/strata/net/stage_link.hpp (+275 -0)
📝 include/strata/prefill/prefill.hpp (+28 -0)
📝 metal/CMakeLists.txt (+1 -1)
📝 serve/server.py (+21 -1)
📝 serve/test_server.py (+84 -1)
📝 src/core/conversation_copy.hpp (+1 -0)
📝 src/core/conversation_state.cpp (+51 -24)
📝 src/core/conversation_validation_test.cpp (+45 -0)
📝 src/core/expert_source.cpp (+58 -38)
📝 src/core/verify.cpp (+126 -12)

...and 9 more files

📄 Description

Stacked on #1748. The first nineteen commits are #1748's; this PR adds the last six: the feature, its docs, what
#1748's recovery (the main process connecting again) needs from them, the --pipeline-windows 2 case, and the notes
of the rebase. Both PRs are on main 8183c6b6 (v0.2.4.1 and one docs commit, engine 0.1.49.1; see "Rebased onto 0.2.4.1" under
Approach); the measurements below were taken on e88ee39d (0.2.0-beta).

Problem and result

With --remote-stage, every prompt was read from token 0. A conversation checkpoint holds only the running state of
the process's own layers, so the main process could not restore the worker's. A chat client sends the whole
conversation every turn, so every turn of a long chat waited for the whole prompt again: about 15 s at 16K tokens on
the test pair below.

With --prompt-cache N given explicitly on the main process, the worker keeps its layers' part of each checkpoint
under an id the main process hands it, and the chain works as on one GPU at the prompt's synchronous cut points. On
this head (0.2.0-beta), an RTX 2080 Ti main + RTX 3080 worker, the later turns' median time to the first token is
0.38 s with --prompt-cache 6 against 12.83 s without (Validation). On an RTX 3080 + RTX 2080 Ti pair (engine 0.1.43,
earlier heads), time to the first token at the served flags, thinking on, 400 tokens:

#1748 (every prompt from 0) This PR, --prompt-cache 6
First turn, 16,079 tokens 15.00 s 14.50 s
The 7 later turns 14.19-15.06 s 0.32-0.44 s

A turn read from 0 was 0.7-1.3 s slower with checkpoints on 0.1.41 and 0.1.42, and not slower in this run. The prompt
is read in parts that end at its cut points, and a checkpoint is saved at each. With --prompt-cache, answers need not
be byte-identical to a run without it, because the read order differs; the repeated-turn check is the exactness test.

Measured on earlier heads

Every check in this subsection ran again on this head with the cards swapped (Validation), except the "before"
column of the fault table and the adaptive overlap on the worker (Not run).

An RTX 3080 main (layers 0-25, the head, the drafter) and an RTX 2080 Ti worker (layers 26-47) over 10 GbE, RVN
IQ3_S, Linux, engine 0.1.43; #1748's build is the base. The replay is two chats of four turns on one shared system
prompt of about 16,000 tokens, greedy. Exact flags: --pcie-frac 0 --adapt-every 0 --adapt-swaps 0 on both PCs,
--mtp-max-t 1 --suffix-draft 0 on the main, and STRATA_IQ_MT_MIN=1 STRATA_PREFILL_CPU_SHARE=0 on both.

Check Result
Default path (no --prompt-cache, exact flags) vs #1748, one run of each 8 of 8 byte-identical
Every request sent twice, the next turn resuming through a checkpoint (exact flags) 8 of 8 repeats byte-identical; with thinking on, 8 of 8; with each request first cancelled mid-decode, 8 of 8, and equal to the run without cancels. 53 restores on both PCs, 0 errors
Worker store emptied before each restore the request reads from token 0 and finishes
Picture chats (--vision on both PCs): two turns, the second sent twice the second turn resumed through a checkpoint or continued the live session; the re-sent turn byte-identical; all 6 answers equal those of a run without --prompt-cache
Live continuations with the worker's adaptive tier on, 15 min, 100-2,500 new tokens a turn 165 requests, 158 live continuations (97 reading 1,000+ tokens): 0 replies of !. Without the settle, on an earlier build with the same load: about 4 in 10

In these runs the worker's adaptive overlap was on (#1748's build then followed upstream's default on the worker
too). #1748 has since made it opt-in on a worker (STRATA_ADAPT_OVERLAP=1), since it measured no faster there; a
worker without it takes the path of the 0.1.42 runs, where the same live-continuation check gave 161 requests and
0 replies of !. The same checks on 0.1.41 and 0.1.42 gave the same results: 8 of 8 on each repeated-turn line, 53
restores, no ! reply, and later turns in 0.28-0.54 s. On 0.1.42 the default path against #1748 did not repeat from
run to run (8 of 8 in 2 of 6 pairs), as 0.1.42 did not on one GPU either; on 0.1.43 it did.

With --pipeline-windows 2 on the main process (same PCs and model, exact flags, --expert-cache 1951,
STRATA_ROUTE_TAIL_SKIP=0 on the main process): repeated turns 8 of 8 byte-identical with 15 restores on both sides
and 0 errors, the same with thinking on and with cancellation; a forced restore miss (STRATA_REMOTE_CKPT_DROP=1)
read from 0 and finished. The numbers are in docs/remote-stage/CHECKPOINTS.md.

Faults between two turns. On the same pair with this branch's build, #1748's agent and server, --prompt-cache 6
and pictures allowed (served flags). Each conversation's second turn asks for something only its first turn holds (a
code word, or the first word of the previous answer), greedy. The worker was killed with SIGKILL between the turns,
and its agent started it again. "Before" is the docs commit; "after" is the reconnect commit ("checkpoints and the
live session after a reconnect") before its worker-error texts and take-over check, which none of these runs reach.

Between the turns Before After
Nothing (text; picture) both right both right
The worker killed (text, the live session continued) 503 "remote stage: the peer closed the connection"; the engine restarted right, after 45.0 s (the worker's restart and load); the engine kept
The worker killed (picture, a checkpoint mounted) 400 "restoring a conversation checkpoint failed: remote stage: send failed: Broken pipe"; the engine restarted right, after 53.3 s (the word, then more text than the one word asked for)
Chat X, then chat Y, the worker killed, X's second turn (the checkpoint of their shared start) 503; the engine restarted right, after 61.0 s
The main engine killed (text) right, after 11.8 s right, after 12.6 s

The same session on 0.1.43.1 gave every second turn right (worker killed: 45.2 s text, 52.2 s picture, 61.1 s another
chat's checkpoint; main engine killed: 38.1 s), and again on top of #1748's open-points commit (45.1 / 52.1 / 61.0 s;
11.8 s).

  • This PR was open before the 0.2.0-beta reset (closed with every open PR on 2026-10-19); this is the same branch
    rebased onto main e88ee39d on top of #1748's rebase. No maintainer agreement on scope yet.
  • #1748 (the remote stage) is its base; this PR changes nothing for a remote stage without --prompt-cache.

Approach

  • Protocol 5 -> 6. New messages CkptSave / CkptRestore carry an id, a position and the list of ids to keep,
    and Reset carries that list too.
  • Retention. Only the main process decides what is kept; the worker prunes when an operation succeeds. The main
    process works out the chain a new checkpoint leaves before the worker stores its part, with the same eviction it
    applies after (--prompt-cache-spread included), so both PCs drop the same checkpoint.
  • Limits at the hello. The worker refuses more than 64 parts, or more parts than fit in half of its available RAM,
    or any part when it cannot read its RAM (as the engine's own RAM guard refuses parking then). A main process that
    takes a worker over (#1748) is held to the same limits as one that connects to a free worker. Checkpoint lists are
    bounded (at most kStageCkptMax ids, checked before the read).
  • Disconnect. The worker clears its store.
  • Errors. A checkpoint the worker does not hold makes the request read from token 0; a lost link at a request's
    start is made again (below); any other error ends the engine as before. When the error is the link's or the
    worker's, the ERR line starts with it, so the server answers 503 with Retry-After, not 400. A failed image
    position table (#1748's Positions) outlives a CkptRestore as it outlives a Reset, because it belongs to the
    request being started.
  • After a reconnect. The worker the main process reaches after connecting again (a restarted worker, or a
    take-over) holds no session and no checkpoint. So at each request's start the main process checks the idle link
    with nothing sent (StageClient::alive: a 0 ms poll, then a 1-byte peek; the worker never sends unasked) and
    connects again there if it is lost. Whenever the link is made again in a request (that check, its positions, its
    Reset, its CkptRestore), the main process drops its live session and every checkpoint, and the request reads from
    token 0 with a Reset that keeps nothing. A reconnect cancelled at these request-start paths ends that request, and
    the engine stays.
  • A live continuation settles the worker first. A request that continues the live session waits for the worker's
    last Commit and for the adaptive tier's swaps in flight before it lends cache slots to the prompt (hs.prefill), as
    a Reset and a restore do. Without that, a loan could hand the prompt path slots that a swap was still writing, and
    the reply degenerated into !.
  • --pipeline-windows 2. No checkpoint is saved, and the live session is not continued, after a pipelined drain
    that failed.

Following upstream. The rebase onto 0.2.0-beta met upstream's checkpoint chain changes: --prompt-cache-spread
(its eviction now goes through the same function on both of the main process's paths, above), and
STRATA_CKPT_POOL / STRATA_CKPT_THREADS, which act on the main process's own part only (a remote main has no
in-process stage; the worker keeps its part by id). 0.1.44's Metal backend hands the checkpoint save and restore to
its decode window; the range-taking overloads this branch adds stay on the session's buffers, and a remote stage is
refused on Metal (#1748). Upstream's copy_checkpoint_beating (the parked conversation's copies, #2049) copies a
checkpoint's remote_id too. Details: docs/remote-stage/CHECKPOINTS.md, "After the rebase onto 0.2.0-beta".

What it leaves alone.

  • The default path. Without --prompt-cache, a remote main keeps prompt_cache at 0: no new message is sent,
    the prompt is not split, and a Reset is the same header-only message. One-GPU and in-process splits see two
    mechanical refactors only (the eviction loop and the zero-and-reset at request start moved into lambdas, the same
    calls in the same order). On one GPU with the conversation cache, upstream main's, #1748's and this branch's
    builds gave byte-identical answers on 0.1.42; that was not run again since.
  • Mid-prompt checkpoints (--prompt-cache-every, --prompt-cache-tail) and parking (--conversation-cache-mib) stay
    off with a remote stage; session files are refused. A config with --conversation-cache-mib starts, and the main
    process says in its log that parking is off.
  • A worker's CkptSave and CkptRestore are watched by the engine's stall watchdog as its other messages are.
  • The hello says protocol 6, so a main and a worker must both run this version, with or without checkpoints.
  • The check at a request's start sends nothing, so the default path's messages do not change.
  • A relay (three PCs) forwards the new messages, and it links its next worker again after each main process's hello,
    so the next worker checks the real ckpt_max (read from the code and unit-tested, not run on GPUs).

Files: include/strata/net/stage_ckpt_store.hpp and src/net/stage_ckpt_store_test.cpp (new: the worker's store),
include/strata/net/stage_link.hpp and src/net/stage_link.cpp (the messages), src/net/stage_link_test.cpp,
src/program/generate.cpp (the main process's chain and the worker's side), include/strata/core/verify.hpp (a
comment), src/core/conversation_state.cpp, conversation_copy.hpp, conversation_cache.hpp, conversation_snapshot.hpp
(a checkpoint for a layer range and its remote_id), src/core/conversation_validation_test.cpp, CMakeLists.txt,
and the docs (docs/remote-stage/CHECKPOINTS.md, new; docs/REMOTE_STAGE.md, docs/remote-stage/ENGINEERING.md).

Rebased onto 0.2.4.1 (2026-10-24)

This head is #1748's rebase onto main 8183c6b6 (v0.2.4.1 and one docs commit, engine 0.1.49.1) plus this PR's six
commits. The rebase applied with no conflicts, and git range-diff against the 0.2.3 head (8ef01676) shows every commit as the
same patch.

Checked on this head (Linux, the build of the runs below): the build, stage_ckpt_store_test, stage_link_test and
five CPU tests (conv_cache_test, spec_prob_test, batch_rows_test, conversation_validation_test,
conversation_transfer_test) passed. Not run on this head: the Windows build and ctest.

GPU runs on this head (2026-10-24). The same two PCs, model and runs as in the 0.2.3 section below (the 2080 Ti
main, the 3080 worker, 10 GbE, K=26, --max-context 131072), this head's build on both. The CI container on the
main PC's host used 0 cores during every run. In the 0.2.3 section below, "this head" means the 0.2.3 head (8ef01676).

check 0.2.4.1 (this head) 0.2.3 (8ef01676)
repeated turns with an edited front (--prompt-cache, exact flags): the same answer 8 of 8 (9 saved, 15 restored, 0 errors) 8 of 8 (9 saved, 15 restored, 0 errors)
the same with --pipeline-windows 2 8 of 8 (9 saved, 15 restored, 0 errors) 8 of 8 (9 saved, 15 restored, 0 errors)
~16K-token conversation, later turns' median time to the first token, with / without checkpoints 0.378 s / 13.157 s 0.384 s / 13.387 s
turn 2 recalls turn 1's word: no fault; the worker killed between the turns; conversation X, then Y, then the worker killed, then X's turn 2; the main engine killed between the turns right in all 4 (turn 2 after 0.7 / 44.9 / 50.9 / 10.6 s) right in all 4 (0.7 / 45.0 / 50.9 / 10.3 s)
no --prompt-cache, exact flags: five greedy prompts on the split against #1748's head byte-identical byte-identical

Rebased onto 0.2.3 (2026-10-23)

This head is #1748's rebase onto main 5c8dd322 (v0.2.3, engine 0.1.48) plus this PR's six commits. Git stopped at
one conflict, in Options of generate.cpp: prompt_cache_explicit now sits next to upstream's new default
conversation_cache_mib = -1, which means "sized from the free RAM under --serve". A remote stage still sets
--conversation-cache-mib to 0 before that sizing, so on a remote stage the checkpoints stay the only prompt reuse.
No checkpoint code changed in the rebase.

Checked on this head (Windows, MSVC 19.44 + CUDA 13.0, -DSTRATA_BUILD_CONVERSATION_TESTS=ON):

check result
build (every target but hc_persist_parity) passed
stage_ckpt_store_test, stage_link_test, the 7 conversation tests passed
ctest overall 82 of 87 passed

The other 5 fail the same way on v0.2.3 itself in the same environment (see #1748).

GPU runs on this head (2026-10-23). The same two PCs and model as in Validation (the 2080 Ti main, the 3080
worker, 10 GbE, K=26, --max-context 131072), this head's build on both. In the older sections below, "this head"
means the 0.2.0-beta head (8ee568ff).

check 0.2.3 (this head) 0.2.0-beta (8ee568ff)
repeated turns with an edited front (--prompt-cache, exact flags): the same answer 8 of 8 (9 saved, 15 restored, 0 errors) 8 of 8
the same with --pipeline-windows 2 8 of 8 (9 saved, 15 restored, 0 errors) 8 of 8
~16K-token conversation, later turns' median time to the first token, with / without checkpoints 0.384 s / 13.387 s 0.382 s / 12.827 s
turn 2 recalls turn 1's word: no fault; the worker killed between the turns; conversation X, then Y, then the worker killed, then X's turn 2; the main engine killed between the turns right in all 4 (turn 2 after 0.7 / 45.0 / 50.9 / 10.3 s) right in all 4 (0.6 / 44.9 / 48.9 / 10.2 s)
no --prompt-cache, exact flags: five greedy prompts on the split against #1748's head byte-identical byte-identical

Validation

Revision: this head, 8ee568ff (#1748's a3e15682 plus six commits, on main e88ee39d) (the builds and tests below ran on it before a last wording fix in ENGINEERING.md; git diff outside
docs/ is empty). The upstream baseline for the
Python suites is e88ee39d itself, run the same way in the same environment.

Passed:

  • Windows 11, MSVC 2022 (19.44.35229) + CUDA 13.0.88, Ninja, Release, sm_86: cmake --build build --target strata stage_link_test stage_ckpt_store_test conv_cache_test draft_kv_plan_test split_ring_test message_boundary_test coupled_draft_test spec_prob_test bf16_bits_test batch_rows_test batch_groups_test conversation_cache_test conversation_validation_test, rc 0, strata.exe linked.

  • The same build, the CPU tests with CUDA_VISIBLE_DEVICES=-1, each rc 0: stage_link_test (all passed),
    stage_ckpt_store_test (all passed), conv_cache_test, draft_kv_plan_test, split_ring_test (23 checks),
    message_boundary_test (21), coupled_draft_test, spec_prob_test (72 cases), bf16_bits_test,
    batch_rows_test, batch_groups_test, conversation_cache_test (4772 checks), conversation_validation_test
    (1020 host-only checks; #1748's head: 972).

  • Linux (Ubuntu 24.04 container), GCC 13.3 + CUDA 13.0.88, sm_75 + sm_86, Ninja, Release, from a clean build
    directory: ninja strata stage_link_test stage_ckpt_store_test conversation_validation_test conversation_transfer_test, rc 0; with CUDA_VISIBLE_DEVICES=-1, stage_link_test and stage_ckpt_store_test
    pass, conversation_validation_test 1020 host-only checks and conversation_transfer_test 1908 pass.

  • g++ -std=c++20 -O2 -Wall -Wextra -c of src/net/stage_link.cpp, src/net/stage_link_test.cpp and
    src/net/stage_ckpt_store_test.cpp (GCC 13.3): no warning.

  • python -m unittest tools.test_stage_node on Linux (Python 3.12.3): 48 tests OK; python -m pytest tools/test_stage_node.py on Windows (Python 3.10.8, pytest 9.0.2): 48 passed.

  • python -m pytest serve on Windows (Python 3.10.8): 867 passed, 17 skipped (main e88ee39d: 864 passed, 17 skipped; the three more are #1748's server tests;
    this PR changes no Python file).

  • python -m pytest tools/test_setup_*.py on Windows: 681 passed, 2 skipped, and the same 22 failures as main
    (below).

  • GPUs, this head's Linux build on both PCs (protocol 6), #1748's head as the reference: the main process on an RTX
    2080 Ti 11 GB (PCIe 3.0 x16) + Ryzen 9 5900XT, the worker on an RTX 3080 10 GB + Ryzen 9 5900X, 10 GbE, Linux; an
    IQ3_S of Qwen3.8-Flash-Next, K=26, --prefill 5888, --max-context 131072. The replay is two chats of four turns
    on one shared system prompt of about 16,000 tokens, greedy; "exact flags" are --pcie-frac 0 --adapt-every 0 --adapt-swaps 0 on both PCs, --mtp-max-t 1 --suffix-draft 0 on the main, and STRATA_IQ_MT_MIN=1 STRATA_PREFILL_CPU_SHARE=0 on both.

    check result
    Every request sent twice, the next turn resuming through a checkpoint, exact flags, --prompt-cache 6 8 of 8 repeats byte-identical; 9 saves, 15 restores on both PCs; 0 "does not hold", 0 "did not store", 0 errors
    The same with --pipeline-windows 2 and STRATA_ROUTE_TAIL_SKIP=0 on the main 8 of 8; 9 saves, 15 restores, 0 errors; the main's log says the pipeline's VRAM is kept out of the expert cache
    Default path: no --prompt-cache, exact flags, five greedy prompts on the split, this head against #1748's head byte-identical (the same md5 as #1748's own split run in an earlier session that day)
    Every request sent twice, thinking on (300 tokens), exact flags, --prompt-cache 6 8 of 8 repeats byte-identical; 9 saves, 15 restores, 0 errors
    Every request first cancelled after 20 tokens, then sent again, and sent twice 8 of 8 repeats byte-identical, and 8 of 8 equal to the run without cancels; 9 saves, 23 restores, 0 errors
    Thinking on and cancellation, each with --pipeline-windows 2 (STRATA_ROUTE_TAIL_SKIP=0) 8 of 8 each; 9 saves and 15 / 23 restores, 0 errors (not compared with the runs without it: 2,636 cache slots against 2,884)
    Worker store emptied before each restore (STRATA_REMOTE_CKPT_DROP=1 on the worker), without and with --pipeline-windows 2 8 of 8 turns answered, 0 errors, in each: the one restore the replay asks for (the second chat's shared start) found nothing, "does not hold the checkpoint", and read from token 0 (13.2 s); 6 turns continued the live session
    Live continuations, 15 min, 100-2,500 new tokens a turn, served flags, --prompt-cache 6 (the worker's adaptive overlap off, #1748's default) 205 requests, 198 live continuations, 212 saves, 0 errors: 0 replies of !
    Picture chats (--vision on both PCs), exact flags: two pictures, two questions each, the second sent twice; the split with --prompt-cache 6, the split without it, and one 2080 Ti with checkpoints 4 saves, 2 restores, 2 live continuations, 0 errors; the re-sent turns byte-identical; all 6 answers equal one card's. Without checkpoints the split gave 4 of 6 equal (the shape question worded "The shape on the left is a red circle." against "The shape on the left of the image is a red circle.", twice)

    Time to the first token, the served flags, --think, 400 tokens, one server per arm (the first turn reads from 0
    in both):

    first turn, 16,079 tokens the 7 later turns later turns' median
    without --prompt-cache 13.18 s 12.61-12.90 s 12.83 s
    --prompt-cache 6 13.37 s 0.27-1.20 s 0.38 s

    Faults between two turns, on one held split (served flags, --prompt-cache 6, text only), the turn-2 question
    asking for a code word only turn 1 holds; #1748's agent restarting the worker:

    between the turns turn 2 earlier (0.1.43, "after")
    nothing right, after 0.6 s right
    the worker killed (kill -9) right, after 44.9 s 45.0 s
    chat X, then chat Y, the worker killed, X's second turn right, after 48.9 s 61.0 s
    the main engine killed right, after 10.2 s 12.6 s
    nothing, a picture chat (a second held split, --vision on both PCs) right, after 0.8 s, through a checkpoint restored on both sides right
    the worker killed, a picture chat (a checkpoint mounted) right, after 46.1 s: the main process connected again, found that the worker "holds no session or checkpoint", dropped the live session and 1 checkpoint and read from token 0 53.3 s

    No 400 in any of them.

Failed:

  • python -m pytest tools/test_setup_*.py on Windows (Python 3.10.8): 22 failures (test_setup_download's
    parallel download, two of test_setup_engine_hash's refusal tests, and 19 subtests of test_setup_golden).
    main e88ee39d fails the same 22 in the same environment, test for test; none touches a file of this branch.

Not run:

  • On GPUs on this head: the live-continuation load with the worker's adaptive overlap on (STRATA_ADAPT_OVERLAP=1,
    no longer the worker's default), and the "before" column of the fault table (the docs commit's build). The
    conflict resolutions around --prompt-cache-spread and STRATA_CKPT_POOL / STRATA_CKPT_THREADS are read from
    the code and covered by the CPU tests and the runs above only.
  • The HIP (ROCm) and SYCL builds on this head; the Metal build (no Mac).

Limits

  • What the check at a request's start does not cover: a worker PC that vanished without closing (power, cable) looks
    alive until TCP keepalive notices it, about a minute, and a request in that time finds the loss at its first
    message and ends the engine; a loss between the check and the request's first window is found at that window, and
    the engine ends; with a relay the check sees only the main process's own link, and a next worker that restarted
    while the main process was idle is found by the relay at the request's first message to it, an error that ends the
    engine (read from the code; relays were not run).
  • A CkptRestore's own fallback and the new ERR texts were not reached on GPUs (read from the code). A wrong answer
    without an error (a link made again at a request's positions, then the live session continued) was read from the
    code and not seen.
  • Mid-prompt checkpoints, parking and session files stay off with a remote stage.
  • The default path against #1748 at exact flags was one run of each build; --prompt-cache answers are not meant to
    equal a run without it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1887 **Author:** [@lask3802](https://github.com/lask3802) **Created:** 10/10/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `remote-stage-ckpt` --- ### 📝 Commits (10+) - [`6946676`](https://github.com/Niko1221/Strata/commit/6946676e5ed0d146ee8cd7f89b1f38e4bfbabc38) Remote stage: run the later layers of a layer split on another PC over TCP - [`2ba81af`](https://github.com/Niko1221/Strata/commit/2ba81af0392be9559a231357ba1426cccad7f528) Remote stage tools: a node agent, a layer shipper and a split tuner - [`5657d79`](https://github.com/Niko1221/Strata/commit/5657d7979185c6a41f062f01745d4230b573b70c) Remote stage docs and measurements: two and three PCs, two models - [`f6241ba`](https://github.com/Niko1221/Strata/commit/f6241ba8b6d599730129145d16a1bd2b632fcad4) stage_ship: pieces in flight at once; the agent checks each piece's sha256 - [`fecb3c7`](https://github.com/Niko1221/Strata/commit/fecb3c7ebe200a409f465135702673fe59e07831) Remote stage: follow 0.1.43's decode defaults on both PCs - [`9822a07`](https://github.com/Niko1221/Strata/commit/9822a07abb2b70635beda0bb77be94c8a869a3a5) Remote stage: images (--vision) - the worker's layers get the main's positions - [`6efea4a`](https://github.com/Niko1221/Strata/commit/6efea4a6b10f86b97856c2e549101483fe079090) Remote stage docs: images, and the checks after the rebase onto 0.1.43 - [`ef046e0`](https://github.com/Niko1221/Strata/commit/ef046e0b86d7ee3f78590d8c896ee6c1e5444d3d) Remote stage: a stuck worker ends as a stuck main process does; parking turned off, not refused - [`ae6634f`](https://github.com/Niko1221/Strata/commit/ae6634f8831ac5be3eeaff96fed68bb8a2219052) Remote stage: a worker's agent starts an ended worker again - [`8aeb39e`](https://github.com/Niko1221/Strata/commit/8aeb39e04903573db20f6d651249f5148a163afd) Remote stage: the main process connects again, a new main takes a silent worker over ### 📊 Changes **29 files changed** (+9889 additions, -325 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+16 -1) 📝 `docs/MULTI_GPU.md` (+14 -1) ➕ `docs/REMOTE_STAGE.md` (+608 -0) ➕ `docs/remote-stage/CHECKPOINTS.md` (+412 -0) ➕ `docs/remote-stage/ENGINEERING.md` (+836 -0) 📝 `include/strata/core/conversation_cache.hpp` (+3 -0) 📝 `include/strata/core/conversation_snapshot.hpp` (+7 -0) 📝 `include/strata/core/expert_source.hpp` (+12 -1) 📝 `include/strata/core/verify.hpp` (+42 -0) ➕ `include/strata/net/stage_ckpt_store.hpp` (+87 -0) ➕ `include/strata/net/stage_link.hpp` (+275 -0) 📝 `include/strata/prefill/prefill.hpp` (+28 -0) 📝 `metal/CMakeLists.txt` (+1 -1) 📝 `serve/server.py` (+21 -1) 📝 `serve/test_server.py` (+84 -1) 📝 `src/core/conversation_copy.hpp` (+1 -0) 📝 `src/core/conversation_state.cpp` (+51 -24) 📝 `src/core/conversation_validation_test.cpp` (+45 -0) 📝 `src/core/expert_source.cpp` (+58 -38) 📝 `src/core/verify.cpp` (+126 -12) _...and 9 more files_ </details> ### 📄 Description **Stacked on #1748.** The first nineteen commits are #1748's; this PR adds the last six: the feature, its docs, what #1748's recovery (the main process connecting again) needs from them, the `--pipeline-windows 2` case, and the notes of the rebase. Both PRs are on `main` 8183c6b6 (v0.2.4.1 and one docs commit, engine 0.1.49.1; see "Rebased onto 0.2.4.1" under Approach); the measurements below were taken on e88ee39d (0.2.0-beta). ## Problem and result With `--remote-stage`, every prompt was read from token 0. A conversation checkpoint holds only the running state of the process's own layers, so the main process could not restore the worker's. A chat client sends the whole conversation every turn, so every turn of a long chat waited for the whole prompt again: about 15 s at 16K tokens on the test pair below. With `--prompt-cache N` given **explicitly** on the main process, the worker keeps its layers' part of each checkpoint under an id the main process hands it, and the chain works as on one GPU at the prompt's synchronous cut points. On this head (0.2.0-beta), an RTX 2080 Ti main + RTX 3080 worker, the later turns' median time to the first token is 0.38 s with `--prompt-cache 6` against 12.83 s without (Validation). On an RTX 3080 + RTX 2080 Ti pair (engine 0.1.43, earlier heads), time to the first token at the served flags, thinking on, 400 tokens: | | #1748 (every prompt from 0) | This PR, `--prompt-cache 6` | |---|---|---| | First turn, 16,079 tokens | 15.00 s | 14.50 s | | The 7 later turns | 14.19-15.06 s | **0.32-0.44 s** | A turn read from 0 was 0.7-1.3 s slower with checkpoints on 0.1.41 and 0.1.42, and not slower in this run. The prompt is read in parts that end at its cut points, and a checkpoint is saved at each. With `--prompt-cache`, answers need not be byte-identical to a run without it, because the read order differs; the repeated-turn check is the exactness test. ### Measured on earlier heads Every check in this subsection ran again on this head with the cards swapped (Validation), except the "before" column of the fault table and the adaptive overlap on the worker (Not run). An RTX 3080 main (layers 0-25, the head, the drafter) and an RTX 2080 Ti worker (layers 26-47) over 10 GbE, RVN IQ3_S, Linux, engine 0.1.43; #1748's build is the base. The replay is two chats of four turns on one shared system prompt of about 16,000 tokens, greedy. Exact flags: `--pcie-frac 0 --adapt-every 0 --adapt-swaps 0` on both PCs, `--mtp-max-t 1 --suffix-draft 0` on the main, and `STRATA_IQ_MT_MIN=1 STRATA_PREFILL_CPU_SHARE=0` on both. | Check | Result | |---|---| | Default path (no `--prompt-cache`, exact flags) vs #1748, one run of each | 8 of 8 byte-identical | | Every request sent twice, the next turn resuming through a checkpoint (exact flags) | 8 of 8 repeats byte-identical; with thinking on, 8 of 8; with each request first cancelled mid-decode, 8 of 8, and equal to the run without cancels. 53 restores on both PCs, 0 errors | | Worker store emptied before each restore | the request reads from token 0 and finishes | | Picture chats (`--vision` on both PCs): two turns, the second sent twice | the second turn resumed through a checkpoint or continued the live session; the re-sent turn byte-identical; all 6 answers equal those of a run without `--prompt-cache` | | Live continuations with the worker's adaptive tier on, 15 min, 100-2,500 new tokens a turn | 165 requests, 158 live continuations (97 reading 1,000+ tokens): 0 replies of `!`. Without the settle, on an earlier build with the same load: about 4 in 10 | In these runs the worker's adaptive overlap was on (#1748's build then followed upstream's default on the worker too). #1748 has since made it opt-in on a worker (`STRATA_ADAPT_OVERLAP=1`), since it measured no faster there; a worker without it takes the path of the 0.1.42 runs, where the same live-continuation check gave 161 requests and 0 replies of `!`. The same checks on 0.1.41 and 0.1.42 gave the same results: 8 of 8 on each repeated-turn line, 53 restores, no `!` reply, and later turns in 0.28-0.54 s. On 0.1.42 the default path against #1748 did not repeat from run to run (8 of 8 in 2 of 6 pairs), as 0.1.42 did not on one GPU either; on 0.1.43 it did. With `--pipeline-windows 2` on the main process (same PCs and model, exact flags, `--expert-cache 1951`, `STRATA_ROUTE_TAIL_SKIP=0` on the main process): repeated turns 8 of 8 byte-identical with 15 restores on both sides and 0 errors, the same with thinking on and with cancellation; a forced restore miss (`STRATA_REMOTE_CKPT_DROP=1`) read from 0 and finished. The numbers are in `docs/remote-stage/CHECKPOINTS.md`. **Faults between two turns.** On the same pair with this branch's build, #1748's agent and server, `--prompt-cache 6` and pictures allowed (served flags). Each conversation's second turn asks for something only its first turn holds (a code word, or the first word of the previous answer), greedy. The worker was killed with SIGKILL between the turns, and its agent started it again. "Before" is the docs commit; "after" is the reconnect commit ("checkpoints and the live session after a reconnect") before its worker-error texts and take-over check, which none of these runs reach. | Between the turns | Before | After | |---|---|---| | Nothing (text; picture) | both right | both right | | The worker killed (text, the live session continued) | 503 "remote stage: the peer closed the connection"; the engine restarted | right, after 45.0 s (the worker's restart and load); the engine kept | | The worker killed (picture, a checkpoint mounted) | 400 "restoring a conversation checkpoint failed: remote stage: send failed: Broken pipe"; the engine restarted | right, after 53.3 s (the word, then more text than the one word asked for) | | Chat X, then chat Y, the worker killed, X's second turn (the checkpoint of their shared start) | 503; the engine restarted | right, after 61.0 s | | The main engine killed (text) | right, after 11.8 s | right, after 12.6 s | The same session on 0.1.43.1 gave every second turn right (worker killed: 45.2 s text, 52.2 s picture, 61.1 s another chat's checkpoint; main engine killed: 38.1 s), and again on top of #1748's open-points commit (45.1 / 52.1 / 61.0 s; 11.8 s). ## Related discussion - This PR was open before the 0.2.0-beta reset (closed with every open PR on 2026-10-19); this is the same branch rebased onto `main` e88ee39d on top of #1748's rebase. No maintainer agreement on scope yet. - #1748 (the remote stage) is its base; this PR changes nothing for a remote stage without `--prompt-cache`. ## Approach - **Protocol 5 -> 6.** New messages `CkptSave` / `CkptRestore` carry an id, a position and the list of ids to keep, and `Reset` carries that list too. - **Retention.** Only the main process decides what is kept; the worker prunes when an operation succeeds. The main process works out the chain a new checkpoint leaves before the worker stores its part, with the same eviction it applies after (`--prompt-cache-spread` included), so both PCs drop the same checkpoint. - **Limits at the hello.** The worker refuses more than 64 parts, or more parts than fit in half of its available RAM, or any part when it cannot read its RAM (as the engine's own RAM guard refuses parking then). A main process that takes a worker over (#1748) is held to the same limits as one that connects to a free worker. Checkpoint lists are bounded (at most `kStageCkptMax` ids, checked before the read). - **Disconnect.** The worker clears its store. - **Errors.** A checkpoint the worker does not hold makes the request read from token 0; a lost link at a request's start is made again (below); any other error ends the engine as before. When the error is the link's or the worker's, the `ERR` line starts with it, so the server answers 503 with Retry-After, not 400. A failed image position table (#1748's `Positions`) outlives a `CkptRestore` as it outlives a `Reset`, because it belongs to the request being started. - **After a reconnect.** The worker the main process reaches after connecting again (a restarted worker, or a take-over) holds no session and no checkpoint. So at each request's start the main process checks the idle link with nothing sent (`StageClient::alive`: a 0 ms poll, then a 1-byte peek; the worker never sends unasked) and connects again there if it is lost. Whenever the link is made again in a request (that check, its positions, its Reset, its `CkptRestore`), the main process drops its live session and every checkpoint, and the request reads from token 0 with a Reset that keeps nothing. A reconnect cancelled at these request-start paths ends that request, and the engine stays. - **A live continuation settles the worker first.** A request that continues the live session waits for the worker's last Commit and for the adaptive tier's swaps in flight before it lends cache slots to the prompt (`hs.prefill`), as a Reset and a restore do. Without that, a loan could hand the prompt path slots that a swap was still writing, and the reply degenerated into `!`. - **`--pipeline-windows 2`.** No checkpoint is saved, and the live session is not continued, after a pipelined drain that failed. **Following upstream.** The rebase onto 0.2.0-beta met upstream's checkpoint chain changes: `--prompt-cache-spread` (its eviction now goes through the same function on both of the main process's paths, above), and `STRATA_CKPT_POOL` / `STRATA_CKPT_THREADS`, which act on the main process's own part only (a remote main has no in-process stage; the worker keeps its part by id). 0.1.44's Metal backend hands the checkpoint save and restore to its decode window; the range-taking overloads this branch adds stay on the session's buffers, and a remote stage is refused on Metal (#1748). Upstream's `copy_checkpoint_beating` (the parked conversation's copies, #2049) copies a checkpoint's `remote_id` too. Details: `docs/remote-stage/CHECKPOINTS.md`, "After the rebase onto 0.2.0-beta". **What it leaves alone.** - **The default path.** Without `--prompt-cache`, a remote main keeps `prompt_cache` at 0: no new message is sent, the prompt is not split, and a Reset is the same header-only message. One-GPU and in-process splits see two mechanical refactors only (the eviction loop and the zero-and-reset at request start moved into lambdas, the same calls in the same order). On one GPU with the conversation cache, upstream `main`'s, #1748's and this branch's builds gave byte-identical answers on 0.1.42; that was not run again since. - Mid-prompt checkpoints (`--prompt-cache-every`, `--prompt-cache-tail`) and parking (`--conversation-cache-mib`) stay off with a remote stage; session files are refused. A config with `--conversation-cache-mib` starts, and the main process says in its log that parking is off. - A worker's `CkptSave` and `CkptRestore` are watched by the engine's stall watchdog as its other messages are. - The hello says protocol 6, so a main and a worker must both run this version, with or without checkpoints. - The check at a request's start sends nothing, so the default path's messages do not change. - A relay (three PCs) forwards the new messages, and it links its next worker again after each main process's hello, so the next worker checks the real ckpt_max (read from the code and unit-tested, not run on GPUs). Files: `include/strata/net/stage_ckpt_store.hpp` and `src/net/stage_ckpt_store_test.cpp` (new: the worker's store), `include/strata/net/stage_link.hpp` and `src/net/stage_link.cpp` (the messages), `src/net/stage_link_test.cpp`, `src/program/generate.cpp` (the main process's chain and the worker's side), `include/strata/core/verify.hpp` (a comment), `src/core/conversation_state.cpp`, `conversation_copy.hpp`, `conversation_cache.hpp`, `conversation_snapshot.hpp` (a checkpoint for a layer range and its `remote_id`), `src/core/conversation_validation_test.cpp`, `CMakeLists.txt`, and the docs (`docs/remote-stage/CHECKPOINTS.md`, new; `docs/REMOTE_STAGE.md`, `docs/remote-stage/ENGINEERING.md`). ### Rebased onto 0.2.4.1 (2026-10-24) This head is #1748's rebase onto `main` 8183c6b6 (v0.2.4.1 and one docs commit, engine 0.1.49.1) plus this PR's six commits. The rebase applied with no conflicts, and `git range-diff` against the 0.2.3 head (8ef01676) shows every commit as the same patch. Checked on this head (Linux, the build of the runs below): the build, `stage_ckpt_store_test`, `stage_link_test` and five CPU tests (`conv_cache_test`, `spec_prob_test`, `batch_rows_test`, `conversation_validation_test`, `conversation_transfer_test`) passed. **Not run on this head:** the Windows build and ctest. **GPU runs on this head (2026-10-24).** The same two PCs, model and runs as in the 0.2.3 section below (the 2080 Ti main, the 3080 worker, 10 GbE, K=26, `--max-context 131072`), this head's build on both. The CI container on the main PC's host used 0 cores during every run. In the 0.2.3 section below, "this head" means the 0.2.3 head (8ef01676). | check | 0.2.4.1 (this head) | 0.2.3 (8ef01676) | |---|---|---| | repeated turns with an edited front (`--prompt-cache`, exact flags): the same answer | 8 of 8 (9 saved, 15 restored, 0 errors) | 8 of 8 (9 saved, 15 restored, 0 errors) | | the same with `--pipeline-windows 2` | 8 of 8 (9 saved, 15 restored, 0 errors) | 8 of 8 (9 saved, 15 restored, 0 errors) | | ~16K-token conversation, later turns' median time to the first token, with / without checkpoints | 0.378 s / 13.157 s | 0.384 s / 13.387 s | | turn 2 recalls turn 1's word: no fault; the worker killed between the turns; conversation X, then Y, then the worker killed, then X's turn 2; the main engine killed between the turns | right in all 4 (turn 2 after 0.7 / 44.9 / 50.9 / 10.6 s) | right in all 4 (0.7 / 45.0 / 50.9 / 10.3 s) | | no `--prompt-cache`, exact flags: five greedy prompts on the split against #1748's head | byte-identical | byte-identical | ### Rebased onto 0.2.3 (2026-10-23) This head is #1748's rebase onto `main` 5c8dd322 (v0.2.3, engine 0.1.48) plus this PR's six commits. Git stopped at one conflict, in `Options` of generate.cpp: `prompt_cache_explicit` now sits next to upstream's new default `conversation_cache_mib = -1`, which means "sized from the free RAM under `--serve`". A remote stage still sets `--conversation-cache-mib` to 0 before that sizing, so on a remote stage the checkpoints stay the only prompt reuse. No checkpoint code changed in the rebase. Checked on this head (Windows, MSVC 19.44 + CUDA 13.0, `-DSTRATA_BUILD_CONVERSATION_TESTS=ON`): | check | result | |---|---| | build (every target but `hc_persist_parity`) | passed | | `stage_ckpt_store_test`, `stage_link_test`, the 7 conversation tests | passed | | ctest overall | 82 of 87 passed | The other 5 fail the same way on v0.2.3 itself in the same environment (see #1748). **GPU runs on this head (2026-10-23).** The same two PCs and model as in Validation (the 2080 Ti main, the 3080 worker, 10 GbE, K=26, `--max-context 131072`), this head's build on both. In the older sections below, "this head" means the 0.2.0-beta head (8ee568ff). | check | 0.2.3 (this head) | 0.2.0-beta (8ee568ff) | |---|---|---| | repeated turns with an edited front (`--prompt-cache`, exact flags): the same answer | 8 of 8 (9 saved, 15 restored, 0 errors) | 8 of 8 | | the same with `--pipeline-windows 2` | 8 of 8 (9 saved, 15 restored, 0 errors) | 8 of 8 | | ~16K-token conversation, later turns' median time to the first token, with / without checkpoints | 0.384 s / 13.387 s | 0.382 s / 12.827 s | | turn 2 recalls turn 1's word: no fault; the worker killed between the turns; conversation X, then Y, then the worker killed, then X's turn 2; the main engine killed between the turns | right in all 4 (turn 2 after 0.7 / 45.0 / 50.9 / 10.3 s) | right in all 4 (0.6 / 44.9 / 48.9 / 10.2 s) | | no `--prompt-cache`, exact flags: five greedy prompts on the split against #1748's head | byte-identical | byte-identical | ## Validation Revision: this head, 8ee568ff (#1748's a3e15682 plus six commits, on `main` e88ee39d) (the builds and tests below ran on it before a last wording fix in ENGINEERING.md; `git diff` outside `docs/` is empty). The upstream baseline for the Python suites is e88ee39d itself, run the same way in the same environment. **Passed:** - Windows 11, MSVC 2022 (19.44.35229) + CUDA 13.0.88, Ninja, Release, sm_86: `cmake --build build --target strata stage_link_test stage_ckpt_store_test conv_cache_test draft_kv_plan_test split_ring_test message_boundary_test coupled_draft_test spec_prob_test bf16_bits_test batch_rows_test batch_groups_test conversation_cache_test conversation_validation_test`, rc 0, `strata.exe` linked. - The same build, the CPU tests with `CUDA_VISIBLE_DEVICES=-1`, each rc 0: `stage_link_test` (all passed), `stage_ckpt_store_test` (all passed), `conv_cache_test`, `draft_kv_plan_test`, `split_ring_test` (23 checks), `message_boundary_test` (21), `coupled_draft_test`, `spec_prob_test` (72 cases), `bf16_bits_test`, `batch_rows_test`, `batch_groups_test`, `conversation_cache_test` (4772 checks), `conversation_validation_test` (1020 host-only checks; #1748's head: 972). - Linux (Ubuntu 24.04 container), GCC 13.3 + CUDA 13.0.88, sm_75 + sm_86, Ninja, Release, from a clean build directory: `ninja strata stage_link_test stage_ckpt_store_test conversation_validation_test conversation_transfer_test`, rc 0; with `CUDA_VISIBLE_DEVICES=-1`, `stage_link_test` and `stage_ckpt_store_test` pass, `conversation_validation_test` 1020 host-only checks and `conversation_transfer_test` 1908 pass. - `g++ -std=c++20 -O2 -Wall -Wextra -c` of `src/net/stage_link.cpp`, `src/net/stage_link_test.cpp` and `src/net/stage_ckpt_store_test.cpp` (GCC 13.3): no warning. - `python -m unittest tools.test_stage_node` on Linux (Python 3.12.3): 48 tests OK; `python -m pytest tools/test_stage_node.py` on Windows (Python 3.10.8, pytest 9.0.2): 48 passed. - `python -m pytest serve` on Windows (Python 3.10.8): 867 passed, 17 skipped (`main` e88ee39d: 864 passed, 17 skipped; the three more are #1748's server tests; this PR changes no Python file). - `python -m pytest tools/test_setup_*.py` on Windows: 681 passed, 2 skipped, and the same 22 failures as `main` (below). - GPUs, this head's Linux build on both PCs (protocol 6), #1748's head as the reference: the main process on an RTX 2080 Ti 11 GB (PCIe 3.0 x16) + Ryzen 9 5900XT, the worker on an RTX 3080 10 GB + Ryzen 9 5900X, 10 GbE, Linux; an IQ3_S of Qwen3.8-Flash-Next, K=26, `--prefill 5888`, `--max-context 131072`. The replay is two chats of four turns on one shared system prompt of about 16,000 tokens, greedy; "exact flags" are `--pcie-frac 0 --adapt-every 0 --adapt-swaps 0` on both PCs, `--mtp-max-t 1 --suffix-draft 0` on the main, and `STRATA_IQ_MT_MIN=1 STRATA_PREFILL_CPU_SHARE=0` on both. | check | result | |---|---| | Every request sent twice, the next turn resuming through a checkpoint, exact flags, `--prompt-cache 6` | 8 of 8 repeats byte-identical; 9 saves, 15 restores on both PCs; 0 "does not hold", 0 "did not store", 0 errors | | The same with `--pipeline-windows 2` and `STRATA_ROUTE_TAIL_SKIP=0` on the main | 8 of 8; 9 saves, 15 restores, 0 errors; the main's log says the pipeline's VRAM is kept out of the expert cache | | Default path: no `--prompt-cache`, exact flags, five greedy prompts on the split, this head against #1748's head | byte-identical (the same md5 as #1748's own split run in an earlier session that day) | | Every request sent twice, thinking on (300 tokens), exact flags, `--prompt-cache 6` | 8 of 8 repeats byte-identical; 9 saves, 15 restores, 0 errors | | Every request first cancelled after 20 tokens, then sent again, and sent twice | 8 of 8 repeats byte-identical, and 8 of 8 equal to the run without cancels; 9 saves, 23 restores, 0 errors | | Thinking on and cancellation, each with `--pipeline-windows 2` (`STRATA_ROUTE_TAIL_SKIP=0`) | 8 of 8 each; 9 saves and 15 / 23 restores, 0 errors (not compared with the runs without it: 2,636 cache slots against 2,884) | | Worker store emptied before each restore (`STRATA_REMOTE_CKPT_DROP=1` on the worker), without and with `--pipeline-windows 2` | 8 of 8 turns answered, 0 errors, in each: the one restore the replay asks for (the second chat's shared start) found nothing, "does not hold the checkpoint", and read from token 0 (13.2 s); 6 turns continued the live session | | Live continuations, 15 min, 100-2,500 new tokens a turn, served flags, `--prompt-cache 6` (the worker's adaptive overlap off, #1748's default) | 205 requests, 198 live continuations, 212 saves, 0 errors: 0 replies of `!` | | Picture chats (`--vision` on both PCs), exact flags: two pictures, two questions each, the second sent twice; the split with `--prompt-cache 6`, the split without it, and one 2080 Ti | with checkpoints 4 saves, 2 restores, 2 live continuations, 0 errors; the re-sent turns byte-identical; all 6 answers equal one card's. Without checkpoints the split gave 4 of 6 equal (the shape question worded "The shape on the left is a red circle." against "The shape on the left of the image is a red circle.", twice) | Time to the first token, the served flags, `--think`, 400 tokens, one server per arm (the first turn reads from 0 in both): | | first turn, 16,079 tokens | the 7 later turns | later turns' median | |---|---|---|---| | without `--prompt-cache` | 13.18 s | 12.61-12.90 s | 12.83 s | | `--prompt-cache 6` | 13.37 s | 0.27-1.20 s | **0.38 s** | Faults between two turns, on one held split (served flags, `--prompt-cache 6`, text only), the turn-2 question asking for a code word only turn 1 holds; #1748's agent restarting the worker: | between the turns | turn 2 | earlier (0.1.43, "after") | |---|---|---| | nothing | right, after 0.6 s | right | | the worker killed (`kill -9`) | right, after 44.9 s | 45.0 s | | chat X, then chat Y, the worker killed, X's second turn | right, after 48.9 s | 61.0 s | | the main engine killed | right, after 10.2 s | 12.6 s | | nothing, a picture chat (a second held split, `--vision` on both PCs) | right, after 0.8 s, through a checkpoint restored on both sides | right | | the worker killed, a picture chat (a checkpoint mounted) | right, after 46.1 s: the main process connected again, found that the worker "holds no session or checkpoint", dropped the live session and 1 checkpoint and read from token 0 | 53.3 s | No 400 in any of them. **Failed:** - `python -m pytest tools/test_setup_*.py` on Windows (Python 3.10.8): 22 failures (`test_setup_download`'s parallel download, two of `test_setup_engine_hash`'s refusal tests, and 19 subtests of `test_setup_golden`). `main` e88ee39d fails the same 22 in the same environment, test for test; none touches a file of this branch. **Not run:** - On GPUs on this head: the live-continuation load with the worker's adaptive overlap on (`STRATA_ADAPT_OVERLAP=1`, no longer the worker's default), and the "before" column of the fault table (the docs commit's build). The conflict resolutions around `--prompt-cache-spread` and `STRATA_CKPT_POOL` / `STRATA_CKPT_THREADS` are read from the code and covered by the CPU tests and the runs above only. - The HIP (ROCm) and SYCL builds on this head; the Metal build (no Mac). ## Limits - What the check at a request's start does not cover: a worker PC that vanished without closing (power, cable) looks alive until TCP keepalive notices it, about a minute, and a request in that time finds the loss at its first message and ends the engine; a loss between the check and the request's first window is found at that window, and the engine ends; with a relay the check sees only the main process's own link, and a next worker that restarted while the main process was idle is found by the relay at the request's first message to it, an error that ends the engine (read from the code; relays were not run). - A `CkptRestore`'s own fallback and the new `ERR` texts were not reached on GPUs (read from the code). A wrong answer without an error (a link made again at a request's positions, then the live session continued) was read from the code and not seen. - Mid-prompt checkpoints, parking and session files stay off with a remote stage. - The default path against #1748 at exact flags was one run of each build; `--prompt-cache` answers are not meant to equal a run without it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:30:24 +07:00
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#3737
No description provided.