mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #767] --vision cpu caps images at 300 tokens; llama.cpp's mtmd asks for >=1024 for Qwen-VL grounding #347
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#347
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 @miskahm on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/767
What
On the AMD backend
--vision cpuis the only image path (#304), andVISION["cpu"]["max_tokens"]insetup.pycaps an image at 300 tokens (the GPU path gets 1024). llama.cpp's mtmd prints this at encoderstart:
strata_vision.cppexposes--max-tokensbut not--image-min-tokens, so that advice cannot be followedfrom Strata's config — the 300-token cap is also the minimum mtmd will use here, so the two settings are
tied.
Why it matters
Fine-grained visual questions are where a 300-token grid is weakest: pointing at an object, counting small
items, reading small text inside a large scene, OCR-ish tasks. On this machine the encoder produced 260
tokens for a 640x400 image (grid 20x13) in 2.73 s, so a larger budget is affordable when the image warrants
it — the cost is linear in tokens, and it is paid once per image (results are cached by image hash, so a
conversation sends it once).
Suggestion (not a patch)
Either of these would do, and neither changes the wire format:
--image-min-tokensthrough to mtmd alongside the existing--max-tokens, and pick the pair per path(e.g. CPU
max-tokens 1024/image-min-tokens 300, so small images stay cheap and large ones get theresolution the model wants); or
VISION["cpu"]["max_tokens"]configurable, the wayVISION["gpu"]is a table today.Also: the documented CPU encode cost looks pessimistic
docs/INSTALL.mdanddocs/TROUBLESHOOTING.mdsay a picture takes 10-30 s on the CPU encoder. Measuredhere (RX 7900 XTX host, engine 0.1.38, Swift 1.5 IQ3_XXS, 8 threads,
VISION["cpu"]["max_tokens"]=300,640x400 PNG): 2.73 s, and 2.74 s on the repeat:
End to end, a request with an image took 7.0 s wall (2.7 s encode + 321 prompt tokens prefill + ~120 tokens
generated). If 10-30 s was measured on a slower CPU or at the GPU path's 1024 tokens, the docs could say so —
the current figure sets the wrong expectation for anyone deciding whether
--vision cpuis usable.Environment: RX 7900 XTX (gfx1100), Ryzen 7 9800X3D, 60 GB RAM, engine 0.1.38 (
99f3dbd), insiderocm/dev-ubuntu-24.04:10.0.0-full.@sinand99 commented on GitHub (Oct 4, 2026):
Yes, this is also necessary for 8 GB cards since we can't use GPU decoding (even though it used to work with older Strata versions).
@apdogod123321-ops commented on GitHub (Oct 4, 2026):
minimum should be 1024 by default, it doesn't take that long even on cpu and ensures we get usable quality. ideally it would shift to gpu as needed to make it a non issue.
@Niko1221 commented on GitHub (Oct 6, 2026):
Fixed in 0.1.40: vision.min_tokens in the run config is passed to the encoder as --min-tokens (mtmd's image_min_tokens), and the docs now give the CPU encode time (about 3 s per picture at 300 tokens on 8 cores). The CPU default is unchanged.