[GH-ISSUE #3915] [Bug]: macOS 15 + streaming Mac (M1 Max 32 GB): prebuilt engine exits on MetalPerformancePrimitives; needs STRATA_METAL_PROMPT_GEMM=0 too #1674

Closed
opened 2026-11-04 01:53:05 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @proskilzz on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3915

What happened

docs/MAC.md says macOS 15 or newer, but on macOS 15 the prebuilt Metal engine exits at start on a Mac that streams the experts (32 GB). Each attempt dies in Context::compile():

mtl: compile failed (Apple M1 Max, macOS Version 15.7.5 (Build 24G624); prompt.metal):
dense_mm.metal:6:10: fatal error: 'MetalPerformancePrimitives/MetalPerformancePrimitives.h' file not found

strata launch keeps retrying until it times out with "The model did not finish loading in time".

Setup: MacBook Pro M1 Max 32 GB, macOS 15.7.5, Terminal 0.1.49, engine 0.1.48 macos-arm64-metal (prebuilt, from install.sh), strata launch --model q2_0 --context 32k --vision off --mtp off --tune skip.

Why STRATA_METAL_PROMPT=window isn't enough when streaming

Setting STRATA_METAL_PROMPT=window alone gives the same crash. When streaming, Window::stream_arena() calls prompt_gemm_init() right after the arena is built (metal/src/engine/window.cpp, the if (pg_on && !prompt_gemm_init(err)) line). That compiles dense_mm.metal / moe_mm.metal / prompt.metal no matter what STRATA_METAL_PROMPT is set to. Only STRATA_METAL_PROMPT_GEMM=0 skips it. On the 96 GB macOS 15.8 Mac in #2323 / #2388 the model is resident, so that path was never reached there.

Workaround that works

STRATA_METAL_PROMPT=window STRATA_METAL_PROMPT_GEMM=0 COOP_K4=0 strata launch --model q2_0 ...

The engine starts, with no compile errors. Q2_0, streamed from the SSD: 8.1 tok/s decode (300-token story, 2 runs, timings.predicted_per_second), 12.8 tok/s on a 77-token prompt. Answers are correct.

Suggestion

  • Either docs/MAC.md should say macOS 26 for the default paths and list these three variables for macOS 15, or the engine should pick them itself (the __has_include + GPU-family probe idea from #2388 / #2987). For a streaming Mac, the probe also needs to gate prompt_gemm_init() in stream_arena().
  • The measured M1 Max line in MAC.md is on macOS 26.6. Saying so would help.

Related: #2323, #2388, #2987.

Originally created by @proskilzz on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3915 ### What happened `docs/MAC.md` says macOS 15 or newer, but on macOS 15 the prebuilt Metal engine exits at start on a Mac that **streams** the experts (32 GB). Each attempt dies in `Context::compile()`: ``` mtl: compile failed (Apple M1 Max, macOS Version 15.7.5 (Build 24G624); prompt.metal): dense_mm.metal:6:10: fatal error: 'MetalPerformancePrimitives/MetalPerformancePrimitives.h' file not found ``` `strata launch` keeps retrying until it times out with "The model did not finish loading in time". **Setup:** MacBook Pro M1 Max 32 GB, macOS 15.7.5, Terminal 0.1.49, engine 0.1.48 macos-arm64-metal (prebuilt, from `install.sh`), `strata launch --model q2_0 --context 32k --vision off --mtp off --tune skip`. ### Why `STRATA_METAL_PROMPT=window` isn't enough when streaming Setting `STRATA_METAL_PROMPT=window` alone gives the same crash. When streaming, `Window::stream_arena()` calls `prompt_gemm_init()` right after the arena is built (`metal/src/engine/window.cpp`, the `if (pg_on && !prompt_gemm_init(err))` line). That compiles `dense_mm.metal` / `moe_mm.metal` / `prompt.metal` no matter what `STRATA_METAL_PROMPT` is set to. Only `STRATA_METAL_PROMPT_GEMM=0` skips it. On the 96 GB macOS 15.8 Mac in #2323 / #2388 the model is resident, so that path was never reached there. ### Workaround that works ``` STRATA_METAL_PROMPT=window STRATA_METAL_PROMPT_GEMM=0 COOP_K4=0 strata launch --model q2_0 ... ``` The engine starts, with no compile errors. Q2_0, streamed from the SSD: **8.1 tok/s decode** (300-token story, 2 runs, `timings.predicted_per_second`), 12.8 tok/s on a 77-token prompt. Answers are correct. ### Suggestion - Either `docs/MAC.md` should say macOS 26 for the default paths and list these three variables for macOS 15, or the engine should pick them itself (the `__has_include` + GPU-family probe idea from #2388 / #2987). For a streaming Mac, the probe also needs to gate `prompt_gemm_init()` in `stream_arena()`. - The measured M1 Max line in MAC.md is on macOS 26.6. Saying so would help. Related: #2323, #2388, #2987.
bsakaguchi 2026-11-04 01:53:05 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".
  • Fill in "Area".
  • Fill in "Desktop app, Terminal or source?".
  • Fill in "Reproduction status".
  • Fill in "Strata version".
  • Fill in "Graphics card, memory and system".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6380038709 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". - [ ] Fill in "Area". - [ ] Fill in "Desktop app, Terminal or source?". - [ ] Fill in "Reproduction status". - [ ] Fill in "Strata version". - [ ] Fill in "Graphics card, memory and system". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Oct 29, 2026):

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6494796841 --> @github-actions[bot] commented on GitHub (Oct 29, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1674
No description provided.