[PR #910] [CLOSED] Two-GPU decode: bounded attention merge (bitwise, opt-in) and pipelined PLE read-ahead / early chain (stacked on #905) #2911

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

📋 Pull Request Information

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

Base: main ← Head: pr/pipe-team


📝 Commits (10+)

  • 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)
  • 6d0e648 Opt-in: keep what the expert cache learned across restarts (--expert-profile-save, #477)
  • 5ccf3a7 Engine 0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); setup requires it
  • b750bbc #136: fused int8 tensor-core experts for the Q2_0 pack's prompt path, grouped on the GPU (opt-in STRATA_PF_FUSED=1)

📊 Changes

1 file changed (+2 additions, -6 deletions)

View changed files

📝 src/kernels/cuda/qsa_decode_attn.cu (+2 -6)

📄 Description

Stacked on #905 (and through it on #859 and #876). Only the last two commits are new.

These are the last pieces of the two-GPU work. With them, main reaches what our fork does on the same PC.

  1. Decode attention: a merge bounded by the selection width (STRATA_ATTN_MERGE_V2=1, opt-in since 9d27f7e: bitwise the same, but not yet measured apart from the other switches).

    • It is bitwise equal to the current merge. attn_merge_parity checks 768 cases (fp16 / int8 / q4_0 / k8v4 KV) on an RTX 5080 and an RTX 4060 Ti.
    • Faster or equal everywhere in the kernel bench, e.g. one query at full width on the 5080: 98 → 21 µs.
    • Off on HIP, where it has never run.

    Same commit: STRATA_MTP_KV=f16 (opt-in), the draft layer's KV in f16. It changes only the drafts, never the verified tokens, and costs ~230 MiB of VRAM.

  2. Pipelined decode (opt-in switches, only inside --pipeline-windows):

    • STRATA_PL_PLE_PREFETCH reads the next window's PLE rows ahead, as the chain's outputs land.
    • STRATA_PL_PLE_LATE gives each stage-0 window its own read handle, so service never blocks on another window's reads. Layer 0's experts are served while its flag waits for the rows.
    • STRATA_PL_EARLY_CHAIN launches the chain before the verdict's bookkeeping.

    The serial loop, run() and the batch windows are unchanged.

Measured

Same setup as #905: 4060 Ti + 5080 split, resident RAM mode (#848), --pipeline-windows 2 --adapt-async 1, --trim-stage-weights, Swift 1.5 IQ3_XXS at 160K (q4_0 KV). Greedy, five prompts × two rounds, decode tok/s:

run 1 run 2
off (STRATA_ATTN_MERGE_V2=0, nothing else set) 117.5 117.5
on (STRATA_PL_PLE_PREFETCH=1 STRATA_PL_PLE_LATE=1 STRATA_PL_EARLY_CHAIN=1 STRATA_MTP_KV=f16, merge v2 by default) 132.1 130.6

That is +12%; I have not split it per switch. For reference, our fork on the same prompts measured 131.7 and 133.7, so the stack is at parity with it.

Checks

  • Exactness: the three pipelined switches give the same greedy text on as off (4/4 prompts, 500 tokens, STRATA_IQ_MT_MIN=1 --pcie-frac 0 --adapt-every 0, blocking tier).
  • Stress: with every switch on and STRATA_PIPELINE_FORCE_MISS=2, 11 varied requests gave no degenerate answer and no stall.

The whole two-GPU stack, on this PC

RTX 4060 Ti 16 GB + RTX 5080 16 GB, i9-14900KF, 32 GB of RAM, Swift 1.5 IQ3_XXS at 160K:

decode tok/s
main today, the 5080 alone (what setup picks for 32 GB) ~29
main today, both cards (--mmap-experts once the file cache is warm) ~64
#848 (resident RAM mode on the split) ~70
+ #859 pipelined windows ~84
+ #876 / #905 async tier beside the pipeline, + #904, --trim-stage-weights ~118
+ this ~131

The last two rows use a fine-tuned draft layer, --spec-min-p 0.65 and Windows power throttling off; the rows above them use the stock draft layer. So read this table as an outline. Each PR has its own A/B with the same settings on both sides.


🔄 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/910 **Author:** [@Hardin22](https://github.com/Hardin22) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/pipe-team` --- ### 📝 Commits (10+) - [`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) - [`6d0e648`](https://github.com/Niko1221/Strata/commit/6d0e648f65795a510d41be9ecbaaf24f54854001) Opt-in: keep what the expert cache learned across restarts (--expert-profile-save, #477) - [`5ccf3a7`](https://github.com/Niko1221/Strata/commit/5ccf3a72cd30159ecaa60d7324a4b79ea9b7b1b5) Engine 0.1.36: a cancelled prompt logged as read so far (#471), the draft-head hint (#474), UPDATE.bat (#475), --expert-profile-save (#477); setup requires it - [`b750bbc`](https://github.com/Niko1221/Strata/commit/b750bbcc142b5a7e398bb53ac89e03d0d0f69016) #136: fused int8 tensor-core experts for the Q2_0 pack's prompt path, grouped on the GPU (opt-in STRATA_PF_FUSED=1) ### 📊 Changes **1 file changed** (+2 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/kernels/cuda/qsa_decode_attn.cu` (+2 -6) </details> ### 📄 Description Stacked on #905 (and through it on #859 and #876). Only the last two commits are new. These are the last pieces of the two-GPU work. With them, main reaches what our fork does on the same PC. 1. **Decode attention: a merge bounded by the selection width** (`STRATA_ATTN_MERGE_V2=1`, opt-in since 9d27f7e: bitwise the same, but not yet measured apart from the other switches). - It is bitwise equal to the current merge. `attn_merge_parity` checks 768 cases (fp16 / int8 / q4_0 / k8v4 KV) on an RTX 5080 and an RTX 4060 Ti. - Faster or equal everywhere in the kernel bench, e.g. one query at full width on the 5080: 98 → 21 µs. - Off on HIP, where it has never run. Same commit: **`STRATA_MTP_KV=f16`** (opt-in), the draft layer's KV in f16. It changes only the drafts, never the verified tokens, and costs ~230 MiB of VRAM. 2. **Pipelined decode** (opt-in switches, only inside `--pipeline-windows`): - **`STRATA_PL_PLE_PREFETCH`** reads the next window's PLE rows ahead, as the chain's outputs land. - **`STRATA_PL_PLE_LATE`** gives each stage-0 window its own read handle, so `service` never blocks on another window's reads. Layer 0's experts are served while its flag waits for the rows. - **`STRATA_PL_EARLY_CHAIN`** launches the chain before the verdict's bookkeeping. The serial loop, `run()` and the batch windows are unchanged. ## Measured Same setup as #905: 4060 Ti + 5080 split, resident RAM mode (#848), `--pipeline-windows 2 --adapt-async 1`, `--trim-stage-weights`, Swift 1.5 IQ3_XXS at 160K (q4_0 KV). Greedy, five prompts × two rounds, decode tok/s: | | run 1 | run 2 | |---|---|---| | off (`STRATA_ATTN_MERGE_V2=0`, nothing else set) | 117.5 | 117.5 | | on (`STRATA_PL_PLE_PREFETCH=1 STRATA_PL_PLE_LATE=1 STRATA_PL_EARLY_CHAIN=1 STRATA_MTP_KV=f16`, merge v2 by default) | **132.1** | **130.6** | That is **+12%**; I have not split it per switch. For reference, our fork on the same prompts measured 131.7 and 133.7, so the stack is at parity with it. ## Checks - **Exactness**: the three pipelined switches give the same greedy text on as off (4/4 prompts, 500 tokens, `STRATA_IQ_MT_MIN=1 --pcie-frac 0 --adapt-every 0`, blocking tier). - **Stress**: with every switch on and `STRATA_PIPELINE_FORCE_MISS=2`, 11 varied requests gave no degenerate answer and no stall. ## The whole two-GPU stack, on this PC RTX 4060 Ti 16 GB + RTX 5080 16 GB, i9-14900KF, 32 GB of RAM, Swift 1.5 IQ3_XXS at 160K: | | decode tok/s | |---|---| | main today, the 5080 alone (what setup picks for 32 GB) | ~29 | | main today, both cards (`--mmap-experts` once the file cache is warm) | ~64 | | #848 (resident RAM mode on the split) | ~70 | | + #859 pipelined windows | ~84 | | + #876 / #905 async tier beside the pipeline, + #904, `--trim-stage-weights` | ~118 | | **+ this** | **~131** | The last two rows use a fine-tuned draft layer, `--spec-min-p 0.65` and Windows power throttling off; the rows above them use the stock draft layer. So read this table as an outline. Each PR has its own A/B with the same settings on both sides. --- <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:05 +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#2911
No description provided.