mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4929] [Engine] STRATA_PREFILL_HELPER_SOURCE is gated on o.batch <= 0, so it never engages with --parallel N; it halves prompt TTFT when it does #2268
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#2268
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?
Originally created by @aebconsulting on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4929
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Terminal (the
stratacommand)What happened
Every prompt on this four-card box pays about 7.4 s before the first token, regardless of prompt length: 524 tokens read in 7.4 s (70 tok/s), 8,012 tokens in 22.4 s (357 tok/s), 34,300 tokens in 110 s. Decode is fine (55-60 tok/s on short outputs, 100% expert-cache hit rate). The engine log says why: the prompt path borrows 1,277 CUDA0 expert slots per 8192-token chunk and refills them from the GGUF on the SSD, and the streamed experts come from the SSD too, although the three helper caches hold every expert:
The engine has an opt-in that fixes most of this,
STRATA_PREFILL_HELPER_SOURCE, but its gate insrc/program/generate.cpp(0.1.54, lines 9288-9289; unchanged at v0.2.9) requireso.batch <= 0:serve/server.pyturns--parallel N(N > 1) into--batch N, so with any concurrency the switch is silently off: no log line, no change. I expected either the switch to work under--batch, or a log line saying why it did not.A/B on the same server, one change per relaunch (GuideLLM 0.8.1, synchronous, unique synthetic prompts, 256/128-token outputs,
reasoning_effort none; the client's TTFT agrees with the engine's ownprompt N tokens ... read in X mslines on every run):--batch 4, switch unset--batch 4,STRATA_PREFILL_HELPER_SOURCE=1(gate fails, no log line)STRATA_PREFILL_HELPER_SOURCE=1With the switch on the engine prints
strata serve: the prompt path reads the experts a helper cache holds from that cache (STRATA_PREFILL_HELPER_SOURCE)at start and, per 8K request,strata serve: prefill helper source: 20241 blobs / 60502.0 MiB taken from a helper's cache in this request.Requests / questions:
o.batch <= 0term be relaxed for the helper-cache case? Reading the serve scheduler, prompt chunks and decode windows alternate and a helper's compute has finished before its rows are returned, so the "helpers are idle while a prompt is read" assumption in the comment above the gate seems to hold under--batchtoo. If a fence is wanted, acudaStreamSynchronize(stream_)or an event wait before the copies inRemoteExperts::copy_cached_blobswould be the conservative version. Happy to test a build on this box.STRATA_PREFILL_HELPER_SOURCEbe documented (SECOND_GPU.md / MULTI_GPU.md)? I found it only as a string in the binary.Smallest steps or command that reproduce it
strata launch ... --parallel 4 --gpu 0 --set CUDA_DEVICE_ORDER=PCI_BUS_ID --set CUDA_VISIBLE_DEVICES=0,1,2,3 --set expert-cache-device1=7200 --set expert-cache-device2=7200 --set expert-cache-device3=7200 --set remote-expert-opt=on --set STRATA_PREFILL_HELPER_SOURCE=1(plus the model/context flags below).the prompt path reads the experts a helper cache holdsline; time a 500-token prompt: ~7.4 s to first token.--parallel 1: the line prints, the same prompt reads in ~3.6 s.Reproduction status
Reproduced locally
Strata version
Strata 0.2.8 · Terminal/Control 0.1.54 · engine 0.1.54-windows-x86_64-cuda-cuda13 (the gate is unchanged in the v0.2.9 source)
Graphics card, memory and system
RTX 5090 32 GB (CUDA0, PCIe Gen5 x8) + three RTX 3090 24 GB on OCuLink docks (PCIe Gen4 x4, CUDA1..3) · 64 GB RAM · Windows 11 Pro · model files on NVMe
Model, size and settings
Qwen3.8-Flash-Next UD-Q4_K_XL (Unsloth) · 256K context (
--context 256k,--kv int8,--kv-resident 32768) · pictures on · engine args:--prefill auto --spec 4 --spec-min-p 0.5 --mtp ... --resident-budget-gib 36 --expert-cache 3400 --expert-cache-device1 7200 --expert-cache-device2 7200 --expert-cache-device3 7200 --remote-expert-opt --vram-reserve-mib 2048· envSTRATA_ROUTE_PRIOR=0 STRATA_ROUTE_TAIL_SKIP=0 STRATA_KVA=0· expert layout: CUDA0 4,335 slots, each 3090 6,747 experts, all 24,576 pairs GPU-residentLogs
Engine lines quoted above; full per-request lines available on request (the 524-token and 8K rows for every configuration in the table).