Repository navigation
Conversation
oceanio
force-pushed
the
feat/mac-swift
branch
from
October 22, 2026 01:33
1f300e6 to
8943a2b
Compare
oceanio
pushed a commit
to oceanio/Strata
that referenced
this pull request
Oct 22, 2026
…t 1.5 reads images with its own projector The branch was rebased, so its first commit is already in dev under another hash; the merge brings the images commit: setup_mac.py drops the Swift images-off rule and pins UkisAI's mmproj-Swift in VISION_SHA256, MAC.md's Swift Images line, and the two Swift tests (applied to dev's Swift class; dev's Parallel tests unchanged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Swift's two shards cut through a layer (IQ3_S: layer 14's gate in shard 1, its up and down in shard 2) and its shard 1 holds the n-gram table, so the Metal engine, which maps one file, could not read it. Setup now repacks it with metal/tools/metal_repack.py, as it does for Unsloth's files: whether a model is repacked follows repacks() (shards that cut through layers) instead of the shard count. The n-gram table stays in Swift's shard 1 (ple_shard()). - --family swift takes IQ3_S, the size measured on a Mac (MAC_SWIFT); another size stops setup with what to run. - Images are off for Swift (the encoder is checked with the original model only), with a note when asked for. - The pack, the MTP draft layer and the engine are unchanged: iq_pack writes Swift's 96 F32 routers as BF16 (all exact), and the draft layer is the original model's, as on a PC. - Without --family swift nothing changes: the size menu, the original model and Unsloth's files. Rebased onto 0.2.0: the pack sizes and their notes now live in strata_control/mac_fit.py, so MAC_SWIFT, mac_model() and the family argument of model_need_gb / streams / model_note are there (optional: the app and setup.py's Control mode are unchanged); setup_mac.py re-exports them. Tests: tools/test_setup_mac.py (6 new): the original's and Unsloth's names and repack decision unchanged, Swift's file names, its repack, its engine arguments, IQ3_S with images off, an unmeasured size stopping, and the choices without --family swift. Measured on an M5 Max (128 GB, macOS 26.7.1) with SC117's abliterated Swift 1.5 IQ3_S, engine 0.1.45 with the Mac build fix (the one 0.2.0 carries): decode 93.1-110.4 tok/s on 4 prompts (Qwen IQ3_S 94.3-109.2 on the same Mac), 6.8K-token needles 3 of 3, prompt 1,636-1,731 tok/s, 3 reasoning questions right with thinking on. Not measured: UkisAI's own files, a comparison with the CUDA / HIP engine, the KL harness, contexts over 8K, streaming on a smaller Mac. docs/MAC.md says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Images were off for --family swift because the image encoder had been checked on the Mac with the original model only. Now they follow the same choice as the original (on by default, --vision no turns them off), with Swift's own projector as on a PC: setup.py's family entry names UkisAI's mmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf, and its size and SHA-256 (setup.py's pin) are added to VISION_SHA256. Checked on an M5 Max with SC117's abliterated Swift 1.5 IQ3_S and UkisAI's projector (SHA-256 = the pin), this branch's engine and server, greedy: three test pictures read right (shapes counted by color, an invoice transcribed exactly, five bars ranked). tools/test_setup_mac.py: --family swift --vision yes warns about nothing and the projector's pin equals setup.py's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oceanio
force-pushed
the
feat/mac-swift
branch
from
October 26, 2026 03:37
8943a2b to
f0667df
Compare
Owner
|
Thank you for the Mac setup work. Mac support is part of the Mac plan, which is planned for a later release, with no date yet. This will stay open until then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result
On a Mac,
./setup.shsets up the original Qwen3.8-Flash-Next, Unsloth's UD files and agentionai's Gyro files only;docs/MAC.md says "The Swift and Coder releases are not set up on Mac yet". Swift 1.5 itself runs on the Metal engine,
but setup cannot prepare it: its two shards cut through a layer (IQ3_S: layer 14's gate in shard 1, its up and down in shard 2), shard 1 also holds
the n-gram table, and the Metal engine maps one file.
With this PR,
./setup.sh --family swiftdownloads Swift 1.5 IQ3_S, repacks its shards into one GGUF with the existingmetal/tools/metal_repack.py(as setup already does for Unsloth's files), builds the pack and writes a config. Without--family swiftnothing changes: the size menu, the original model, Unsloth's and Gyro's files.Related discussion
#2898 (feature request). No maintainer reply on scope yet: opened as a draft so the change can be read beside the request.
Approach
repacks()(shards that cut through layers: Unsloth's 4-6, Swift's 2)instead of the shard count. The n-gram table stays in Swift's shard 1.
--familytakesswiftbesideqwen,unslothandgyro.--family swifttakes IQ3_S only, the size measuredon a Mac; another size stops setup with the command to run.
Images follow the original model's choice (on by default,
--vision noturns them off), with Swift's own projectoras on a PC:
setup.py's Swift entry names UkisAI'smmproj-Swift-Qwen3.8-Flash-Next-BF16.gguf, and its size andSHA-256 (
setup.py's pin) are added toVISION_SHA256.strata_control/mac_fit.py(MAC_SWIFT,mac_model(), and an optionalfamilyargument on
model_need_gb/streams/model_note). The existing callers (setup.py's Control mode,tools/strata_mcp.py,strata launch) pass(model, ram)and see no change.iq_packwrites Swift's 96 F32 routersas BF16 (all exact), and the draft layer is the original model's, as on a PC.
--family swiftoption, what is measured, and the Families line.Validation
Re-run on v0.2.6 (2026-10-26). Rebased onto main
4b9e05a2(v0.2.6). Only docs/MAC.md conflicted (upstream rewrote it); the setup commits are the same lines.tools/test_setup_mac.pypasses.The rest of this section is the run on v0.2.2.
Environment: M5 Max 128 GB, macOS 26.7.1, Command Line Tools 27.0 (Apple clang 21).
Passed:
python3 tools/test_setup_mac.pyon 8943a2b (=main011c9e6, 0.2.2, + this PR's 2 commits): 32 tests OK, 6 ofthem new
(the original's and Unsloth's file names and repack decision unchanged; Swift's file names, its repack, its engine
arguments; IQ3_S with
--vision yesand no warning, its projector's pin equal tosetup.py's; an unmeasured sizestopping; the choices without
--family swift).python3 -m unittest tools.test_strata_mcp.MacCatalog tools.test_strata_mcp.Helpers(the tests that importmac_fit): OK on this PR;python3 tools/test_setup_menu.py: OK.repacked file 54.8 GB: decode 93.1-110.4 tok/s on 4 prompts (Qwen IQ3_S 94.3-109.2 on the same Mac), prompt
1,636-1,731 tok/s, 6.8K-token needles 3 of 3, 3 reasoning questions right with thinking on. Measured on the 0.1.45
engine with the Mac build fix that 0.2.0 carries.
main011c9e6, 0.2.2, no engine change;cmake --build build-metal --target strata,0 errors) with the repacked Swift file, through this branch's
serve/server.pyat--max-context 262144: answers ashort question ("Paris"), and
tools/needle_bench.py --lengths 2k,16k,32k --depths 10,50,90finds 9 of 9(1,644 / 15,070 / 31,643 prompt tokens). The same checks passed on 0.2.1.4 (
main9de04cd) before the rebase.three test pictures read right (6 shapes counted by color, an invoice transcribed exactly, 5 bars ranked).
Failed: none observed.
Not run:
tools/test_strata_mcp.pyin full: its fake server uses port 8080, which a running Strata held on this Mac../setup.sh --family swifton 0.2.1.4 (55 GB download and repack). It ran end to end(
--gguf-dir) before the rebase, on 0.1.45 with the Mac build fix.tokens, the KL harness, the Coder release.
Limits
strata launchdo not offer Swift.🤖 Generated with Claude Code