[PR #905] [CLOSED] Pipelined windows + async adaptive tier together (stacked on #859 and #876) #2908

Closed
opened 2026-11-04 02:04:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/905
Author: @Hardin22
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: pr/pipe-async


📝 Commits (10+)

  • eb8da1d /metrics: each request's speculative draft counts, and their sums in the totals (#457)
  • 6a09387 setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444)
  • d6a91e2 docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438)
  • d8d4ad3 Merge branch 'f-135-eng' into rel-0.1.35
  • 7b600d5 Merge branch 'f-135-small' into rel-0.1.35
  • d9ab843 Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it
  • 57bd713 sycl: pipeline the expert cache's profile fill (model load 3-4x faster)
  • e3bdd74 A prompt cancelled mid-read is logged and recorded with the tokens it read (#471)
  • f2aaba1 "The draft head does not fit" says what to change (#474)
  • 64987c8 UPDATE.bat / update.sh: update Strata without starting the model (#475)

📊 Changes

4 files changed (+226 additions, -125 deletions)

View changed files

📝 docs/DETAILS.md (+3 -3)
📝 docs/MULTI_GPU.md (+3 -2)
📝 include/strata/core/expert_source.hpp (+1 -0)
📝 src/program/generate.cpp (+219 -120)

📄 Description

Stacked on #859 and #876. The branch carries their commits; only the last commit (887a711) is new. I'll rebase it once those land.

With the pipelined windows (#859), two windows can be in flight on a two-card split. The async adaptive tier (#876) moves experts between RAM and the cards in steps that advance between windows. Each feature alone keeps the other out. This commit lets them run together, with fences:

  • Ticks: inside the pipelined loop, the async tier ticks once per verdict.
  • Fences: a fence is an event recorded on both stages' streams. Both parities' verifiers share their stage's stream, so one fence covers every window and commit queued on both cards at that moment.
  • Step 2 (copy the new experts into the evicted slots): runs only after the windows that still saw the old residency have passed the fence (fence_ev).
  • Step 3 (move the evicted blobs into the RAM places): waits for a second fence (exch_ev) before the RAM copy is committed.
  • CPU side: the pool runs synchronously inside service(), so it needs no fence. The pipelined verifiers keep the always-copy doorbell publish.
  • End of a pipelined loop (after pl_drain): the job is waited for and the fences dropped. The next request's drain finishes the round. An error that ends the loop makes a job waiting for a fence give up.
  • Fallback: STRATA_PIPELINE_ADAPT_ASYNC=0 keeps the blocking tier beside the pipelined windows (the startup log says so).

Measured

4060 Ti (layers 0-19) + 5080 (20-47) split, i9-14900KF, 32 GB of RAM, resident RAM mode (#848). Swift 1.5 IQ3_XXS at 160K, with a fine-tuned draft layer, --spec-min-p 0.65, --trim-stage-weights, and Windows power throttling off. Greedy, five prompts × two rounds, decode tok/s:

runs
--pipeline-windows 2 with the blocking tier 111.2, 111.4
--adapt-async 1, serial loop 117.3, 109.6
both (this PR) 121.7, 126.3, 120.9

That's about +10% over the pipeline alone and +8% over the async tier alone. One more run of the combination came in at 105.4: its first prompt was cold, at 64 tok/s.

Checks

  • Stress, both on: no degenerate answer and no stall in either run.
    • 22 varied requests at temperature 0.6 (thinking on/off, five languages, code), with 48,387 experts swapped in over 658 rounds.
    • 11 more with STRATA_PIPELINE_FORCE_MISS=2 STRATA_PIPELINE_THETA=0 (every second guess wrong, every window speculated).
  • No exact check: the async tier is not bit-exact by design (#876), so there is no exact comparison.

For scale, on this PC: setup's choice today (the 5080 alone) decodes ~29 tok/s. With #848 + #859 + #876 + this + #904, the same split reaches ~125.


🔄 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/905 **Author:** [@Hardin22](https://github.com/Hardin22) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/pipe-async` --- ### 📝 Commits (10+) - [`eb8da1d`](https://github.com/Niko1221/Strata/commit/eb8da1d8c26ec41e6ffb084fdf579dba7cad10bd) /metrics: each request's speculative draft counts, and their sums in the totals (#457) - [`6a09387`](https://github.com/Niko1221/Strata/commit/6a093874fe037020f49bd5cf053879ff6a133c21) setup (--gguf-dir): GGUFs Strata cannot run are named as such, with the --family/--model to use (#444) - [`d6a91e2`](https://github.com/Niko1221/Strata/commit/d6a91e2d1770d0f469d6ec15890acc7ee93e764c) docs: the Coder is weaker outside code, Chinese/CJK text included; the unpruned sizes for that (#438) - [`d8d4ad3`](https://github.com/Niko1221/Strata/commit/d8d4ad337d3c98ba21d3bd0af1a16e9177e112b6) Merge branch 'f-135-eng' into rel-0.1.35 - [`7b600d5`](https://github.com/Niko1221/Strata/commit/7b600d55ff801caaaa11542af1523050992e049b) Merge branch 'f-135-small' into rel-0.1.35 - [`d9ab843`](https://github.com/Niko1221/Strata/commit/d9ab8435f654c368c586340d490915f6addf56a3) Engine 0.1.35: Windows AMD uses its bundled HIP runtime (#468 #461), the low-RAM resident mode on Windows 32 GB PCs (#467), fixes #460 #459 #446 #447 #457 #448 #444; setup requires it - [`57bd713`](https://github.com/Niko1221/Strata/commit/57bd713454ddb4b965f994e95d95cacd68c93fb1) sycl: pipeline the expert cache's profile fill (model load 3-4x faster) - [`e3bdd74`](https://github.com/Niko1221/Strata/commit/e3bdd7449223c4305ef53e331538346765855a2c) A prompt cancelled mid-read is logged and recorded with the tokens it read (#471) - [`f2aaba1`](https://github.com/Niko1221/Strata/commit/f2aaba1e3d219a6ff165fca367d92b6a1dad7080) "The draft head does not fit" says what to change (#474) - [`64987c8`](https://github.com/Niko1221/Strata/commit/64987c891dc7cf3edb954f5b5f6b8cde233594db) UPDATE.bat / update.sh: update Strata without starting the model (#475) ### 📊 Changes **4 files changed** (+226 additions, -125 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+3 -3) 📝 `docs/MULTI_GPU.md` (+3 -2) 📝 `include/strata/core/expert_source.hpp` (+1 -0) 📝 `src/program/generate.cpp` (+219 -120) </details> ### 📄 Description **Stacked on #859 and #876.** The branch carries their commits; only the last commit (`887a711`) is new. I'll rebase it once those land. With the pipelined windows (#859), two windows can be in flight on a two-card split. The async adaptive tier (#876) moves experts between RAM and the cards in steps that advance between windows. Each feature alone keeps the other out. This commit lets them run together, with fences: - **Ticks**: inside the pipelined loop, the async tier ticks once per verdict. - **Fences**: a fence is an event recorded on both stages' streams. Both parities' verifiers share their stage's stream, so one fence covers every window and commit queued on both cards at that moment. - **Step 2** (copy the new experts into the evicted slots): runs only after the windows that still saw the old residency have passed the fence (`fence_ev`). - **Step 3** (move the evicted blobs into the RAM places): waits for a second fence (`exch_ev`) before the RAM copy is committed. - **CPU side**: the pool runs synchronously inside `service()`, so it needs no fence. The pipelined verifiers keep the always-copy doorbell publish. - **End of a pipelined loop** (after `pl_drain`): the job is waited for and the fences dropped. The next request's drain finishes the round. An error that ends the loop makes a job waiting for a fence give up. - **Fallback**: `STRATA_PIPELINE_ADAPT_ASYNC=0` keeps the blocking tier beside the pipelined windows (the startup log says so). ## Measured 4060 Ti (layers 0-19) + 5080 (20-47) split, i9-14900KF, 32 GB of RAM, resident RAM mode (#848). Swift 1.5 IQ3_XXS at 160K, with a fine-tuned draft layer, `--spec-min-p 0.65`, `--trim-stage-weights`, and Windows power throttling off. Greedy, five prompts × two rounds, decode tok/s: | | runs | |---|---| | `--pipeline-windows 2` with the blocking tier | 111.2, 111.4 | | `--adapt-async 1`, serial loop | 117.3, 109.6 | | **both (this PR)** | **121.7, 126.3, 120.9** | That's about +10% over the pipeline alone and +8% over the async tier alone. One more run of the combination came in at 105.4: its first prompt was cold, at 64 tok/s. ## Checks - **Stress, both on**: no degenerate answer and no stall in either run. - 22 varied requests at temperature 0.6 (thinking on/off, five languages, code), with 48,387 experts swapped in over 658 rounds. - 11 more with `STRATA_PIPELINE_FORCE_MISS=2 STRATA_PIPELINE_THETA=0` (every second guess wrong, every window speculated). - **No exact check**: the async tier is not bit-exact by design (#876), so there is no exact comparison. For scale, on this PC: setup's choice today (the 5080 alone) decodes ~29 tok/s. With #848 + #859 + #876 + this + #904, the same split reaches ~125. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:04:03 +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#2908
No description provided.