mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3932] [Engine] Run Qwen3.6-35B-A3B on the Mac (Metal) engine #1681
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1681
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @keithhu1982 on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3932
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
Run Qwen3.6-35B-A3B on an Apple Silicon Mac with the Strata engine.
Today the Mac engine runs no Qwen3.6 model at all. Qwen3.6-35B-A3B (GGUF architecture
qwen35moe) is the only Qwen3.6 model Strata supports on any backend, and it runs on NVIDIA and AMD only:src/qwen35/is CUDA/HIP.STRATA_HAVE_QWEN35is not defined there, sostrata --familieslists onlyqwen4exp, and aqwen35moefile is refused atmodel_family_not_supported.Windowis built for the Flash-Next shapes.docs/QWEN36.md,docs/MAC.mdanddocs/MODELS.mdall say the Mac engine does not run it.Out of scope here: other Qwen3.6 models such as the dense Qwen3.6-27B, which Strata does not run on any backend. This issue is only about bringing the existing 35B-A3B support to the Mac.
Who needs it: Mac users with 64 GB. Flash-Next only fits there as Q2_0. Qwen3.6-35B-A3B fits as UD-Q6_K_XL (32.6 GB), which is close to lossless, and it reads pictures.
I have a working port on a local branch (not published yet) and would like to agree the scope before opening pull requests.
What the port does (all Metal-only; nothing under
src/,include/,setup.pyorserve/changes):metal/src/qwen35/, that definesstrata::qwen35::run.metal/CMakeLists.txtdefinesSTRATA_HAVE_QWEN35for the Metalstrata, so the existing family switch ingenerate.cpproutesqwen35moefiles to it.metal/kernels/q36/: rms norm with prepared planes, a 256/top-8 router, dense full-context attention with M-RoPE, MTP concat, prompt glue, and a matmul2d prompt attention.gdn.metalandgdn_prompt.metalget an opt-in function constant (12,GDN_SILU_Z) for the silu output gate. When it is unset, the output is bit-identical (hashed against HEAD;gdn_parityandgdn_prompt_parityare unchanged).strata-visionwith M-RoPE.<think>blocks from history../setup.sh --family qwen36 --model UD-Q6_K_XL(metal/setup_q36.pyand a few lines insetup_mac.py).Measured on an M5 Pro with 64 GB, macOS 26.5, UD-Q6_K_XL. llama.cpp is the pinned commit 3cf03257, Metal build, same file.
--mtp 2)The decode gemv and MoE kernels run at 264-297 GB/s, which is about the memory ceiling.
Correctness, against llama.cpp Metal one token at a time, 10 parity prompts x 128 steps:
--mtp 0/2/3give identical tokens.metal/tests/q36_*), plus a synthetic qwen35moe GGUF generator for GPU tests that need no download.Proposed scope and split (one problem per PR):
[Engine]the GDN silu function constant (small, opt-in).[Engine]the Metal qwen35moe engine path and its tests.[Other]Mac setup for--family qwen36, plus docs.Limits / not done:
moe_downkernels that the Mac engine does not have, and Q8_0 (37.8 GB) is untested.coop_k4fallback should apply.--parallel,logit_biasor SAVE/RESTORE.Questions for you:
Window) acceptable?What do you do today instead?
On the Mac: Flash-Next Q2_0 through Strata, or Qwen3.6-35B through MLX servers (oMLX), at about 71 tok/s decode and 1,420 tok/s prompt on the same Mac with a 4-bit MLX file.
@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:
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
@github-actions[bot] commented on GitHub (Oct 24, 2026):
Thanks, this follows the format now.
@keithhu1982 commented on GitHub (Oct 29, 2026):
Hi @Niko1221, a gentle ping, no rush. Would you be open to this, and is the 3-PR split above OK? Happy to adjust or close if it doesn't fit your plans. Thanks!