mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4908] [Engine] Metal batch slots (0.2.9): a picture request decodes other text once another request joins (slot rows rotate without M-RoPE) #2252
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#2252
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 @oceanio on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4908
Area
Engine
Desktop app, Terminal or source?
Source (setup.sh or a build)
What happened
With
--visionand"parallel": 2on the Mac engine, a picture request gives different text when another request decodes beside it than when it runs alone. The requests are greedy (temperature 0), so the text should be the same, and two text requests side by side do give the same text. Nothing in the log or the response says anything, and the engine keeps serving.I sent the requests through 0.2.9's own
serve/server.py, with up to 400 tokens each. First each request ran alone, then in pairs, the second request starting 1 s after the first:The text matches until the second request joins, and differs from there on. I1 gives the same shape counts alone and beside T1, but its reasoning is worded differently from there: alone it says "First shape is a red circle. Second is a red circle.", and beside T1 it says "First shape: red circle. Second: red circle." I2's answer differs from its first sentence (both versions reached the 400-token limit before naming the bars).
Cause (from reading the code):
mrope_synccopies the process's M-RoPE table intomrope_, and its positions are right.qsa_prepis built with function constant 30 only (metal/src/engine/window.cpp:953,qsa_prep#rows), not with the M-RoPE constant 24, so every slot row rotates by its plain cell position. After a picture, the text sits at fewer M-RoPE positions than it has cells, so it is rotated as if it came later. A text request's table is the identity, which is why text requests are not affected.STRATA_METAL_BATCH_ROWS=0) rotates withmrope_sync, which reads the process's table. The last request that was read in rebuilds that table, so a slot would read another request's positions there too. I did not run that path.A possible fix, which I have written but not yet run on the GPU:
--vision).slot_copyinto a slot fills the slot's table from the admitting request's table: cells [0, upto) as they are, then one position per cell after the last one.qsa_prep#rows#mrope, with the row's offset inrinfo_'s fourth word, which is 0 now). On the slot-by-slot path,mrope_synccopies from the active slot's table.Once it passes the same pairs on the Mac, I can open it as a PR if you want it.
Smallest steps or command that reproduce it
"parallel": 2and--vision.temperature: 0andmax_tokens: 400alone, and keep the text.Reproduction status
Reproduced locally
Strata version
0.2.9 from source (
c62d5e3a), engine 0.1.55-metalGraphics card, memory and system
Apple M5 Max · 128 GB · macOS 26.7.1
Model, size and settings
Swift 1.5 IQ3_S (SC117's abliterated build, the same file layout as UkisAI's), repacked by setup, Swift's projector · 262K context ·
--spec 2with MTP · pictures on ·"parallel": 2. Three synthetic test pictures: 6 shapes (640×400), a bar chart (640×400) and an invoice (800×300).Logs
The server log shows 10 slot admissions (
strata batch: slot N takes ...) and no error.@oceanio commented on GitHub (Nov 1, 2026):
The fix is now #4961. On 0.2.9 plus only that change, with the same setup and requests as above, every request of every pair gives its text alone: 10 of 10 on the batch rows, and 10 of 10 slot by slot (
STRATA_METAL_BATCH_ROWS=0). Requests alone give the same text as on 0.2.9.Separately, while testing I found that on 0.2.9 two requests that decode side by side in the slots for more than 60 s are stopped by the serve watchdog, with or without pictures. #4960 fixes that.