[Engine] Inkling-2-Mini vision runs on the CPU on Windows/CUDA, and a picture's KV is not reused between turns
Maintainer thường phản hồi trong vòng 4 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
The report names ink_vision.h, ink_serve.h, ink_cuda_backend.cu, ink_backend.h, and ink_runner.cuh, plus the proposed ink_cuda_vision.cuh. Start by reviewing the vision encoder and image prefix reuse paths, then compare the author's patch and measurements with the engine logs. Done means CUDA vision encoding is faster and follow-up turns reuse cached image tokens; the report notes validation was limited to one Windows/CUDA machine.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
Two problems with pictures on inkling-2-mini with the CUDA engine on Windows:
- Encoding a screenshot is CPU work. A 1280×720 screenshot takes about 20 s before the
first token; the release notes for 0.2.22 (#7043) list the same shape of numbers for the
CPU path: 0.25 MP 15 s, 1 MP 74 s, 2.1 MP 334 s, 3 MP 743 s. - A picture already in the conversation is read again on the next turn. There is no
[InkReuse]line and noRESUMEin the engine log for a chat that only extends its
picture history, so the visual tokens are prefilled again.
Together this is what makes a screenshot-heavy chat unusable: 20 s to look at the first
picture, and the same picture paid for again on every follow-up.
Environment
Strata 0.2.22 (Terminal 0.2.22, strata-inkling 0.1.67/0.1.69, CUDA 13)
Windows 11, RTX 5060 Laptop 8 GB, 40 GB RAM
Inkling-2-Mini-Unbound-v2.1-Q4_K_M + Inkling-2-Mini-Vision
--max-context 65536 --kv fp8 --vision <pack>
What I think causes it (from reading the source, please correct me)
- The CUDA backend has no ViT kernels for Inkling:
ink_vision.hruns the encoder on the
host and keeps the weights as float, so every request that has a picture walks the ViT on
the CPU. There is noSTRATA_INK_VISION_CUDAstyle switch to put it on the card. ink_serve.h's reuse check comparescached_prefixwithprompt_ids, and the picture
branch only reuses an exact prefix whenimagesis non-empty — a picture that arrives
with new text after it does not reuse the KV that is already in the slot. The same
SWA/ShortConv rewind limit described in #6627 applies here.
A patch that works on my machine
I built the 0.1.69 CUDA engine from source with two changes and measured on the same
screenshot:
- CUDA ViT, fp16 weights uploaded once (
ink_cuda_vision.cuh, wired through
ink_cuda_backend.cu/ink_backend.h/ink_runner.cuh): the encoder runs on the card,
the weights go up as fp16 straight from the pack, no 1.27 GB float staging copy.
Screenshot encode: ~20 s → 3–5 s. - Picture prefix reuse (
ink_serve.h, theimagesbranch): a conversation that already
holds N screenshots reuses their KV and reads only the new tokens. The engine now prints
[InkReuse] images=2 cached=15723 prompt=16107 match=15723andRESUME 15723.
Validation
- Same model, same pack, same 64K context, RTX 5060 Laptop 8 GB.
- Before: first picture ~20 s, follow-up re-reads the picture.
- After: first picture 3–5 s, follow-up reads 384 of 16,107 tokens (the rest reused).
- Output text is unchanged on the prompts I compared (same answer, same tokens).
Limits
- Measured only on one Windows/CUDA machine (RTX 5060 Laptop, 8 GB).
- I did not test the Metal or HIP backends.
- I did not run the repo's test suite; the numbers above are from my own runs.
I can send the patch as a diff if you want it; it is three files plus the new
ink_cuda_vision.cuh.
- Ngôn ngữ chính
- C++
- Star
- 11.6k
- Fork
- 1k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Niko1221/Strata
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Niko1221/Strata#7365 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] Engine chip: move the breathing status dot to the right end of the quant line, inside the chipĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 4 ngày
-
[GUI] The top horizontal stroke of 更 in the sidebar footer is never drawn (Windows, 125% scaling)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Niko1221/Strata#7276 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Niko1221/Strata#7230 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
Tất cả issue của Niko1221/Strata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`test_controlled_TermSequenceBox_logging` and `test_symbolic_ops` fail when another test runs firstĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Quantinuum/tket#2282 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
KhronosGroup/Vulkan-Tutorial#555 ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Server crashes when a mob dies to poisonCó thể đã có người làm @joelstiller đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DarkCastleMUD/DarkCastle#305 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Issue]: RAS status report lists the wrong pids for an outlier nodeCó thể đã có người làm @bhargavchintam đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 2 ngày