[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)
Los mantenedores suelen responder en 4 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- performance
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C++
- Estrellas
- 11.6k
- Forks
- 1k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Niko1221/Strata
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Niko1221/Strata#7365 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 4 días
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Niko1221/Strata#7276 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Niko1221/Strata#7230 · 1 comentario ·
Los mantenedores suelen responder en 4 días
Todos los issues de Niko1221/Strata
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Quantinuum/tket#2282 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Los mantenedores suelen responder en 10 días
-
Server crashes when a mob dies to poisonPosiblemente ocupada @joelstiller la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DarkCastleMUD/DarkCastle#305 ·
Los mantenedores suelen responder en 1 día
-
[Issue]: RAS status report lists the wrong pids for an outlier nodePosiblemente ocupada @bhargavchintam la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 2 días