[Engine] Inkling-2-Mini: every follow-up turn in a chat with images re-encodes all images and re-reads the whole prompt (no image-embedding cache; prefix reuse is off when a request has images)
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- performance
Direzione di ricerca
Start with engine/src/inkling2/ink_serve.h, especially the image encode loop near line 645 and prefix reuse check near line 671. Trace how image embeddings and cached prefixes are represented and used across turns. Done means follow-up requests without new images reuse prior image encodings and matching prompt prefixes, while requests with changed images still process them correctly.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
I sent 5 screenshots and a question in one chat, and got the answer. I then asked a follow-up in the same chat with no new images, and waited again before the first token.
The client resends the whole conversation each turn, as OpenAI-style clients do. While I waited, strata-inkling was at ~1,600% CPU (16 cores busy): all 5 images were being encoded again before any token was read.
Why (from the source, engine/src/inkling2/ink_serve.h, v0.2.22-1, c23477403)
- Every image in the request is encoded again, every turn. The encode loop at ~line 645 runs for every image in the prompt. There is no cache of image embeddings, so an image already encoded on the previous turn costs the full encode again.
- Prefix reuse is turned off when the request has any image. The reuse check at ~line 671 is wrapped in
if (pg.images.empty()) { ... }. Once a chat contains one image, every later turn also re-reads the full prompt (old text, old answers and image tokens), even though the KV for that prefix is still in the slot.
Expected: a follow-up turn without new images reads only the new text.
Suggested fix
- An image-embedding cache. Key it by a hash of the decoded, resized pixels plus the grid size. Store the vision encoder output, LRU-bounded in MiB, per server process or per slot. A follow-up turn would then skip the encode for images it has already seen.
- Image-aware prefix reuse. Keep, next to
cached_prefix, the image hash for each image-pad position. Thenpg.imagesno longer has to disable reuse: a prefix matches when the token ids AND the image hashes match.
With both, a follow-up turn in an image chat only reads the new text.
Smallest steps or command that reproduce it
- Start Inkling-2-Mini with
--vision Inkling-2-Mini-Vision.strata. - In one chat, send 5 screenshots and a question, and wait for the answer.
- Ask a follow-up in the same chat, without new images.
- Watch
topduring step 3:strata-inklinguses many cores until all images are encoded again, then reads the whole prompt from the start.
For scale: one 640x400 PNG (0.256 MP) plus a short question took 15.2 s to answer here; the answer was 100 tokens.
Reproduction status
Reproduced locally
Strata version
Strata 0.2.22 (terminal v0.2.22-1) · strata-inkling 0.1.69 (linux-x86_64-cuda-cuda13)
Graphics card, memory and system
RTX 3090 24 GB + RTX 4060 Ti 16 GB · Xeon Gold 6136 (12C/24T) · 93 GB RAM · Ubuntu 26.04
Model, size and settings
Inkling-2-Mini SQ-20 + Inkling-2-Mini-Vision · 512K context · pictures on · --gpus 2 --layer-split ep2 --ep-split 0.4 --kv fp8 --draft dspark
- Lingua principale
- C++
- Stelle
- 11.6k
- Fork
- 1k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Niko1221/Strata
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Niko1221/Strata#7365 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 4 giorni
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 4 giorni
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Niko1221/Strata#7276 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Niko1221/Strata#7230 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di Niko1221/Strata
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Quantinuum/tket#2282 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
I maintainer di solito rispondono entro 10 giorni
-
Server crashes when a mob dies to poisonForse già presa @joelstiller l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
DarkCastleMUD/DarkCastle#305 ·
I maintainer di solito rispondono entro 1 giorno
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeForse già presa @bhargavchintam l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni