[PR #2721] [CLOSED] [Engine] prefill: STRATA_PF_PEER_CPU=1 (opt-in) runs the CPU share beside a peer GPU (--peer-device) #4230

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2721
Author: @bulhenvaster
Created: 10/16/2026
Status: ❌ Closed

Base: main ← Head: pr/pf-peer-cpu


📝 Commits (2)

  • 06e0612 prefill: STRATA_PF_PEER_CPU=1 (opt-in) runs the CPU share beside a peer GPU (--peer-device)
  • d082c71 Merge main (0.2.0-beta, e88ee39d) into pr/pf-peer-cpu

📊 Changes

2 files changed (+53 additions, -18 deletions)

View changed files

📝 docs/DETAILS.md (+8 -0)
📝 src/prefill/prefill.cpp (+45 -18)

📄 Description

Problem and result: with --peer-device the prompt path never gives the CPU pool a share (cpu_maybe requires !m.pp), so a short read at long context - an agent's tool result - streams every expert neither card holds over the primary's link while the CPU sits idle. With STRATA_PF_PEER_CPU=1 (opt-in) the share runs beside the peer. On 0.2.0-beta (main e88ee39d), a chain of 12 tool results of 40-3000 tokens read one after another on a 161-173K-token agent conversation, two runs each, alternating:

main main + this, switch on
the 12 reads (engine's own read times) 36.35 / 35.55 s 28.91 / 29.08 s (-19%)
the 12 requests (wall, 64-token answers) 39.71 / 38.16 s 32.11 / 32.52 s
~100 tokens 2.11 / 1.90 s 1.36 / 1.36 s
~300 tokens 2.26 / 2.24 s 1.56 / 1.55 s
~600 tokens 3.79 / 3.66 s 2.23 / 2.24 s
~1000 tokens 4.04 / 3.80 s 2.75 / 2.78 s
~2000 tokens 4.41 / 4.32 s 4.19 / 4.19 s
~3000 tokens 5.24 / 5.14 s 5.15 / 5.15 s (unchanged)

Approach: the share takes only experts that neither card computes (not held by the peer, not in its streamed share), and its rows go between the primary's and the peer's (layout: primary GPU, CPU, peer), so the peer's block stays the tail its combine reads from back_at. With the switch the staged chunks go up to cpu_share_max()'s 3072 tokens instead of the default share's 1024 (an explicit STRATA_PREFILL_CPU_SHARE_MAX still wins). Without the switch nothing changes. docs/DETAILS.md: a paragraph in the CPU-share section.

Validation (RTX 5060 Ti 16 GB, PCIe 3.0 x8, primary + RTX 3060 12 GB, x16, --peer-device 1; Xeon E5-2683 v4, 64 GB DDR4 in two channels; Ubuntu, CUDA 13.3, driver 595.91; Qwen3.8-Flash-Next IQ3_XXS pack, --kv int8 --kv-resident 32768 --spec 4 --mtp --prompt-cache 14 --pcie-frac 0, STRATA_ADAPT_OVERLAP=1 STRATA_PREFILL_TIMING=1; one engine start per run):

  • Passed: cmake --build build --target strata (CUDA, sm_86 + sm_120) on this branch's tree, no errors.
  • Passed: the default path. main and this branch without the switch, deterministic decode (--spec-min-p 1.01 --suffix-draft 0 --lookup-chain 0 --adapt-swaps 0, STRATA_PREFILL_CPU_SHARE=0.5), the same chain: 14 of 14 answers identical.
  • Passed: the A/B above (runs main, switch, main, switch).
  • Failed: none observed.
  • Not run: HIP, SYCL and Metal builds (no such hardware or toolchains here); other peer pairs; Windows.

Limits: with the switch the CPU computes its rows in its own activation format, as the existing CPU share does, so answers can differ in wording from the share off (here the last check answered claim() (Stager::claim) without it and e.g. `Stager::claim` with it). One rig measured.

🤖 Generated with Claude Code


🔄 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/2721 **Author:** [@bulhenvaster](https://github.com/bulhenvaster) **Created:** 10/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/pf-peer-cpu` --- ### 📝 Commits (2) - [`06e0612`](https://github.com/Niko1221/Strata/commit/06e0612f02ea8e8d40c0b1ea4729a3b968739a19) prefill: STRATA_PF_PEER_CPU=1 (opt-in) runs the CPU share beside a peer GPU (--peer-device) - [`d082c71`](https://github.com/Niko1221/Strata/commit/d082c71c8d53696b95580cf64a9c55066c36e5ec) Merge main (0.2.0-beta, e88ee39d) into pr/pf-peer-cpu ### 📊 Changes **2 files changed** (+53 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+8 -0) 📝 `src/prefill/prefill.cpp` (+45 -18) </details> ### 📄 Description **Problem and result:** with `--peer-device` the prompt path never gives the CPU pool a share (`cpu_maybe` requires `!m.pp`), so a short read at long context - an agent's tool result - streams every expert neither card holds over the primary's link while the CPU sits idle. With `STRATA_PF_PEER_CPU=1` (opt-in) the share runs beside the peer. On 0.2.0-beta (`main` e88ee39d), a chain of 12 tool results of 40-3000 tokens read one after another on a 161-173K-token agent conversation, two runs each, alternating: | | `main` | `main` + this, switch on | |---|---|---| | the 12 reads (engine's own read times) | 36.35 / 35.55 s | **28.91 / 29.08 s** (-19%) | | the 12 requests (wall, 64-token answers) | 39.71 / 38.16 s | **32.11 / 32.52 s** | | ~100 tokens | 2.11 / 1.90 s | 1.36 / 1.36 s | | ~300 tokens | 2.26 / 2.24 s | 1.56 / 1.55 s | | ~600 tokens | 3.79 / 3.66 s | 2.23 / 2.24 s | | ~1000 tokens | 4.04 / 3.80 s | 2.75 / 2.78 s | | ~2000 tokens | 4.41 / 4.32 s | 4.19 / 4.19 s | | ~3000 tokens | 5.24 / 5.14 s | 5.15 / 5.15 s (unchanged) | **Approach:** the share takes only experts that neither card computes (not held by the peer, not in its streamed share), and its rows go between the primary's and the peer's (layout: primary GPU, CPU, peer), so the peer's block stays the tail its combine reads from `back_at`. With the switch the staged chunks go up to `cpu_share_max()`'s 3072 tokens instead of the default share's 1024 (an explicit `STRATA_PREFILL_CPU_SHARE_MAX` still wins). Without the switch nothing changes. `docs/DETAILS.md`: a paragraph in the CPU-share section. **Validation** (RTX 5060 Ti 16 GB, PCIe 3.0 x8, primary + RTX 3060 12 GB, x16, `--peer-device 1`; Xeon E5-2683 v4, 64 GB DDR4 in two channels; Ubuntu, CUDA 13.3, driver 595.91; Qwen3.8-Flash-Next IQ3_XXS pack, `--kv int8 --kv-resident 32768 --spec 4 --mtp --prompt-cache 14 --pcie-frac 0`, `STRATA_ADAPT_OVERLAP=1 STRATA_PREFILL_TIMING=1`; one engine start per run): - Passed: `cmake --build build --target strata` (CUDA, sm_86 + sm_120) on this branch's tree, no errors. - Passed: the default path. `main` and this branch without the switch, deterministic decode (`--spec-min-p 1.01 --suffix-draft 0 --lookup-chain 0 --adapt-swaps 0`, `STRATA_PREFILL_CPU_SHARE=0.5`), the same chain: 14 of 14 answers identical. - Passed: the A/B above (runs `main`, switch, `main`, switch). - Failed: none observed. - Not run: HIP, SYCL and Metal builds (no such hardware or toolchains here); other peer pairs; Windows. **Limits:** with the switch the CPU computes its rows in its own activation format, as the existing CPU share does, so answers can differ in wording from the share off (here the last check answered `claim() (Stager::claim)` without it and ``e.g. `Stager::claim` `` with it). One rig measured. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #2721] [Engine] prefill: STRATA_PF_PEER_CPU=1 (opt-in) runs the CPU share beside a peer GPU (--peer-device) to [PR #2721] [CLOSED] [Engine] prefill: STRATA_PF_PEER_CPU=1 (opt-in) runs the CPU share beside a peer GPU (--peer-device) 2026-11-07 16:30:26 +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#4230
No description provided.