mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4987] [Engine] --vision itself slows prefill ~40 % and decode ~30–50 % on a CUDA layer split (Qwen3.8-Flash-Next, UD-Q6_K_XL), whatever card the encoder runs on #2300
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#2300
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 @Sunmingyang1987 on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4987
Problem
On a two-GPU CUDA layer split of Qwen3.8-Flash-Next-UD-Q6_K_XL, adding
--visionto the engine args drops long-prompt prefill from ~2,200 tok/s to ~1,300 tok/s and decode from ~90–100 tok/s to ~40–70 tok/s. The slowdown is the same whether the vision encoder process runs on the first GPU, the second GPU, or on the CPU, so it is not about where the encoder's VRAM goes.Environment
--max-context 128000 --kv int8 --kv-resident 32768 --spec 4, served through serve/server.pytimingsReproduce
Start the model with the config above; run a ~34K-token prompt. Then stop, add a
"vision"section (server adds--vision --vram-reserve-mib 700), run again. The only expected difference is--vision.Actual
--vision--vision--visioncuda_device(3090)--visionReadings are pairs of identical requests except where two numbers share a row. The gpu-unlock kernel module (BF16 tensor-core unlock) was active for all runs including the no-vision baseline, so it is not the cause; a no-vision A/B before the module was installed measured 2224 / 2186 tok/s on the same prompt, i.e. the same as the unlocked no-vision runs within noise.
To isolate
--vram-reserve-mib 700(which the server adds next to--vision) from--visionitself I also ran the engine with the 700 MiB reserve but without--vision:Decode differences were not consistent enough to claim: every first request after a fresh load decodes slower, and even the no-vision runs span 50–104 tok/s on identical requests. The prefill effect above is the reproducible one.
Expected
--visioncosts encoder VRAM and a first-use warm-up, but prompts without images should prefill at the same speed as a run without--vision.Evidence
--visionthe 4090 D keeps only ~204 MiB free after load (LOW warning; the split planned 796 MiB) and the engine logsprefill: layer-major off for this prompt: layers 3..48: no VRAM for a super-chunk (204 MiB free)— but the fast no-vision runs log the same layer-major-off line with the same ~206 MiB free and still do ~2,200 tok/s, so the super-chunk path is not what the fast runs use either.--vram-reserve-mib 100alone (as a lower-reserve attempt) does not start:layer split, stage 2: verify: the device arena (114 MiB) does not fit.Reproduction status
Reproduced locally: every engine start without
--visionis fast (2114–2224 tok/s at 34 K), every start with it is slow (1238–1331), across five paired restarts on one machine. I have not confirmed in the engine source where the cost comes from (suspects: a reserve the--visionpath keeps for image input buffers on the prompt path, or the decoder-side image-token handling); this report is from measurements and logs only.Workaround
Remove the
"vision"section when image input is not needed; speed returns to ~2,200 tok/s prefill.@dandandelion commented on GitHub (Nov 2, 2026):
Have you tried pushing the --vision to the CPU? Set
"gpu": falsein the vision section in config, and retest? Maybe the vision on GPU is pushing expert cache out of the VRAM so maybe moving it to the CPU will get you back that speed without removing vision altogether@Adamyno commented on GitHub (Nov 2, 2026):
Not on 0.1.54 + IQ3_S:
--visioncosts 0.3-0.5% on prefill and ~1-5% on decode here — worth checking whether 0.1.55 introduced itI tried to reproduce this on a third rig and could not: with our pack the flag is nearly free, which points at the engine version (you are on 0.1.55, this box is on 0.1.54) or at the pack/placement rather than at
--visionas such.Hardware: 2 of 3× RTX 2080 Ti 22 GB (sm_75) — CUDA0 0-14, CUDA1 15-47, layer split 24; i9-7980XE, 125 GiB DDR4-3600, Linux 7.0.0-38, CUDA 13.0, driver 580.178.04.
Build/config: engine 0.1.54 (
a0116b27), source, sm_75. Qwen3.8-Flash-Next GSQ-RCO IQ3_S,--max-context 524288 --rope-scaling linear --rope-scale 2.0 --kv int8 --kv-resident 65536 --spec 3 --spec-min-p 0.54 --mtp mtp/rt --mtp-max-t 3 --batch 2 --conversation-cache-mib 16384 --prompt-cache 4 --trim-stage-weights,STRATA_NO_LARGEPAGES=1 STRATA_BF16_TC=1, served throughserve/server.py. Two arms, the only difference is--vision(and thevisionblock in the config); fresh server per arm, alternating order, 2 rounds, a unique nonce on every prompt, temperature 0.--visionSo on 0.1.54 the long-prompt path is flat and the decode difference is at our run-to-run spread. Your 2 200 → 1 300 tok/s and 90-100 → 40-70 tok/s is a completely different shape — a 40% and 35-50% step, not a few percent.
What differs, in the order I would eliminate it:
--kv-residentpages. Ours is 65 536 (1 GiB of pinned RAM for the K/V) against your 32 768; if the encoder's process changes the pinned-RAM budget the KV streaming path could degrade, which would hit decode harder than prefill — the opposite of your 40% prefill / 35-50% decode, so probably not this.If it helps I can run the same pair on 0.2.9/0.1.55 here (source build for sm_75) so you have the version axis on one rig rather than two — that is ~30 minutes on this box and would tell you whether to bisect the engine or the pack.
Reproduction status: measured locally; the finding is a negative result (no slowdown reproduced on 0.1.54).
@Adamyno commented on GitHub (Nov 2, 2026):
Also not on 0.2.9 / engine 0.1.55: prefill +0.4…+0.8%, decode +0.2…+3.5% without
--vision— so the version axis is clearedFollow-up to my note above. I built v0.2.9 (
c62d5e3a, engine 0.1.55) from source for sm_75 and ran the same two arms on the same box, so the engine version is no longer a confound.Same rig: 2 of 3× RTX 2080 Ti 22 GB (sm_75), layer split auto → 24 (CUDA0 0-23, CUDA1 24-47), Ubuntu 24.04-class, driver 610-series not used here (615-class is not on this box), Qwen3.8-Flash-Next GSQ-RCO IQ3_S,
--max-context 524288 --kv int8 --kv-resident 65536 --spec 3 --spec-mtp ...,STRATA_NO_LARGEPAGES=1 STRATA_BF16_TC=1. Two arms, only--visiondiffers, fresh engine per arm, alternating order, 2 rounds, unique nonce per prompt, temp 0.--visionTogether with the 0.1.54 run in my previous comment, both engine versions show the flag as nearly free on this pack (flat on the prompt path, a few percent on decode inside our spread). Your 2 200 → 1 300 tok/s and 90-100 → 40-70 tok/s is not reproducible here on either version.
What that leaves. With the engine cleared, the remaining candidates are all about your shape, not the flag:
--kv-resident 32768against our 65536. Decode-side, worth a single arm on your box.I cannot test (1) and (2) from here — they need your pack and your cards. But the version question is now answered: it is not 0.1.55 that introduced it.
Reproduction status: measured locally (two engine versions, same box); negative on both.
@Sunmingyang1987 commented on GitHub (Nov 3, 2026):
Reply draft for the
--visionissue (short version)Thanks both — I re-tested everything today in clean conditions (no other host I/O), same 24K-token prompt, fresh
server per arm, UD-Q6_K_XL on the 3090 + 4090 D:
--vision--vision, GPU encoder +--vram-reserve-mib 700--vision, CPU encoder ("gpu": false), 5 runs@dandandelion — the CPU encoder is the one configuration that is reliably slow here: −35…−40% prefill, −25%
decode, and the reserve does not recover it. Recommendation goes the other way: keep
"gpu": trueand thereserve. (Caveat: dual-socket EPYC, free RAM mostly on the far socket — the worst case for a CPU encoder.)
@Adamyno — I ran your pack (Swift GSQ-RCO IQ3_S, both my cards): no vision 3266/3034, vision 2848/2674 — a real
−12%, but the log shows the mechanism: the encoder's ~1.3 GB pushes the layer-major residual rows out of VRAM
(
R in VRAM→R in pinned RAM). Your 22 GB pair with the 24/24 split does not hit that eviction, which fitsyour flat numbers.
Retraction: yesterday I reported a ~40% prefill penalty for the flag itself (2168→1238–1331 at 34K). Today the
GPU-encoder arm is at parity, and a re-run with background disk I/O was itself depressed — yesterday's numbers
were almost certainly an environment artifact (this box is dual-socket; its free pages sit on the GPU-less
socket, and pinning the server with
numactl --membind=0-3removes the low tail: pinned production now measures2438/2439). I withdraw the claim; what survives: flag cost not detectable today, CPU encoder −35…−40%, tight-split
eviction −12%. Reproduction status: measured locally, 2026-11-03, server's own request timings, fresh engine
per arm.