mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4960] [Engine] Metal batch slots: the slot window beats the serve watchdog #5265
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#5265
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4960
Author: @oceanio
Created: 11/1/2026
Status: 🔄 Open
Base:
main← Head:fix/metal-slot-watchdog📝 Commits (1)
c47b80bmetal: a batch slot window beats the serve watchdog, as on CUDA📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
src/core/verify.cpp(+2 -0)📄 Description
Problem and result
With
"parallel": 2on the Mac engine (0.2.9 and 0.2.10), two requests that decode side by side in the batch slots for more than 60 s are stopped by the serve watchdog. Both requests end with an error, and the log says:On an M5 Max with Swift 1.5 IQ3_S at 262K context, two long requests ("count from 1 to 5000 in words", up to 7,000 tokens, the second 1 s after the first) both ended in an error after 70-71 s, in two runs on 0.2.10 (and two on 0.2.9).
The cause: the Metal branch of
Verifier::run_slot_rowsreturns withoutprogress_beat(), while CUDA's branch ends withprogress_at("decode")andprogress_beat().batch_stepholds busy for each window, so while the slots decode and no request is being read (no prompt chunks, no admissions), nothing beats. A request alone is not affected: serve moves a request left alone in a slot back to the solo path, which beats.With this PR the same two requests decode side by side to their 7,000-token limit in 134-140 s, in two runs, and the engine keeps serving.
Related discussion
None. Found while testing the fix for #4908 (#4961).
Approach
Two lines in
src/core/verify.cpp, inside#if defined(STRATA_GPU_METAL): the Metal branch ofrun_slot_rowsends like CUDA's, withprogress_at("decode")and thenprogress_beat().unifdef -USTRATA_GPU_METAL src/core/verify.cppgives the same file as 0.2.10's.Validation
Environment: Apple M5 Max (128 GB), macOS 26.7.1. Revision: this branch,
c47b80bf= 0.2.10 (ffa80d73) + 1 commit, engine 0.1.56-metal. Rebased from 0.2.9 with one conflict: 0.2.10's per-slot sampling block now sits just above the two lines, which follow it. Model: Swift 1.5 IQ3_S (SC117's abliterated build), repacked by setup,--max-context 262144 --spec 2with MTP,"parallel": 2, no pictures. Requests go through this tree'sserve/server.pyon a private port, greedy: the two long requests above.Passed:
unifdef -USTRATA_GPU_METAL src/core/verify.cpp: identical to 0.2.10's.length) after 140 s, and again after 134 s. Each time the engine stays the same process, and the log has nono progressline. Without this commit the same requests ended in an error after 71 s on 0.2.10 itself and after 70 s on 0.2.10 plus #4961 (which changes nothing without--vision).717ab9aa): 164 s and 154 s with this commit; 70 s, twice, without it.Failed:
none observed
Not run:
Limits
None known.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.