mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2455] [CLOSED] [Other] serve: an all-cached image turn never wakes the elastic encoder #4051
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#4051
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/2455
Author: @jerry78424
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:vision-cache-wake📝 Commits (3)
36b9466serve: an all-cached image turn never wakes the elastic encoder2d7fa2aserve: the cache lookup refreshes the LRU, and the skip stays elasticed4145ddocs: the elastic encoder does not wake for pictures it already encoded📊 Changes
4 files changed (+184 additions, -12 deletions)
View changed files
📝
docs/DETAILS.md(+3 -1)📝
docs/VRAM_ELASTIC.md(+4 -0)📝
serve/server.py(+39 -11)➕
serve/test_vision_cache_wake.py(+138 -0)📄 Description
Problem and result
An elastic image encoder is woken (seconds of start, VRAM the expert cache gives up) on every turn that re-sends pictures it has already encoded - which is what most clients do on every turn. A turn whose images are all in the hash cache needs no encoder process at all.
Measured on RTX 5090 32 GB, Windows 11 (26200), engine 0.1.44.1, nvfp4,
elastic_idle_s: 10(table and verbatim log lines in #2454): before - a text-only turn with a re-sent picture cost a 2.3 s start + 2085 MiB taken from the expert cache; after - 722 ms with no start line. A re-sent-picture turn: 1277 ms, no start. New pictures unchanged (3979-4213 ms, still start).Related discussion
Resolves #2454. Independent of #2641 (the tool-picture wake lands in this same method - textual overlap only; the two PRs conflict in neither order, verified by cherry-pick).
Approach
serve/server.py:Vision.key_of()/Vision.cached()- a hash-cache lookup that answers with the process down (the cache and its .sve files survive an unload, as before) and marks a hit most recently used, asencode()does on its hit path.prepare()maps the turn's images through the cache first, for an elastic encoder only: when every one is a hit the turn skips the encode FIFO,_vision_up()and the encode. A miss - alone or alongside hits - keeps today's path byte-for-byte: FIFO, make-room, start, encode.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; the lookup answers with the process down and keeps the re-sent picture from aging out of the 64-entry cache; a non-elastic turn keeps today's path even when every picture is cached.docs/VRAM_ELASTIC.md,docs/DETAILS.md: both halves of the elastic rule - a picture's turn starts the encoder, a turn of pictures the cache knows takes neither the turn nor a start.Validation
Passed:
python -m unittest serve.test_vision_elastic serve.test_vision_busy serve.test_vision_cache_wake serve.test_images: the vision four 36 OK - ate88ee39d(v0.2.0-beta-12), rebased 2026-10-20, Windows 11 26200, Python 3.12 venv, CPU-only tests.Failed: none observed.
Not run: AMD/HIP and layer-split machines (a layer split refuses elastic anyway; its start failure is #2435). No native files are touched, so no native builds are required.
Limits
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.