mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4706] [Engine] Support 256-expert pruned models (Coder) on Apple Silicon Metal backend #2152
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#2152
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 @earthking11 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4706
Problem Statement
Currently, running the expert-pruned coding model
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-Coder-GGUF(which removes 50% of routed experts, leaving 256 experts per layer at 3.5 bpw) on Apple Silicon (Metal) fails during the hardware initialization stage with:While Strata already ships with
data/expert-profile-coder.binand supports this 256-expert architecture on NVIDIA CUDA/SYCL backends, the Metal backend does not yet support it.Given that this 29.6 GB resident working set fits comfortably in 32 GB and 64 GB Mac Unified Memory configurations (leaving plenty of headroom for 64K/128K KV caches), bringing support for 256-expert models to Metal would be a massive quality-of-life improvement for Apple Silicon users.
Root Cause Analysis in Metal Backend
Geometry validation in C++ host (
metal/src/engine/window.cpp):NEXPis statically defined as a compile-time constant:Window::init(line 440), it strictly enforces: For the Coder model,g.n_expert == 256, triggering the error.Hardcoded strides & loop unrolling in Metal shaders:
metal/kernels/router.metal(line 12) &metal/kernels/prompt.metal(line 18):The softmax reduction and top-10 selection assume 512 logits across a SIMDgroup of 32 lanes via 16 unrolled iterations (
32 * 16 = 512):plan_bodyallocations similarly assume 512 threads per block.Suggested Approach / Next Steps
n_expert == 256alongside the existing 512-expert path inrouter.metalandprompt.metal(e.g., 8 unrolled steps instead of 16).Window::initand internal buffer allocations inwindow.cpp/prompt_chain.incto acceptg.n_expert == 256when paired withexpert-profile-coder.bin.Environment
ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-Coder-GGUF(Shard 1: 29.6 GB, Shard 2: 28.8 GB)@github-actions[bot] commented on GitHub (Oct 30, 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 30, 2026):
Thanks, this follows the format now.