mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2715] --batch on the Metal backend is accepted at boot and exits the engine with code 86 on the first request that runs two sequences together #1085
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#1085
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 @alvarorsouza-arch on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2715
What happened
--batchis accepted on the Metal backend, allocates its slot sessions at boot, and then stops the engine the first time a request actually decodes two sequences together. On a Mac that is worse than a refusal, because the server restarts the engine between requests and the rest of the run fails the same way.What I ran: setup's own config for the IQ3_S pack plus
--batch Nin--serve, then the repo's burst client.The boot is happy, and it announces itself with the CUDA device name on a Mac build:
The first concurrent round then writes two lines and the process is gone:
metal/src/engine/missing.cppdocuments what follows that message, verbatim:Default: say which one and stop (exit code 86), so a run never continues on outputs nobody wrote.The server's side:In my engine log the restarts after these exits are 6, 25 and 74 s apart. Same at
--batch 2and--batch 3.Measured with
tools/serve_load.py, three rounds, 256 tokens out, one engine boot per row:--batchOne client is normal decode; from two sequences onward the number is the restart cycle, not throughput.
Strata version, GPU, OS
0.1.44.1-metal, source build of
mainat296b59d· Apple M3 Max, 40-core GPU, 128 GB unified memory · macOS 26.6, high power mode. Model: original Flash-Next IQ3_S,--max-context 65536, experts resident with--mmap-experts,--spec 2with the MTP draft layer, everything else at setup defaults.Engine log
The two relevant lines are quoted above, and the version line in the same log reads
strata generate: session is up (engine 0.1.44.1-metal). The full measurement set for this machine is in #2649.Why it stops at that call
src/core/verify.cpp:901decides the batch window withpdl_window(G == 1 && pdl_supported()).pdl_supported()is a capability query rather than a kernel, and on Metal it is one of the entry points listed inmetal/src/engine/stubs.cpp, so it runsmissing()and exits.How far the batch route is from working on Metal
STRATA_METAL_STUBS=log, which that same file describes asfor listing which entry points a code path reaches, never for answers, shows what a four sequence run touches. Seventeen entry points:Two capability queries, the multi row family a batched window needs, the native helpers, and the expert pool side, which Metal does not use because it reads experts in place from the mapped file.
What I would suggest
--batchon Metal at boot, the way--kv int8already stops there withstrata metal: strata::kernels::kv_block_bytes has no Metal implementation yet, instead of allocating 1.73 GiB per sequence and exiting 86 mid-request.pdl_supportedreturning false in the stubs moves the stop from a capability query to the kernels that matter, which is where the list above becomes a checklist.docs/MAC.mdstill names--parallel(batch slots) as not ported. The flag today is--batch(and--slots), so a Mac reader can miss the line, and the boot line'son CUDA0does not help.@Spinoza0 commented on GitHub (Oct 18, 2026):
Reproduced on a MacBook Pro M4 Pro 48 GB (engine 0.1.45-metal, built from source) with the IQ2_XS GSQ-RCO pack and
"parallel": 2in the config: same shape — the engine announcesstrata verify: batch windows of up to 2 sequencesat boot, reads the first prompt, then stops on the next batched decode.After the first three stops the run reaches
Verifier::record_windowand dies with SIGSEGV caught by metal_crash, so the list above matches what I see too: the capability queries come first, then the mapped handoff helpers, then the kernels proper.Three extra findings from this machine, in case they shorten the checklist:
ref: unknown type 29(metal/src/ref_quant.cpp): this GGUF stores three layers' MoE experts (blk.8, blk.13, blk.37 gate/up as IQ1_M inside the IQ2_XS file, a mixed-quant pack), and ref_quant has no IQ1_M. That is the same gap that took IQ2_XS out of setup_mac's menu, so any batch run on this pack trip it first.pdl_supported/pdl_scopeas plain no-ops (Metal never has PDL),copy_from_mapped/copy_i32_from_mappedasmemcpy_asyncblits (on unified memory the CUDA reasons for the copy-kernel handoff apply to WDDM, not to Metal), andiq_embed_rows/iq_dequant_f32/iq_dequant_f16as host dequantizers over the mapped table.fused_gr_read_multi,shared_expert_multi, the gdn_*_multi row,broadcast_streams,doorbell_publish_res), which is the real porting work — agreeing with the checklist framing.Until then I have
paralleloff in my config; the engine and the solo path work fine (and the IQ1_M-in-pack fix is worth having for the single-request path regardless). Reports welcome from other Mac owners; my full notes live in a local v0.1.44.1-to-v0.1.45 metal port.@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.
@Wolf-Quiteque commented on GitHub (Oct 23, 2026):
Re-confirming this on a different Mac, and adding the number the thread is missing: what the absent batch path actually costs.
What I ran: Strata
0.1.44.1-metal(source build in~/Strata-local), Apple M4 Max, 128 GB unified memory, macOS 27.0.1, IQ3_S GSQ-RCO pack (78 GB, internal SSD),--servewith--kv q4_0 --max-context 262144 --expert-cache 64 --mtp --spec 2, plus"parallel": 2in the model config.The boot is happy, as reported:
The first concurrent request then stops the engine:
Client side, both requests get
503 the engine stopped unexpectedly (exit code 86); the server restarts the engine and the next pair dies identically. Three consecutive attempts: 0 of 6 requests completed.What it costs. Two concurrent prompts of 1,656 tokens, 150 greedy tokens each, same client, same prompt shape:
parallel)"parallel": 2Solo reference on the same box: 4.3–5.3 s per request, decode 66–67 tok/s, prefill ~615 tok/s warm. So one slot is fully serialized (2 concurrent = ~1.9x solo), and the batch path was recovering ~27% of that before it died — on a machine with 59 GB of VRAM sitting free and only 4.49 GiB asked for.
Still current on main, not just on 0.1.44:
metal/src/engine/stubs.cpp:288onmainstill readsso a 0.2.2 / engine 0.1.47 build should hit the same stop (relevant given @Spinoza0's follow-ons:
copy_i32_from_mapped,iq_embed_rows, then the SIGSEGV atVerifier::record_window).Ask: is the Metal batch-decode path planned —
pdl_supportedplus the two follow-on kernels above? If there is a build that has it, name it and I will run the same two-stream probe on it and report the numbers either way./reopen