[GH-ISSUE #4128] [Engine] macOS / Metal: open contributions, rebased on v0.2.6 #1809

Closed
opened 2026-11-04 01:54:14 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @mnott on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4128

Title: [Engine] macOS / Metal: open contributions, rebased on v0.2.6

This issue lists our open pull requests for Strata on Apple Silicon (Metal), all rebased on v0.2.6 and validated there. Each PR is self-contained and can be reviewed and merged on its own.

PR Area What it changes Why it matters on a Mac
#4126 Engine Sampling on the Metal decode path: temperature, top-k, top-p, min-p, penalties and a Philox seed (CUDA's sampler is the reference); a sampled verify window keeps a draft token only when the sample equals it. The server gives every sampled request a seed. The Metal port decoded greedily only, so temperature had no effect. In agent use that produced word-for-word repetition loops. Greedy output is unchanged.
#3876 Engine Wrap a Gyro file without its PLE table: map only the head and tail ranges the GPU reads. Gyro-M: wrapped 91.97 GB as 2 overlapping buffers becomes wrapped 37.57 GB as 2 separate ranges, leaving room for a second model or other work.
#4127 Engine Metal decode and prompt kernels for the pair-trellis expert types TQP5/TQP6/TQP7 (GGML types 147-149), the 256-expert router, a CPU reference and parity tests. These are the types docs/GYRO.md names as the reason Gyro-L is not supported, and the ones the Gyro Coder files use. v0.2.6 cannot load such a file on a Mac; with this PR Gyro Coder-L runs (about 114 tok/s greedy decode here).
#3231 Engine Conversation cache on macOS: checkpoints validate and park on Metal, the memory guard reads available RAM, K/V is described for snapshots, the session fingerprint and restore accept what this engine saves. v0.2.6 skips parking on Metal (invalid checkpoint running-state payload); returning to an 18k-token conversation took 11.3 s, with this PR 0.95 s (restored from the cache in 24 ms). Two concurrent agent conversations on one server (40-task coding set each): 692-1081 s per run without it, 238-380 s with it.
#3960 Serve Tool-call parsing: coerce parameters by declared type and recover the damaged forms Qwen3-coder-style models write (<=param> openers, </NAME> closers, a parameter name fused with its value, stray stubs). Fewer failed tool calls and retries in agent runs.
#4125 Other Test fix: serve/test_server.py::VisionArgs::test_min_tokens_is_passed_only_when_set fails on v0.2.6 ('Proc' object has no attribute 'pid'). serve/test_server.py runs without failures again, so a real regression is not hidden behind a known one.
#3176 GUI Web app layout follows the window: wide windows use the space, narrow screens stack. Readability of the monitor and chat in wide windows and side panels.

Closed: #3299 (Gyro on Metal). Its kernel work is upstream since v0.2.2/v0.2.3 (672fd99c and following); its remaining commits continue in #3231 and #3876.

How we run Gyro on a Mac

  • Gyro-S / Gyro-M run on stock Strata (docs/GYRO.md, "On a Mac": ./setup.sh --family gyro --model Gyro-M). With #3876 the GPU buffers shrink from 92 to 37.6 GB; with #4126 sampling works; with #3231 agent conversations are parked and restored.
  • Gyro Coder-L (agentionai/Qwen3.8-Flash-Next-Gyro-Coder-GGUF) uses the pair-trellis types 147-149, which stock v0.2.6 does not have. It runs with #4127: build the Metal engine from that branch and pack the file the same way as Gyro-M (Hadamard-folded pack, expert profile, --spec 2 with the MTP draft, --ple-io direct).
  • Gyro-L uses the same types (docs/GYRO.md). A run of Gyro-L on #4127 is being verified; results will follow here.

Validation

Apple Silicon, 128 GB unified memory, Gyro-M TQ2_0 (Gyro Coder-L TQ3_0 for #4127): greedy output bit-exact against v0.2.6 (against the same stack without the PR for #4127, since v0.2.6 cannot load the file), decode speed within 2 %, and for sampling seed 1 != seed 2 / seed 1 == seed 1. Details and the exact revision are in each PR.

Originally created by @mnott on GitHub (Oct 25, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4128 Title: [Engine] macOS / Metal: open contributions, rebased on v0.2.6 This issue lists our open pull requests for Strata on Apple Silicon (Metal), all rebased on v0.2.6 and validated there. Each PR is self-contained and can be reviewed and merged on its own. | PR | Area | What it changes | Why it matters on a Mac | |---|---|---|---| | #4126 | Engine | Sampling on the Metal decode path: temperature, top-k, top-p, min-p, penalties and a Philox seed (CUDA's sampler is the reference); a sampled verify window keeps a draft token only when the sample equals it. The server gives every sampled request a seed. | The Metal port decoded greedily only, so `temperature` had no effect. In agent use that produced word-for-word repetition loops. Greedy output is unchanged. | | #3876 | Engine | Wrap a Gyro file without its PLE table: map only the head and tail ranges the GPU reads. | Gyro-M: `wrapped 91.97 GB as 2 overlapping buffers` becomes `wrapped 37.57 GB as 2 separate ranges`, leaving room for a second model or other work. | | #4127 | Engine | Metal decode and prompt kernels for the pair-trellis expert types TQP5/TQP6/TQP7 (GGML types 147-149), the 256-expert router, a CPU reference and parity tests. | These are the types docs/GYRO.md names as the reason Gyro-L is not supported, and the ones the Gyro Coder files use. v0.2.6 cannot load such a file on a Mac; with this PR Gyro Coder-L runs (about 114 tok/s greedy decode here). | | #3231 | Engine | Conversation cache on macOS: checkpoints validate and park on Metal, the memory guard reads available RAM, K/V is described for snapshots, the session fingerprint and restore accept what this engine saves. | v0.2.6 skips parking on Metal (`invalid checkpoint running-state payload`); returning to an 18k-token conversation took 11.3 s, with this PR 0.95 s (restored from the cache in 24 ms). Two concurrent agent conversations on one server (40-task coding set each): 692-1081 s per run without it, 238-380 s with it. | | #3960 | Serve | Tool-call parsing: coerce parameters by declared type and recover the damaged forms Qwen3-coder-style models write (`<=param>` openers, `</NAME>` closers, a parameter name fused with its value, stray stubs). | Fewer failed tool calls and retries in agent runs. | | #4125 | Other | Test fix: `serve/test_server.py::VisionArgs::test_min_tokens_is_passed_only_when_set` fails on v0.2.6 (`'Proc' object has no attribute 'pid'`). | `serve/test_server.py` runs without failures again, so a real regression is not hidden behind a known one. | | #3176 | GUI | Web app layout follows the window: wide windows use the space, narrow screens stack. | Readability of the monitor and chat in wide windows and side panels. | Closed: #3299 (Gyro on Metal). Its kernel work is upstream since v0.2.2/v0.2.3 (672fd99c and following); its remaining commits continue in #3231 and #3876. ## How we run Gyro on a Mac - **Gyro-S / Gyro-M** run on stock Strata (docs/GYRO.md, "On a Mac": `./setup.sh --family gyro --model Gyro-M`). With #3876 the GPU buffers shrink from 92 to 37.6 GB; with #4126 sampling works; with #3231 agent conversations are parked and restored. - **Gyro Coder-L** (agentionai/Qwen3.8-Flash-Next-Gyro-Coder-GGUF) uses the pair-trellis types 147-149, which stock v0.2.6 does not have. It runs with #4127: build the Metal engine from that branch and pack the file the same way as Gyro-M (Hadamard-folded pack, expert profile, `--spec 2` with the MTP draft, `--ple-io direct`). - **Gyro-L** uses the same types (docs/GYRO.md). A run of Gyro-L on #4127 is being verified; results will follow here. ## Validation Apple Silicon, 128 GB unified memory, Gyro-M TQ2_0 (Gyro Coder-L TQ3_0 for #4127): greedy output bit-exact against v0.2.6 (against the same stack without the PR for #4127, since v0.2.6 cannot load the file), decode speed within 2 %, and for sampling seed 1 != seed 2 / seed 1 == seed 1. Details and the exact revision are in each PR.
Author
Owner

@mnott commented on GitHub (Oct 25, 2026):

Gyro-L on a Mac: verified with #4127, details in https://github.com/Niko1221/Strata/pull/4127 (pack, flags, a correct greedy answer, first decode run 35.5 tok/s).

<!-- gh-comment-id:6400544401 --> @mnott commented on GitHub (Oct 25, 2026): Gyro-L on a Mac: verified with #4127, details in https://github.com/Niko1221/Strata/pull/4127 (pack, flags, a correct greedy answer, first decode run 35.5 tok/s).
Author
Owner

@mnott commented on GitHub (Oct 25, 2026):

Gyro-L decode speed on Apple Silicon (128 GB unified memory), greedy, 256 tokens, 3 runs each, --spec 2 with the MTP draft, expert cache 64:

Build tok/s GPU buffers peak RSS drafts accepted
this PR alone (on v0.2.6) 76.5 (first, cold) / 101.4 / 97.1 wrapped 108.32 GB as 2 overlapping buffers 60.4 GB 162 of 166
this PR + #3876 (PLE wrap), --ple-io direct 106.4 / 106.4 / 106.1 wrapped 53.92 GB as 2 separate ranges 61.3 GB 160 of 168

The 35.5 tok/s in my previous comment was a single cold 80-token run.

<!-- gh-comment-id:6400814524 --> @mnott commented on GitHub (Oct 25, 2026): Gyro-L decode speed on Apple Silicon (128 GB unified memory), greedy, 256 tokens, 3 runs each, `--spec 2` with the MTP draft, expert cache 64: | Build | tok/s | GPU buffers | peak RSS | drafts accepted | |---|---|---|---|---| | this PR alone (on v0.2.6) | 76.5 (first, cold) / 101.4 / 97.1 | `wrapped 108.32 GB as 2 overlapping buffers` | 60.4 GB | 162 of 166 | | this PR + #3876 (PLE wrap), `--ple-io direct` | 106.4 / 106.4 / 106.1 | `wrapped 53.92 GB as 2 separate ranges` | 61.3 GB | 160 of 168 | The 35.5 tok/s in my previous comment was a single cold 80-token run.
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:6660053755 --> @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).
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#1809
No description provided.