[GH-ISSUE #3784] [Engine] Metal: Gyro-S resident mode wraps the whole 58.5 GB file and OOMs on a 64 GB Mac (docs: GPU maps 29.7 GB) #1592

Closed
opened 2026-11-04 01:52:28 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @namseokyoo on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3784

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Terminal (the strata command)

What happened

Launching Gyro-S with its default preset on a 64 GB Mac mini dies with a Metal GPU out-of-memory error after the model load (~585 s). Reproduced 3 times (2× via strata launch, 1× manual start from the saved config).

The default Gyro-S launch config is resident mode: STRATA_METAL_STREAM=0 + --spec 2 + MTP on. Engine log at the point of failure:

mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB…)
strata serve: 0 MiB of VRAM free with everything loaded
mtl: command buffer failed: Insufficient Memory (kIOGPUCommandBufferCallbackErrorOutOfMemory)

The loader wraps the entire 58.5 GB single file — including the n-gram table region embedded in it — as GPU buffers. On a 64 GB Mac that exceeds what Metal can hold resident (maxBufferLength 41.75 GB), so the OOM is deterministic, not a headroom issue: raising --vram-reserve-mib (1212 → 2560 → 3072, set directly in the saved config) does not change the outcome.

What I expected: per docs/MAC.md, Gyro-S is "one 58.5 GB file" of which "the file the GPU maps" is 29.7 GB, because "the file's other 28.8 GB is the n-gram table", which "is read from the SSD a few rows at a time and does not count against the memory above". The table lists Gyro-S as needing about 38 GB, "Recommended from 48 GB". So on a 64 GB Mac, resident mode should fit with room to spare — instead, the loader's wrap covers the table region too.

This looks like a loader/docs mismatch specific to the single-file Gyro layout: with the GSQ packs the n-gram table is a separate file, so wrapping "the model file" naturally excludes it. It also explains why it may have gone unnoticed: on a 128 GB Mac the whole file fits, and on a 32 GB Mac the engine streams by default — only the 48–64 GB band that follows the Gyro preset into resident mode hits it.

Smallest steps or command that reproduce it

  1. On a 64 GB Apple Silicon Mac, install Strata 0.2.2 with the official install.sh.
  2. Run strata launch --model gyro-s and accept the default preset (resident mode: STRATA_METAL_STREAM=0, --spec 2, MTP on).
  3. Wait for the model load (~585 s).
  4. The engine dies with the Metal OOM in the log below.

Reproduction status

Reproduced locally

Strata version

Strata 0.2.2 · engine 0.1.47 (0.1.47-macos-arm64-metal)

Graphics card, memory and system

Apple M5 Pro (16-core GPU, unified memory) · 64 GB RAM · macOS 27.0.1 (26A434), Mac mini, 1 TB SSD (700+ GB free)

Model, size and settings

Qwen3.8-Flash-Next Gyro-S (agentionai), single file Qwen3.8-Flash-Next-Gyro-S-TQ1_0.gguf, 58.5 GB · 32K context · pictures on · default preset

Logs

mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB…)
strata serve: 0 MiB of VRAM free with everything loaded
mtl: command buffer failed: Insufficient Memory (kIOGPUCommandBufferCallbackErrorOutOfMemory)

Workaround

Forcing streaming mode starts and runs well on the same machine:

STRATA_METAL_STREAM=1
→ mtl: 42083 MiB of VRAM free with everything loaded
→ decode 33–35 tok/s with MTP on (draft acceptance ~58–61%)

Additional notes

  • Side effect of the failed resident attempts: each one pushes hard on swap before dying. Measured sysctl vm.swapusage went from a 0 MB baseline to 2,362 MB used (cumulative swapouts 565,281) after the 3 attempts. Streaming runs of the same pack produce essentially no swapouts (Δ +3,420 pages over a full benchmark session), so the swap pressure comes from the resident wrap attempt itself.
  • Possibly related, minor: strata launch --set vram-reserve-mib=… did not persist the value into the saved config (editing the config file directly did).
Originally created by @namseokyoo on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3784 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Terminal (the `strata` command) ### What happened Launching Gyro-S with its default preset on a 64 GB Mac mini dies with a Metal GPU out-of-memory error after the model load (~585 s). Reproduced 3 times (2× via `strata launch`, 1× manual start from the saved config). The default Gyro-S launch config is resident mode: `STRATA_METAL_STREAM=0` + `--spec 2` + MTP on. Engine log at the point of failure: ``` mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB…) strata serve: 0 MiB of VRAM free with everything loaded mtl: command buffer failed: Insufficient Memory (kIOGPUCommandBufferCallbackErrorOutOfMemory) ``` The loader wraps the **entire 58.5 GB single file** — including the n-gram table region embedded in it — as GPU buffers. On a 64 GB Mac that exceeds what Metal can hold resident (maxBufferLength 41.75 GB), so the OOM is deterministic, not a headroom issue: raising `--vram-reserve-mib` (1212 → 2560 → 3072, set directly in the saved config) does not change the outcome. What I expected: per `docs/MAC.md`, Gyro-S is "one 58.5 GB file" of which "the file the GPU maps" is **29.7 GB**, because "the file's other 28.8 GB is the n-gram table", which "is read from the SSD a few rows at a time and does not count against the memory above". The table lists Gyro-S as needing about 38 GB, "Recommended from 48 GB". So on a 64 GB Mac, resident mode should fit with room to spare — instead, the loader's wrap covers the table region too. This looks like a loader/docs mismatch specific to the single-file Gyro layout: with the GSQ packs the n-gram table is a separate file, so wrapping "the model file" naturally excludes it. It also explains why it may have gone unnoticed: on a 128 GB Mac the whole file fits, and on a 32 GB Mac the engine streams by default — only the 48–64 GB band that follows the Gyro preset into resident mode hits it. ### Smallest steps or command that reproduce it 1. On a 64 GB Apple Silicon Mac, install Strata 0.2.2 with the official `install.sh`. 2. Run `strata launch --model gyro-s` and accept the default preset (resident mode: `STRATA_METAL_STREAM=0`, `--spec 2`, MTP on). 3. Wait for the model load (~585 s). 4. The engine dies with the Metal OOM in the log below. ### Reproduction status Reproduced locally ### Strata version Strata 0.2.2 · engine 0.1.47 (0.1.47-macos-arm64-metal) ### Graphics card, memory and system Apple M5 Pro (16-core GPU, unified memory) · 64 GB RAM · macOS 27.0.1 (26A434), Mac mini, 1 TB SSD (700+ GB free) ### Model, size and settings Qwen3.8-Flash-Next Gyro-S (agentionai), single file `Qwen3.8-Flash-Next-Gyro-S-TQ1_0.gguf`, 58.5 GB · 32K context · pictures on · default preset ### Logs ``` mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB…) strata serve: 0 MiB of VRAM free with everything loaded mtl: command buffer failed: Insufficient Memory (kIOGPUCommandBufferCallbackErrorOutOfMemory) ``` ### Workaround Forcing streaming mode starts and runs well on the same machine: ``` STRATA_METAL_STREAM=1 → mtl: 42083 MiB of VRAM free with everything loaded → decode 33–35 tok/s with MTP on (draft acceptance ~58–61%) ``` ### Additional notes - Side effect of the failed resident attempts: each one pushes hard on swap before dying. Measured `sysctl vm.swapusage` went from a 0 MB baseline to 2,362 MB used (cumulative swapouts 565,281) after the 3 attempts. Streaming runs of the same pack produce essentially no swapouts (Δ +3,420 pages over a full benchmark session), so the swap pressure comes from the resident wrap attempt itself. - Possibly related, minor: `strata launch --set vram-reserve-mib=…` did not persist the value into the saved config (editing the config file directly did).
Author
Owner

@github-actions[bot] commented on GitHub (Oct 23, 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:

  • 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:6354883024 --> @github-actions[bot] commented on GitHub (Oct 23, 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: - [ ] 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 23, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6355073077 --> @github-actions[bot] commented on GitHub (Oct 23, 2026): Thanks, this follows the format now.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6659731550 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Author
Owner

@namseokyoo commented on GitHub (Nov 7, 2026):

Retested on Strata 0.2.12 (engine/Control 0.1.58), Mac mini M5 Pro, 64 GB, Gyro-S pack, resident mode (profile without --mmap-experts and without STRATA_METAL_STREAM), 128K context, DFlash2 drafter. /reopen - the problem persists, though the failure moved:

What changed: the load-time OOM from the original report is gone. The loader now wraps the file successfully and the server reports ready:

  • mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB, overlap 0.54 GB)
  • wrapped (58.5 GB), 131200 cells, PLE on, ready in 14716 ms

What still fails: the first generation request OOMs and the engine dies:

  • strata serve: 0 MiB of VRAM free with everything loaded - LOW
  • mtl: command buffer failed: Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)
  • API returns: the engine stopped unexpectedly (exit code 5)

Reproduced with the resident instance running alone on the machine (system memory ~90% free, no other Strata instance), so it is not contention with a second server. Streaming mode (--mmap-experts) on the same setup works fine and remains my production workaround.

So resident mode still is not usable on a 64 GB Mac: it loads, but it cannot generate. Happy to provide the full serve log if useful.

<!-- gh-comment-id:6714656840 --> @namseokyoo commented on GitHub (Nov 7, 2026): Retested on Strata 0.2.12 (engine/Control 0.1.58), Mac mini M5 Pro, 64 GB, Gyro-S pack, resident mode (profile without --mmap-experts and without STRATA_METAL_STREAM), 128K context, DFlash2 drafter. /reopen - the problem persists, though the failure moved: **What changed:** the load-time OOM from the original report is gone. The loader now wraps the file successfully and the server reports ready: - `mtl: wrapped 58.49 GB as 2 overlapping buffers (maxBufferLength 41.75 GB, overlap 0.54 GB)` - `wrapped (58.5 GB), 131200 cells, PLE on, ready in 14716 ms` **What still fails:** the first generation request OOMs and the engine dies: - `strata serve: 0 MiB of VRAM free with everything loaded - LOW` - `mtl: command buffer failed: Insufficient Memory (00000008:kIOGPUCommandBufferCallbackErrorOutOfMemory)` - API returns: `the engine stopped unexpectedly (exit code 5)` Reproduced with the resident instance running alone on the machine (system memory ~90% free, no other Strata instance), so it is not contention with a second server. Streaming mode (--mmap-experts) on the same setup works fine and remains my production workaround. So resident mode still is not usable on a 64 GB Mac: it loads, but it cannot generate. Happy to provide the full serve log if useful.
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#1592
No description provided.