mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3095] [Engine] STRATA_PW_WITH_BATCH=1 keeps --pipeline-windows for a lone request beside --batch slots; single-stream decode +12-16% on a layer split #4450
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3095
Author: @Vop3p
Created: 10/18/2026
Status: 🔄 Open
Base:
main← Head:pw-with-batch📝 Commits (1)
f375524batch: STRATA_PW_WITH_BATCH=1 keeps --pipeline-windows for the solo path beside --batch slots📊 Changes
1 file changed (+23 additions, -5 deletions)
View changed files
📝
src/program/generate.cpp(+23 -5)📄 Description
Problem and result
With
--batchslots ("parallel" >= 2) generate.cpp turns--pipeline-windowsoff for everything ("--pipeline-windows 2 is off: not with --batch slots"), so a request that is alone - it runs the solo path, and the server goes back to it whenever a slot is left alone (#857) - loses the window overlap a layer split gets without batch slots. A server configured for concurrency is slower for the common one-request case.With
STRATA_PW_WITH_BATCH=1the solo path keeps--pipeline-windowsbeside the batch slots; batch windows run without it as before. Result on 2x RX 6900 XT (below): a lone request decodes +16.1% at 4K and +12.3% at 32K context (10 of 10 interleaved cold-start pairs each, draft acceptance unchanged). Without the variable the default path is byte-identical.Related discussion
Closed in the 0.2.0-beta tracker reset; the same change rebased on main and re-measured on 0.2.0-beta as asked.
Approach
One file (
src/program/generate.cpp, +23/-5). Both parities' verifiers share the stage's session (ver_b.init(.., gs.ss, ..)), so when the solo request is stopped for a newcomer,copy_to_slotreads a whole state fromssafter the pipeline has drained; batch windows never use the second verifiers. With--batch-mtpthe slot drafters go where the solo drafter is (the first stage's card whenmtp_first), as it does. The--pipeline-windowsauto rule andmtp_firsttakebatch_blocks_pw(=o.batch != 0 && !STRATA_PW_WITH_BATCH) instead ofo.batch != 0; a line says when it stays on. Opt-in.Validation
Environment: 2x RX 6900 XT (gfx1030, 16 GB, PCIe 4.0 x8 each), Ryzen 5 5600X, 128 GB DDR4-3200, Ubuntu 26.04 (kernel 7.0.0), ROCm 10.0.0. Revision: main
e88ee39d(v0.2.0-beta + 12 commits) and this branch on it (it merges cleanly with today's main9ae93f7b, the 0.2.1 candidate, not re-measured), built with setup.py's HIP options (-DSTRATA_PREFILL_MMQ=ON -DSTRATA_Q6K_EXPERTS=ON -DSTRATA_MMQ_KQUANTS=ON, gfx1030, the pinned ggml, Release). Model: Qwen3.8-Flash-Next GSQ-RCO IQ3_S, layer split over both cards, int8 KV.Passed:
ctest(STRATA_BUILD_TESTS=ON): 137 tests, 131 passed; the 6 failures are the same 6 on main built the same way (ple_parity- a missing Q2_0 GGUF,hip_prefill_mmq_parity- SEGFAULT on main too,native_hadamard_test/tq_cpu_parity/tq_cpu_parity_avx2- "this ggml has no trellis types",isa_guard_check-tq_rows_avx512not listed).Default path byte-identical: deterministic config (
parallel1,STRATA_LOGPOStop-256 log-probabilities, 8 real-text chats, 4,067 positions): main and this branch without the variablecmpidentical.Speed:
parallel2,--spec 3 --spec-min-p 0.7 --pipeline-windows 2 --batch-mtp,--kv-resident 32768,STRATA_PREFILL_CPU_SHARE=auto,STRATA_HC_PERSIST=1,STRATA_HIP_PROMPT_F16=1,STRATA_SH_STREAM=1,STRATA_PREFILL_STREAM_MIN=2048, a rocBLAS table. The same binary without and with the variable, 20 cold starts alternating A B A B; each arm sends one request at a time: real text of about 4K and 32K tokens + "summarize in about 400 words", greedy, max_tokens 512;decode_tok_sand drafts from /metrics:=1(median, range)=1)Generated 494-512 tokens (a few natural stops at 4K), 512 at 32K. The unset arms printed "--pipeline-windows 2 is off: not with --batch slots", the others "--pipeline-windows 2 stays on for the solo path beside 2 batch slots (STRATA_PW_WITH_BATCH=1)"; 0 stalls.
CUDA compile only (no NVIDIA GPU here): CUDA 13.2.2, GCC 15.2, sm_86, tests on: builds.
Failed: none observed.
Not run: concurrent requests on this revision (batch windows are not changed by the patch, but a request arriving while the solo path is pipelined waits for the pipeline to drain; not measured here); a single-card setup (the gain is the layer split's window overlap); CUDA execution; SYCL and Metal (Metal compiles generate.cpp; the change is host logic only, not verified by a Mac build); other GPUs, Windows.
Community measurements (not mine)
--batch 2 --batch-mtp, spec 4/0.5 - cjmckenna, 2026-10-21 (comment below): no gain on CUDA. Solo decode 131.3 vs 133.3 tok/s mean over six 16K-160K requests (per-row -7% to +7%, following draft acceptance), two concurrent decodes 102 vs 109 tok/s (-6%), uncached reads 1-3% slower (the second verifier's 309 MiB cost 161 expert slots on CUDA0). The draft chain stays on the last card there (mtp_firstis off outside gfx12 - as on our gfx1030, where the gain is measured). Consistent with the maintainer's 2026-10-20 A/B on 2x RTX A4000 (bench/results/2026-10-20-0.2.1-idle-gpu): pipeline windows do not pay on those CUDA splits, and this PR then has nothing to keep on. Leave both off on such a machine.Limits
Developed with an AI coding assistant; every number above was measured on the machine described here.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.