mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2454] [Bug]: elastic image encoder wakes on every turn when the client re-sends pictures it already encoded #998
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#998
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 @jerry78424 on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2454
What happened
With the elastic image encoder (
vram_elastic: true+ vision"elastic": true), every turn whose messages contain an image takes the encoder's start - even when every one of those images is already in the hash cache.Vision.unload()keepsVision.cacheand the.svefiles (that is the documented design), so an already-encoded picture needs no encoder process at all - butprepare()never asks the cache: on any image turn it takes the encode FIFO and calls_vision_up()unconditionally, and only afterwards doesencode_allfind that everything is a hit.This is not a corner case: most clients re-send the whole conversation - pictures included - on every turn. So after the first idle stop, every subsequent turn pays the start again, forever, including pure-text follow-ups.
Repro (any elastic setup, no rebuild):
vram_elastic: trueand vision{"elastic": true, "elastic_idle_s": 10}.elastic_idle_s(log:the image encoder stopped after 10 s without a picture).Actual: the log shows
the expert cache keeps ... free+the image encoder started ...before the answer - and the same on every later turn.Expected: a turn whose images are all cached answers from the cache without waking the encoder. A new picture (alone or alongside cached ones) should still wake it.
Measured on RTX 5090 32 GB, Windows 11 (build 26200), engine 0.1.44.1, nvfp4 quant,
elastic_idle_s: 10, a client that re-sends history images every turn. Before the change, one chat session's engine log (verbatim, one session file):Per-turn wall time with a scripted client, one conversation, the same machine - before the change every image-bearing turn after an idle stop was preceded by such a start line in the engine log; with the fix:
The
2.3 sand2085 MiBare the steady-state re-start cost on this card (5.1-5.8 s on the very first start).Strata version, GPU, OS
0.1.44.1 · RTX 5090 32 GB · Windows 11 (build 26200)
Engine log
Excerpt above is verbatim from
strata-nvfp4-nvfp4.log.Fix
serve/server.py only, no native files:
Vision.key_of()/Vision.cached()(hash lookup that works with the process down), andprepare()maps the turn's images through the cache first - when every one is a hit the turn skips the FIFO,_vision_up()and the encode entirely. A miss keeps today's path exactly.serve/test_vision_cache_wake.py(new, CPU-only, no engine): a re-sent picture does not wake a stopped encoder, a new picture alongside cached ones still wakes it, and the cache lookup answers with the process down. The wholeservesuite passes with the change here (348 tests, 3 skipped).What I did not test: AMD/HIP and layer-split machines (on a layer split
--vram-elasticis refused anyway, and the start there is covered by #2435), non-elastic vision (path untouched), and the CUDA/HIP/SYCL builds (no native file changes).I'll open a PR with the fix + the test referencing this issue.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.