[PR #2240] Remote stage: a worker for the SYCL build (Intel Arc), stacked on #1748 / #1887 (protocol 7); STRATA_LOGPOS_IDS for cross-engine KL #3944

Open
opened 2026-11-07 15:31:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2240
Author: @YukihiroHemmi
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: remote-stage


📝 Commits (10+)

  • cc6f1c9 Remote stage: run the later layers of a layer split on another PC over TCP
  • ab4bc33 Remote stage tools: a node agent, a layer shipper and a split tuner
  • 02d1cdf Remote stage docs and measurements: two and three PCs, two models
  • 24cbe2d stage_ship: pieces in flight at once; the agent checks each piece's sha256
  • dd4147f Remote stage: follow 0.1.43's decode defaults on both PCs
  • e60bd8a Remote stage: images (--vision) - the worker's layers get the main's positions
  • b454037 Remote stage docs: images, and the checks after the rebase onto 0.1.43
  • 758cbec Remote stage: a stuck worker ends as a stuck main process does; parking turned off, not refused
  • 9793561 Remote stage: a worker's agent starts an ended worker again
  • ae00e38 Remote stage: the main process connects again, a new main takes a silent worker over

📊 Changes

39 files changed (+11868 additions, -469 deletions)

View changed files

📝 CMakeLists.txt (+20 -1)
📝 docs/INTEL.md (+37 -0)
📝 docs/MULTI_GPU.md (+14 -1)
➕ docs/REMOTE_STAGE.md (+846 -0)
➕ docs/remote-stage/CHECKPOINTS.md (+390 -0)
➕ docs/remote-stage/ENGINEERING.md (+846 -0)
📝 include/strata/core/conversation_cache.hpp (+3 -0)
📝 include/strata/core/conversation_snapshot.hpp (+7 -0)
📝 include/strata/core/expert_source.hpp (+10 -1)
➕ include/strata/core/logpos_ids.hpp (+205 -0)
📝 include/strata/core/verify.hpp (+43 -0)
➕ include/strata/net/stage_ckpt_store.hpp (+87 -0)
➕ include/strata/net/stage_link.hpp (+320 -0)
📝 include/strata/prefill/prefill.hpp (+28 -0)
📝 serve/server.py (+21 -1)
📝 serve/test_server.py (+84 -1)
📝 src/core/conversation_copy.hpp (+1 -0)
📝 src/core/conversation_state.cpp (+50 -24)
📝 src/core/conversation_validation_test.cpp (+45 -0)
📝 src/core/expert_source.cpp (+47 -31)

...and 19 more files

📄 Description

Stacked on lask3802's remote-stage-rowfmt (618d8f99: #1748 with 5c454ed6 and --pipeline-windows 2 on a remote main, #1887's conversation checkpoints, the row_formats hello, protocol 7), unchanged. Rebased onto it on 2026-10-14; the branch before that is tagged remote-stage-v5-cc7af052 in this fork (its own bf16 opt-in, STRATA_STAGE_ROWS_BF16, is dropped in favour of STRATA_REMOTE_ROWS). This adds a worker for the SYCL build (Intel Arc) and two measurement-only environment variables. Nothing changes unless --stage-worker is given to the SYCL build, or STRATA_LOGPOS_IDS / STRATA_LOGPOS_SPLIT_AT are set.

What it changes

  • sycl/src/program/generate.cpp: the SYCL engine can run as the last stage worker (--serve --stage-worker PORT --stage-begin K --stream-experts): layers [K, 48) with all their experts in VRAM (read from the GGUF; it stops at start with the count if they do not fit), its own dense weights and session, no head, MTP, PLE table or embedding table. The main process (and any relay) is the CUDA or HIP build. On protocol 7 it keeps its layers' part of the conversation checkpoints (reset(keep), CkptSave / CkptRestore, kStageCkptMax, stage_ckpt_ram_ok) as the CUDA/HIP last worker does, and reads and sends whatever row format the main process asks for (serve_stage lists every format; stage_link.cpp converts). A relay worker, --remote-stage, --vision, --mtp and --pipeline-windows are refused at start on the SYCL build. The SYCL Verifier gets set_no_head, GgufExpertSource gets set_layer_range, sycl/src/core/conversation_state.cpp gets the explicit-length checkpoint save/restore that #1887 added to src/core.
  • include/strata/core/logpos_ids.hpp (new, shared): STRATA_LOGPOS_IDS=<baseline dump> makes STRATA_LOGPOS also write the log-probabilities of the baseline's top-k ids at each position, so two engines' distributions can be compared by KL without the ids drifting out of the top-k; STRATA_LOGPOS_SPLIT_AT=N reads [0, N) of a prompt as chunks and the rest as windows (both trees). Off by default; src/core/logpos_ids_test.cpp covers the header.
  • Docs: docs/REMOTE_STAGE.md (an "Intel Arc as a worker" section and the measurements below), docs/INTEL.md (a note).

What it leaves alone

Every CUDA/HIP source of the base except the one-line logpos::write_ids call in src/core/verify.cpp and the STRATA_LOGPOS_SPLIT_AT branch in src/program/generate.cpp; both are inert without the variable. No defaults change.

Checks

  • stage_link_test, stage_ckpt_store_test and logpos_ids_test pass on the CUDA (sm_89, sm_120), HIP (gfx1100, ROCm 7.10) and SYCL (bmg-g31) builds of this branch.
  • Before the rebase: builds of 4bbcb16e and of this branch, started without the new options, wrote byte-identical STRATA_LOGPOS dumps for both the CUDA engine (4070) and the SYCL engine (B70).

Measured

2026-10-14, this branch, four GPUs on three PCs over 2.5 GbE (main RTX 5070 Ti layers 0-10 → HIP relay RX 7900 XT 11-22 → CUDA relay RTX 4070 23-29 → SYCL last worker Arc Pro B70 30-47), OrcaRouter Q4_K_S, served settings (--max-context 262144 --kv-resident 32768 --prefill 2048):

build and flags decode tok/s 1K prompt 4K prompt
before the rebase (protocol 5, our bf16 opt-in) 58.9-78.8 437 849
this branch, STRATA_REMOTE_ROWS=bf16 59.4-80.4 439 850
this branch, bf16, --pipeline-windows 2 53.6-74.1 441 851
  • KL against the 5070 Ti alone (5 texts, 1,363 positions): 0.0169, argmax 93.0% (0.0170 with our earlier bf16, 0.0179 with fp32).
  • Checkpoints through the SYCL last stage (--prompt-cache 6): two 4-turn chats on a 30,783-token shared system prompt, sent twice: time to first token 27.4-30.5 s for every request without checkpoints, 0.25-2.6 s with them (after the first); 15 restores on both sides, 0 errors; at exact flags 8 of 8 repeats byte-identical.

Earlier (2026-10-13, before the rebase): one PC, loopback (4070 main, B70 worker, IQ2_XS, K=12): decode 73-109 tok/s vs 44-74 on the B70 alone, KL 0.135 against the B70 alone with a backend floor of 0.152. Two PCs (5070 Ti main, B70 worker, IQ3_XXS, K=23): decode 78-108 vs 81-104 on the 5070 Ti alone, KL 0.015.

Not run: HIP as the main process, a relay through a SYCL worker, images, Windows builds of this branch. Raw data and the measurement scripts (kl_run.py, kl_check.py, speed_bench.py) are available on request.

YukihiroHemmi@🐜


🔄 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/2240 **Author:** [@YukihiroHemmi](https://github.com/YukihiroHemmi) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `remote-stage` --- ### 📝 Commits (10+) - [`cc6f1c9`](https://github.com/Niko1221/Strata/commit/cc6f1c9234064be8427d40418d21edb22744646c) Remote stage: run the later layers of a layer split on another PC over TCP - [`ab4bc33`](https://github.com/Niko1221/Strata/commit/ab4bc33a1062bf40d521396986b5b47375b38938) Remote stage tools: a node agent, a layer shipper and a split tuner - [`02d1cdf`](https://github.com/Niko1221/Strata/commit/02d1cdfea25b86f1df9399dff3837609d423bb1d) Remote stage docs and measurements: two and three PCs, two models - [`24cbe2d`](https://github.com/Niko1221/Strata/commit/24cbe2de4db9b63cf408b398da02e87d039c9ef4) stage_ship: pieces in flight at once; the agent checks each piece's sha256 - [`dd4147f`](https://github.com/Niko1221/Strata/commit/dd4147fc16ca1c85c1e54bcb2b3e6f190cc35ceb) Remote stage: follow 0.1.43's decode defaults on both PCs - [`e60bd8a`](https://github.com/Niko1221/Strata/commit/e60bd8a4f20313bbebe95f5c00794f8e4c439035) Remote stage: images (--vision) - the worker's layers get the main's positions - [`b454037`](https://github.com/Niko1221/Strata/commit/b454037320a37ace5ed74de18a437ea72fd80b72) Remote stage docs: images, and the checks after the rebase onto 0.1.43 - [`758cbec`](https://github.com/Niko1221/Strata/commit/758cbecc74d0009f85c06652b325c2c31de8c0cd) Remote stage: a stuck worker ends as a stuck main process does; parking turned off, not refused - [`9793561`](https://github.com/Niko1221/Strata/commit/9793561889fd6aaf73b5fa311e434f81f16920c3) Remote stage: a worker's agent starts an ended worker again - [`ae00e38`](https://github.com/Niko1221/Strata/commit/ae00e3867f98f458221caf6dcccfce3b4d2d0d44) Remote stage: the main process connects again, a new main takes a silent worker over ### 📊 Changes **39 files changed** (+11868 additions, -469 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+20 -1) 📝 `docs/INTEL.md` (+37 -0) 📝 `docs/MULTI_GPU.md` (+14 -1) ➕ `docs/REMOTE_STAGE.md` (+846 -0) ➕ `docs/remote-stage/CHECKPOINTS.md` (+390 -0) ➕ `docs/remote-stage/ENGINEERING.md` (+846 -0) 📝 `include/strata/core/conversation_cache.hpp` (+3 -0) 📝 `include/strata/core/conversation_snapshot.hpp` (+7 -0) 📝 `include/strata/core/expert_source.hpp` (+10 -1) ➕ `include/strata/core/logpos_ids.hpp` (+205 -0) 📝 `include/strata/core/verify.hpp` (+43 -0) ➕ `include/strata/net/stage_ckpt_store.hpp` (+87 -0) ➕ `include/strata/net/stage_link.hpp` (+320 -0) 📝 `include/strata/prefill/prefill.hpp` (+28 -0) 📝 `serve/server.py` (+21 -1) 📝 `serve/test_server.py` (+84 -1) 📝 `src/core/conversation_copy.hpp` (+1 -0) 📝 `src/core/conversation_state.cpp` (+50 -24) 📝 `src/core/conversation_validation_test.cpp` (+45 -0) 📝 `src/core/expert_source.cpp` (+47 -31) _...and 19 more files_ </details> ### 📄 Description Stacked on lask3802's `remote-stage-rowfmt` (618d8f99: #1748 with 5c454ed6 and `--pipeline-windows 2` on a remote main, #1887's conversation checkpoints, the `row_formats` hello, protocol 7), unchanged. Rebased onto it on 2026-10-14; the branch before that is tagged `remote-stage-v5-cc7af052` in this fork (its own bf16 opt-in, `STRATA_STAGE_ROWS_BF16`, is dropped in favour of `STRATA_REMOTE_ROWS`). This adds a **worker for the SYCL build** (Intel Arc) and two measurement-only environment variables. Nothing changes unless `--stage-worker` is given to the SYCL build, or `STRATA_LOGPOS_IDS` / `STRATA_LOGPOS_SPLIT_AT` are set. ## What it changes - **`sycl/src/program/generate.cpp`**: the SYCL engine can run as the last stage worker (`--serve --stage-worker PORT --stage-begin K --stream-experts`): layers [K, 48) with all their experts in VRAM (read from the GGUF; it stops at start with the count if they do not fit), its own dense weights and session, no head, MTP, PLE table or embedding table. The main process (and any relay) is the CUDA or HIP build. On protocol 7 it keeps its layers' part of the conversation checkpoints (`reset(keep)`, `CkptSave` / `CkptRestore`, `kStageCkptMax`, `stage_ckpt_ram_ok`) as the CUDA/HIP last worker does, and reads and sends whatever row format the main process asks for (`serve_stage` lists every format; `stage_link.cpp` converts). A relay worker, `--remote-stage`, `--vision`, `--mtp` and `--pipeline-windows` are refused at start on the SYCL build. The SYCL `Verifier` gets `set_no_head`, `GgufExpertSource` gets `set_layer_range`, `sycl/src/core/conversation_state.cpp` gets the explicit-length checkpoint save/restore that #1887 added to `src/core`. - **`include/strata/core/logpos_ids.hpp`** (new, shared): `STRATA_LOGPOS_IDS=<baseline dump>` makes `STRATA_LOGPOS` also write the log-probabilities of the baseline's top-k ids at each position, so two engines' distributions can be compared by KL without the ids drifting out of the top-k; `STRATA_LOGPOS_SPLIT_AT=N` reads [0, N) of a prompt as chunks and the rest as windows (both trees). Off by default; `src/core/logpos_ids_test.cpp` covers the header. - **Docs**: `docs/REMOTE_STAGE.md` (an "Intel Arc as a worker" section and the measurements below), `docs/INTEL.md` (a note). ## What it leaves alone Every CUDA/HIP source of the base except the one-line `logpos::write_ids` call in `src/core/verify.cpp` and the `STRATA_LOGPOS_SPLIT_AT` branch in `src/program/generate.cpp`; both are inert without the variable. No defaults change. ## Checks - `stage_link_test`, `stage_ckpt_store_test` and `logpos_ids_test` pass on the CUDA (sm_89, sm_120), HIP (gfx1100, ROCm 7.10) and SYCL (bmg-g31) builds of this branch. - Before the rebase: builds of 4bbcb16e and of this branch, started without the new options, wrote byte-identical `STRATA_LOGPOS` dumps for both the CUDA engine (4070) and the SYCL engine (B70). ## Measured 2026-10-14, this branch, four GPUs on three PCs over 2.5 GbE (main RTX 5070 Ti layers 0-10 → HIP relay RX 7900 XT 11-22 → CUDA relay RTX 4070 23-29 → SYCL last worker Arc Pro B70 30-47), OrcaRouter Q4_K_S, served settings (`--max-context 262144 --kv-resident 32768 --prefill 2048`): | build and flags | decode tok/s | 1K prompt | 4K prompt | |---|---:|---:|---:| | before the rebase (protocol 5, our bf16 opt-in) | 58.9-78.8 | 437 | 849 | | this branch, `STRATA_REMOTE_ROWS=bf16` | 59.4-80.4 | 439 | 850 | | this branch, bf16, `--pipeline-windows 2` | 53.6-74.1 | 441 | 851 | - KL against the 5070 Ti alone (5 texts, 1,363 positions): 0.0169, argmax 93.0% (0.0170 with our earlier bf16, 0.0179 with fp32). - Checkpoints through the SYCL last stage (`--prompt-cache 6`): two 4-turn chats on a 30,783-token shared system prompt, sent twice: time to first token 27.4-30.5 s for every request without checkpoints, 0.25-2.6 s with them (after the first); 15 restores on both sides, 0 errors; at exact flags 8 of 8 repeats byte-identical. Earlier (2026-10-13, before the rebase): one PC, loopback (4070 main, B70 worker, IQ2_XS, K=12): decode 73-109 tok/s vs 44-74 on the B70 alone, KL 0.135 against the B70 alone with a backend floor of 0.152. Two PCs (5070 Ti main, B70 worker, IQ3_XXS, K=23): decode 78-108 vs 81-104 on the 5070 Ti alone, KL 0.015. Not run: HIP as the main process, a relay through a SYCL worker, images, Windows builds of this branch. Raw data and the measurement scripts (`kl_run.py`, `kl_check.py`, `speed_bench.py`) are available on request. YukihiroHemmi@🐜 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#3944
No description provided.