mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2537] [Bug]: Metal: IQ2_XS (GSQ-RCO) fails to load — 6 IQ1_M expert tensors have no Metal path; oversized wrap exits instead of falling back to streaming #1028
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#1028
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 @cuijs2026 on GitHub (Oct 15, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2537
What happened
The GSQ-RCO IQ2_XS file cannot run on a Mac: the Metal engine dies during load, and after working around that it dies again on a Metal buffer limit. IQ2_XS is not offered by
metal/setup_mac.py(MAC_MODELS), so this is about manual installs of a size the PC path supports (CUDA/HIP have IQ1_M kernels) but the Metal port does not.Step 1 — IQ1_M has no Metal path. With the stock files from ISTA-DASLab's repo (pinned revision
ed59f92), the engine exits while loading shard 1:Type 29 = IQ1_M. The file is mixed-precision; 6 expert tensors use it:
metal/src/ref_quant.cpp(block_bytes) printsref: unknown type 29andstd::exit(2);metal/kernels/moe.metalhas noT_IQ1_Minstantiation either (GU_SETcovers Q2_0/IQ3_XXS/IQ2_XXS/IQ2_XS/IQ2_S/IQ3_S/IQ4_XS/K-quants/Q8_0). The CPU kernels note the same gap:src/kernels/cpu/iq_avx512.cppsays "IQ1_M stays on ggml-cpu (no shipped model has IQ1_M expert rows)" — this IQ2_XS file does ship them, so the assumption no longer holds for the GSQ-RCO IQ2_XS release. CUDA has it (src/kernels/cuda/iq_kernels.cudq_iq1_m), so the same file runs on PC.Step 2 — single-buffer wrap limit. As a workaround I converted those 6 tensors offline to Q8_0 (dequantized with ggml's
dequantize_row_iq1_m, re-quantized with the q8_0 reference rule; all other tensors copied byte-identical; pack rebuilt withtools/iq_pack.py). WithSTRATA_METAL_STREAM=0(as on a resident Q2_0) the larger shard 1 (43,472,687,392 bytes) then fails to map as one MTLBuffer:Context::wrap(metal/src/mtl_rt.mm) exits(4) instead of falling back.STRATA_METAL_STREAM=1avoids it (experts stream from the SSD), which is presumably whysetup_mac.pychooses stream by size — but a wrapped start on an oversized file should either fall back to streaming or fail with a message that says so.What I expected
ref_quant.cpp+ the moe/prompt expert kernels, like CUDA), orsetup_mac.pyoffers IQ2_XS with the conversion done at setup time, or at least fails with "this size needs IQ1_M, which Metal does not have" instead of a bareref: unknown type 29.STRATA_METAL_STREAM=1) rather thanexit(4).Workaround (works, measured below)
ref-exact IQ1_M dequant → q8_0 reference quantize; ~+4.2 GB file size; verified: 1223 tensors, names/order unchanged, every other tensor byte-identical,iq_pack.pyrebuilds cleanly)."env": {"STRATA_METAL_STREAM": "1"}in the config.mtp_pack.py --experts q2_0output is shared (the Metal loader reads<mtp dir>/../mtp-q2_0.gguf).Measurements (M4 Pro 64 GB, macOS, engine 0.1.44.1-metal)
Both sizes, same machine,
tools/strata_bench.py(thinking off, medians):Note the comparison also mixes two differences: IQ2_XS streams (its pack does not wrap) while Q2_0 stays resident, and Q2_0's
STRATA_METAL_STREAM=0is the faster path on this Mac. Long-context recall (tools/needle_bench.py, 32K, depths 10/50/90): 3/3 found for both sizes. Memory with IQ2_XS running: engine RSS 35.4 GB, no swap growth, 128K context (--max-context 131072) held a 124K-token prompt at 246.8 tok/s prefill.Also worth noting for the "6 IQ1_M tensors" case: they are only in layers 8/13/37, gate+up; downs are Q2_0 like every other layer — a per-tensor fallback (dequant those rows once at load) would also cover it.
Engine log
and, after the workaround:
@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:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.