mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#1711
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 @yevgenyt on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3981
Area
Engine
Desktop app, Terminal or source?
Source (
./setup.shon macOS, Metal engine built on the Mac)What happened
Re-test of #2715 on the 0.2.x line, as asked in the tracker reset. It is not fixed, and there is one more symptom worth knowing: from the client's side, the failed requests look successful.
With
"parallel": 2in the model config, the Metal engine boots, allocates two slot sessions and announces batch windows of 2. The first time two requests are actually decoded together, it printsstrata::kernels::pdl_supported has no Metal implementation yetand exits with code 86. The server restarts the engine, and the next concurrent request fails the same way.What the client sees: both concurrent requests come back HTTP 200, with 0–2 tokens of content and a normal end of stream, and no error field. A caller has no way to tell the answer was lost. With 2 × 46K-token prompts, both prompts are read (at about 2,300–2,400 tok/s), then the engine exits after the first token, so about 20–28 s of prompt processing per request is wasted.
Expected one of:
--batch/"parallel"at boot on Metal (or setup does not write it), so the server falls back to one request at a time; orWithout
"parallel"(one request at a time), the same machine and pack are completely stable. 2 × 46K and 2 × 65K concurrent requests are served in turn with no restarts, at ~2,450–2,630 tok/s prompt and ~117–137 tok/s decode. So the batch path is the only problem.Smallest steps or command that reproduce it
./setup.sh --family qwen --model IQ3_S --yes --no-start(macOS, Apple Silicon)."parallel": 2tostrata-iq3_s.json..venv/bin/python serve/server.py --engine strata --config strata-iq3_s.json --port 8010./v1/chat/completionsrequests at the same moment (streaming or not), each with a ~3K-token prompt andmax_tokens200.pdl_supportedline and the server reports exit code 86.Reproduction status
Every time (3 of 3 concurrent batches, ~3K, 46K and 65K-token prompts).
Strata version
7dd5cf18e68c639a8773e096c5c79f971ea2a9f5(2026-10-24).0.1.48-metal, built bysetup.sh.Graphics card, memory and system
iogpu.wired_limit_mbraised to 245760.Model, size and settings
"parallel": 2,"reasoning_effort": "none"and--max-context 131072.--spec 2,--mtp,--mmap-experts,--expert-cache 64."parallel"work correctly."parallel", which is stable. Its batch path was not tried.Logs
Engine log (
--batch 2, first concurrent pair, ~3K-token prompts):The same thing at 46K tokens:
strata batch: slot 0 takes 46161 tokens (copied in 136.2 ms), then the same last line.Server log, 2 × 46K-token run:
Client side, the same run (streaming): both requests HTTP 200; one with 0 tokens of content, the other with 2 (
[r8), and no error in the stream.Related: #2715 (same crash, engine 0.1.44.1–0.1.45, closed in the 0.2.0 tracker reset, re-confirmed there on 2026-10-23).
@TechFUNS commented on GitHub (Oct 27, 2026):
Reproduced on Apple Mac Studio, M5 Max, 64 GB unified memory, macOS 27.0.1, engine
0.1.50-macos-arm64-metal, Qwen3.8-Flash-Next GSQ-RCO Q2_0 pack,--max-context 262144,--vision, MTP draft on (--spec 2 --mtp <rt>). Reproduced through both serving paths:the Terminal/launchd serve (
--parallel 2→ engine--batch 2) and the 0.2.6 desktop app("Concurrent requests" = 2 in Expert settings → same
--batch 2).Controlled A/B on one machine, one config, one stimulus
Same prompt (~19.6 KB with repeated segments,
max_tokens: 512) in every request; the onlyvariable is concurrency:
A. Two simultaneous requests, 5 rounds (10 requests total)
HTTP 503, body:the engine stopped unexpectedly (exit code 86)exit code 86crashes in ~70 s (engine crash-loop: each restartsurvives until the next concurrent pair)
strata metal: strata::kernels::pdl_supported has no Metal implementation yet--batch 2and dies on the firstbatched decode
B. One request at a time, 10 rounds (identical prompts)
HTTP 200, ~4.07 s each, engine pid unchanged across all rounds, zero crashesTwo extra observations
sending both does not crash the engine — the app's chat panels serialize requests, so
there is no true concurrent decode. GUI-only reports of "parallel works on Mac" are
probably false negatives; the API layer is the reliable trigger.
for non-streaming requests, while streaming clients get a mid-response truncation
(our Claude Code consumer sees "Server error mid-response"). In sustained real load
(
--parallel 4, Claude Code agent traffic) our serve log accumulated ~200exit code 86crashes in 24 h.
Would be great to see either the Metal implementation of the batched PDL path, or as a
stopgap an engine-side fallback that queues/degrades to the solo path instead of aborting
and killing in-flight requests.
@TechFUNS commented on GitHub (Oct 28, 2026):
Follow-up A/B on the same machine (Strata 0.2.7.1, engine 0.1.52-macos-arm64-metal,
Qwen3.8-Flash-Next Q2_0 GGUF, Apple M5 Max 64 GB, macOS 27)
Since our previous comment we tested two mitigation hypotheses. Both failed —
the crash is independent of the speculation flags:
--batch 2+--suffix-draft 0(PDL disabled)exit code 86x9--batch 2+ drafting layer off (no--mtp)exit code 86x10parallel=1(no--batch)Every crash log ends with the same line:
Root-cause observation from source: in
metal/src/engine/stubs.cpp,pdl_supported()callsstrata::metal_engine::missing(...), which aborts theengine instead of returning
false. It appears to be a support probe thatruns whenever two sequences decode together in batch mode — gated neither by
--suffix-draftnor by the draft-layer settings, which is why both mitigationsfailed.
Suggested fix: make this stub
return false;on Metal (feature-gate PDL)instead of aborting. That alone should restore
--batch Nparallel serving onMac (without PDL), which is currently unusable there.
Repro: 5 rounds x 2 concurrent POSTs to
/v1/chat/completionswith arepetition-heavy prompt (the same sentence repeated ~60 times),
max_tokens=128,temperature=0. With--batch 2: 10/10 503 +exit code 86;with
parallel=1: 10/10 200.@northpixelworks commented on GitHub (Oct 30, 2026):
Another data point: M1 Pro 16 GB, streaming mode, different abort site (Strata 0.2.7, engine 0.1.52-macos-arm64-metal, Q2_0, macOS 27.2)
Same symptom family on a small Mac where Q2_0 is streamed from SSD (expert arena only 0.8 GB). Two concurrent
/v1/chat/completions(≈ 4.7k-token prompts,max_tokens10096, reasoning budget 4096) viastrata launch --preset … --parallel 2 --context 32kand again with--context 16k:only 0 MiB of VRAM free at the start of this request; at 16k it reports3674 MiB of VRAM free with everything loaded, so it does not look like plain memory pressure.pdl_supportedhere, but the KV save path after the first prompt is read: preceded bystrata metal stream: 3.69 GB of the host code's device weight copies given back (unused by the Metal window).So on streamed Metal setups the batch path seems to touch weight copies that the stream window already released. I haven't tried
STRATA_METAL_KEEP_HOST_WEIGHTS=1(on 16 GB it would likely not fit). Happy to rerun with a debug flag if useful.