[GH-ISSUE #2898] [Other] Swift 1.5 on a Mac (opt-in --family swift, IQ3_S) #1171

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

Originally created by @oceanio on GitHub (Oct 17, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2898

Area

[Other] (anything else, including setup and installation)

What do you want to do?

Run Swift 1.5 on a Mac. On 0.2.0-beta, docs/MAC.md still says "The Swift and Coder releases are not set up on Mac
yet", and metal/setup_mac.py only takes --family qwen|unsloth.

What blocks it. Swift's two shards cut through a layer: in IQ3_S, layer 14's gate is in shard 1, and its up and
down are in shard 2. Its shard 1 also holds the n-gram table. The Metal engine maps one file (window.cpp wraps
shard 1), so it cannot read Swift as it is.

What already works.

  • metal/tools/metal_repack.py (written for Unsloth's 4-6 shards) works on Swift's 2 shards as they are.
  • tools/iq_pack.py already handles Swift's layout. It writes the 96 F32 routers as BF16, and all 96 are exact.
  • The Metal gemv has IQ4_NL and IQ4_XS, which Swift uses for attn_output, ssm_out and ffn_down_shexp.
  • The router read takes F32.
  • The engine needs no change.

What I propose (opt-in). ./setup.sh --family swift sets up Swift 1.5 IQ3_S: setup repacks it like Unsloth's
files, and leaves images off. Without --family swift nothing changes, including the size menu, the original model
and Unsloth's files. Only IQ3_S is offered, because it is the only size I could measure. I have this on a branch:
https://github.com/oceanio/Strata/tree/feat/mac-swift

  • One commit on main e88ee39d (0.2.0-beta): metal/setup_mac.py, strata_control/mac_fit.py (Swift's pack size,
    an optional family argument; the app, setup.py's Control mode and strata launch see no change),
    tools/test_setup_mac.py (30 tests, 6 new, all pass) and docs/MAC.md.

Measured on an M5 Max (128 GB, macOS 26.7.1) with SC117's abliterated Swift 1.5 IQ3_S
(SC117/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF, the same file layout as UkisAI's release). The model
was resident, with --spec 2 and MTP. Engine 0.1.45 with the Mac build fix (the one 0.2.0 carries), installed by the
branch's setup end to end (--gguf-dir).

Swift 1.5 IQ3_S Qwen3.8-Flash-Next IQ3_S (SC117), same Mac
Decode, 4 prompts up to 200 tokens, greedy 93.1 / 97.2 / 110.4 / 104.6 tok/s 94.3 / 95.1 / 109.2 / 108.5 tok/s
6.8K-token needle, 3 documents 3 of 3 3 of 3
Prompt, 6.8K tokens (warm) 1,636-1,731 tok/s 1,651-1,767 tok/s
3 short reasoning questions, thinking on 3 of 3 right 3 of 3 right

On 0.2.0-beta (an engine build with other Metal changes of mine on top, not part of this) Swift loads, answers 28-,
2,257- and 16,180-token prompts and finds the needles.

Not tested.

  • UkisAI's own files: I only have SC117's.
  • A comparison with the CUDA or HIP engine on the same Swift file. I have no NVIDIA or AMD card.
  • The KL harness.
  • Quality beyond 16K tokens, streaming on a Mac under ~96 GB, sizes other than IQ3_S.

Questions.

  1. Would you take this as an opt-in setup change?
  2. Could someone with a CUDA or HIP card give reference outputs for Swift IQ3_S, for example greedy text on a few
    prompts? I would then compare the Metal engine against them, the way docs/MAC.md does for the original model.

The branch is ready; I will open the PR once the scope is agreed here.

Originally created by @oceanio on GitHub (Oct 17, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/2898 ### Area [Other] (anything else, including setup and installation) ### What do you want to do? Run Swift 1.5 on a Mac. On 0.2.0-beta, docs/MAC.md still says "The Swift and Coder releases are not set up on Mac yet", and `metal/setup_mac.py` only takes `--family qwen|unsloth`. **What blocks it.** Swift's two shards cut through a layer: in IQ3_S, layer 14's gate is in shard 1, and its up and down are in shard 2. Its shard 1 also holds the n-gram table. The Metal engine maps one file (`window.cpp` wraps shard 1), so it cannot read Swift as it is. **What already works.** - `metal/tools/metal_repack.py` (written for Unsloth's 4-6 shards) works on Swift's 2 shards as they are. - `tools/iq_pack.py` already handles Swift's layout. It writes the 96 F32 routers as BF16, and all 96 are exact. - The Metal gemv has IQ4_NL and IQ4_XS, which Swift uses for `attn_output`, `ssm_out` and `ffn_down_shexp`. - The router read takes F32. - The engine needs no change. **What I propose (opt-in).** `./setup.sh --family swift` sets up Swift 1.5 IQ3_S: setup repacks it like Unsloth's files, and leaves images off. Without `--family swift` nothing changes, including the size menu, the original model and Unsloth's files. Only IQ3_S is offered, because it is the only size I could measure. I have this on a branch: https://github.com/oceanio/Strata/tree/feat/mac-swift - One commit on main e88ee39d (0.2.0-beta): `metal/setup_mac.py`, `strata_control/mac_fit.py` (Swift's pack size, an optional `family` argument; the app, setup.py's Control mode and `strata launch` see no change), `tools/test_setup_mac.py` (30 tests, 6 new, all pass) and `docs/MAC.md`. **Measured** on an M5 Max (128 GB, macOS 26.7.1) with SC117's abliterated Swift 1.5 IQ3_S (`SC117/Swift-1.5-Qwen3.8-Flash-Next-GSQ-RCO-abliterated-GGUF`, the same file layout as UkisAI's release). The model was resident, with `--spec 2` and MTP. Engine 0.1.45 with the Mac build fix (the one 0.2.0 carries), installed by the branch's setup end to end (`--gguf-dir`). | | Swift 1.5 IQ3_S | Qwen3.8-Flash-Next IQ3_S (SC117), same Mac | |---|---|---| | Decode, 4 prompts up to 200 tokens, greedy | 93.1 / 97.2 / 110.4 / 104.6 tok/s | 94.3 / 95.1 / 109.2 / 108.5 tok/s | | 6.8K-token needle, 3 documents | 3 of 3 | 3 of 3 | | Prompt, 6.8K tokens (warm) | 1,636-1,731 tok/s | 1,651-1,767 tok/s | | 3 short reasoning questions, thinking on | 3 of 3 right | 3 of 3 right | On 0.2.0-beta (an engine build with other Metal changes of mine on top, not part of this) Swift loads, answers 28-, 2,257- and 16,180-token prompts and finds the needles. **Not tested.** - UkisAI's own files: I only have SC117's. - A comparison with the CUDA or HIP engine on the same Swift file. I have no NVIDIA or AMD card. - The KL harness. - Quality beyond 16K tokens, streaming on a Mac under ~96 GB, sizes other than IQ3_S. **Questions.** 1. Would you take this as an opt-in setup change? 2. Could someone with a CUDA or HIP card give reference outputs for Swift IQ3_S, for example greedy text on a few prompts? I would then compare the Metal engine against them, the way docs/MAC.md does for the original model. The branch is ready; I will open the PR once the scope is agreed here.
Author
Owner

@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:

  1. Re-test on 0.2.0-beta. 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:6271353493 --> @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: 1. Re-test on 0.2.0-beta. 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

@oceanio commented on GitHub (Oct 20, 2026):

Re-tested on 0.2.0-beta. Swift 1.5 is still not set up on a Mac: docs/MAC.md says so and metal/setup_mac.py takes
--family qwen|unsloth only.

What changed since I opened this:

  • #2895 is closed (0.2.0 carries its own Mac build fix), so the branch is now one commit on main e88ee39d.
  • The rebase moved Swift's pack size into strata_control/mac_fit.py, where 0.2.0 keeps the Mac sizes, with an
    optional family argument. Existing callers (the app, setup.py's Control mode, strata launch) are unchanged.
  • tools/test_setup_mac.py: 30 tests pass, 6 of them new.
  • On 0.2.0-beta Swift loads, answers 28- to 16,180-token prompts and finds the needles (on an engine build with other
    Metal changes of mine; this proposal changes no engine code).

The issue body is updated. The question is the same: would you take this as an opt-in setup change
(./setup.sh --family swift, IQ3_S only, images off, nothing else changes)? If yes, I will open the PR.

<!-- gh-comment-id:6283355441 --> @oceanio commented on GitHub (Oct 20, 2026): Re-tested on 0.2.0-beta. Swift 1.5 is still not set up on a Mac: docs/MAC.md says so and `metal/setup_mac.py` takes `--family qwen|unsloth` only. What changed since I opened this: - #2895 is closed (0.2.0 carries its own Mac build fix), so the branch is now one commit on main e88ee39d. - The rebase moved Swift's pack size into `strata_control/mac_fit.py`, where 0.2.0 keeps the Mac sizes, with an optional `family` argument. Existing callers (the app, setup.py's Control mode, `strata launch`) are unchanged. - `tools/test_setup_mac.py`: 30 tests pass, 6 of them new. - On 0.2.0-beta Swift loads, answers 28- to 16,180-token prompts and finds the needles (on an engine build with other Metal changes of mine; this proposal changes no engine code). The issue body is updated. The question is the same: would you take this as an opt-in setup change (`./setup.sh --family swift`, IQ3_S only, images off, nothing else changes)? If yes, I will open the PR.
Author
Owner

@oceanio commented on GitHub (Oct 20, 2026):

/reopen

<!-- gh-comment-id:6283356463 --> @oceanio commented on GitHub (Oct 20, 2026): /reopen
Author
Owner

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

Reopened, thank you. A maintainer will pick it up from here.

<!-- gh-comment-id:6283358122 --> @github-actions[bot] commented on GitHub (Oct 20, 2026): Reopened, thank you. A maintainer will pick it up from here.
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:6659325904 --> @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#1171
No description provided.