[GH-ISSUE #5416] [Engine] Metal, 48 GB Mac: Unsloth v3.1 UD-Q2_0 streamed from SSD decodes garbage tokens (0.2.11 / engine 0.1.57) #3236

Open
opened 2026-11-07 14:39:05 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @martinshane on GitHub (Nov 6, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5416

Desktop app, Terminal or source?

Terminal (strata install + strata launch)

What happened

Unsloth's Dynamic v3.1 UD-Q2_0 (revision d9620119) loads and decodes at ~28 tok/s, but every output is garbage tokens until max_tokens. A trivial prompt, "What is the capital of France? Answer in one short sentence." (thinking off, temperature 0.7), returned:

mmmidamp*ardgbangmothersamamomampualatedm:mmm和m[yymmanngmualmmmmilmm*mmmmmi*avmiaam ucaveationalmapaative...

Thinking-on requests do the same (long runs of mmmm). strata update's test start passes ("answered one token"), so it doesn't catch this.

Expected: normal text. The same Mac ran the ISTA-DASLab GSQ-RCO Q2_0 pack correctly in October (engine 0.1.50, streaming).

What I ruled out (all still garbage):

  • STRATA_ROUTE_TAIL_SKIP=0
  • moving the .experts streaming copy aside, so experts stream from the repacked GGUF itself
  • file integrity: all three shards passed setup's SHA-256 checks, metal_repack.py --verify reported "1223 tensors, SHA-256 identical to the source shards", and stream_experts.py --verify reported "48 layers x 512 experts identical to the GGUF"

My guess: the Metal streaming path for the v3.1 expert types (i-quant / Q2_0 experts with Q5_0 / IQ4_NL downs). mac_fit lists UD-Q2_0 as "not measured streaming", and the Mac measurements I could find are resident on a 128 GB M5 Max.

Second bug found on the way (install)

strata install --family unsloth --model UD-Q2_0 stops at step 6 after the full download:

[X] the desktop app's installer only runs its bundled preparation tools; .../terminal/0.1.57/python/bin/python3 .../terminal/0.1.57/metal/tools/metal_repack.py is missing or out of date.

In Control mode setup.py run() only allows tools under ROOT/tools and ROOT/tools/dsv41, but mac_tools_dir() is ROOT/metal/tools, so metal_repack.py and then stream_experts.py are refused even though both ship in the bundle. Still the same on origin/HEAD (9f7d977d). Workaround: run both tools by hand with the same arguments, write their .done marks, then rerun strata install.

Smallest steps or command that reproduce it

strata install --family unsloth --model UD-Q2_0 --context 65536 --vision yes --mtp off --no-start --yes
# (run metal_repack.py / stream_experts.py by hand, see above)
strata update --yes            # engine 0.1.50 -> 0.1.57
strata launch --model ud-q2_0 --family unsloth --context 64k --vision gpu --drafting off --tune skip --access local --port 8190 --set STRATA_METAL_KEEP_FREE_GB=10 --no-tui
curl http://127.0.0.1:8190/v1/chat/completions -d '{"messages":[{"role":"user","content":"What is the capital of France? Answer in one short sentence."}],"max_tokens":120,"chat_template_kwargs":{"enable_thinking":false}}'

Reproduction status

Reproduces every time (3 engine starts, every request).

Strata version

strata 0.2.11 (build 0.1.57), engine component 0.1.57-macos-arm64-metal

Graphics card, memory and system

Apple M4 Pro, 48 GB unified memory, macOS 26.6.2, internal SSD

Model, size and settings

Qwen3.8-Flash-Next (Unsloth) UD-Q2_0 v3.1, context 65536, pictures on (GPU), drafting off, STRATA_METAL_KEEP_FREE_GB=10. Experts stream from the SSD (arena 14.1 GB with the .experts copy, 7.4 GB without).

Logs

Engine command line and stream lines:

engine started: .../0.1.57-macos-arm64-metal/strata --serve --pack .../packs/unsloth-ud-q2_0 --native .../metal/unsloth-ud-q2_0-metal.gguf --ple-gguf .../Qwen3.8-Flash-Next-UD-Q2_0-00003-of-00003.gguf --native-dense-gguf .../metal/unsloth-ud-q2_0-metal.gguf --expert-profile .../data/expert-profile.bin --expert-cache 64 --prefill auto --spec 2 --suffix-draft 0 --max-context 65536 --mmap-experts --vision
strata generate: native pack: ... token embedding IQ4_XS in mapped host memory (322 MiB, 0.2 s)
strata generate: PLE on, table 320001536 rows of ...-00003-of-00003.gguf
strata metal stream: expert arena 14.12 GB, 8764 slots in 2 size classes ...
strata metal: decode window on Apple M4 Pro: ... streamed from the SSD (experts) (41.8 GB), 65664 cells, PLE on, ready in 6663 ms
strata serve: prompt 104 tokens = 0 reused + 104 read in 5496 ms (18.9 tok/s), 1131 generated in 40900 ms (27.7 tok/s), drafts accepted 0 of 0

iq_pack output: conversions.json: 291 tensors converted to the engine's form (96 exact, 195 rounded; max |err| 0.0262), compat-bf16: 195 tensors, 1.18 GiB.

I've deleted the files for now to free disk, but I'm happy to re-download and test a fix.

Originally created by @martinshane on GitHub (Nov 6, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5416 ### Desktop app, Terminal or source? Terminal (`strata install` + `strata launch`) ### What happened Unsloth's Dynamic v3.1 **UD-Q2_0** (revision d9620119) loads and decodes at ~28 tok/s, but every output is garbage tokens until max_tokens. A trivial prompt, "What is the capital of France? Answer in one short sentence." (thinking off, temperature 0.7), returned: ``` mmmidamp*ardgbangmothersamamomampualatedm:mmm和m[yymmanngmualmmmmilmm*mmmmmi*avmiaam ucaveationalmapaative... ``` Thinking-on requests do the same (long runs of `mmmm`). `strata update`'s test start passes ("answered one token"), so it doesn't catch this. Expected: normal text. The same Mac ran the ISTA-DASLab GSQ-RCO Q2_0 pack correctly in October (engine 0.1.50, streaming). What I ruled out (all still garbage): - `STRATA_ROUTE_TAIL_SKIP=0` - moving the `.experts` streaming copy aside, so experts stream from the repacked GGUF itself - file integrity: all three shards passed setup's SHA-256 checks, `metal_repack.py --verify` reported "1223 tensors, SHA-256 identical to the source shards", and `stream_experts.py --verify` reported "48 layers x 512 experts identical to the GGUF" My guess: the Metal **streaming** path for the v3.1 expert types (i-quant / Q2_0 experts with Q5_0 / IQ4_NL downs). mac_fit lists UD-Q2_0 as "not measured streaming", and the Mac measurements I could find are resident on a 128 GB M5 Max. ### Second bug found on the way (install) `strata install --family unsloth --model UD-Q2_0` stops at step 6 after the full download: ``` [X] the desktop app's installer only runs its bundled preparation tools; .../terminal/0.1.57/python/bin/python3 .../terminal/0.1.57/metal/tools/metal_repack.py is missing or out of date. ``` In Control mode `setup.py run()` only allows tools under `ROOT/tools` and `ROOT/tools/dsv41`, but `mac_tools_dir()` is `ROOT/metal/tools`, so `metal_repack.py` and then `stream_experts.py` are refused even though both ship in the bundle. Still the same on origin/HEAD (9f7d977d). Workaround: run both tools by hand with the same arguments, write their `.done` marks, then rerun `strata install`. ### Smallest steps or command that reproduce it ``` strata install --family unsloth --model UD-Q2_0 --context 65536 --vision yes --mtp off --no-start --yes # (run metal_repack.py / stream_experts.py by hand, see above) strata update --yes # engine 0.1.50 -> 0.1.57 strata launch --model ud-q2_0 --family unsloth --context 64k --vision gpu --drafting off --tune skip --access local --port 8190 --set STRATA_METAL_KEEP_FREE_GB=10 --no-tui curl http://127.0.0.1:8190/v1/chat/completions -d '{"messages":[{"role":"user","content":"What is the capital of France? Answer in one short sentence."}],"max_tokens":120,"chat_template_kwargs":{"enable_thinking":false}}' ``` ### Reproduction status Reproduces every time (3 engine starts, every request). ### Strata version strata 0.2.11 (build 0.1.57), engine component 0.1.57-macos-arm64-metal ### Graphics card, memory and system Apple M4 Pro, 48 GB unified memory, macOS 26.6.2, internal SSD ### Model, size and settings Qwen3.8-Flash-Next (Unsloth) UD-Q2_0 v3.1, context 65536, pictures on (GPU), drafting off, STRATA_METAL_KEEP_FREE_GB=10. Experts stream from the SSD (arena 14.1 GB with the .experts copy, 7.4 GB without). ### Logs Engine command line and stream lines: ``` engine started: .../0.1.57-macos-arm64-metal/strata --serve --pack .../packs/unsloth-ud-q2_0 --native .../metal/unsloth-ud-q2_0-metal.gguf --ple-gguf .../Qwen3.8-Flash-Next-UD-Q2_0-00003-of-00003.gguf --native-dense-gguf .../metal/unsloth-ud-q2_0-metal.gguf --expert-profile .../data/expert-profile.bin --expert-cache 64 --prefill auto --spec 2 --suffix-draft 0 --max-context 65536 --mmap-experts --vision strata generate: native pack: ... token embedding IQ4_XS in mapped host memory (322 MiB, 0.2 s) strata generate: PLE on, table 320001536 rows of ...-00003-of-00003.gguf strata metal stream: expert arena 14.12 GB, 8764 slots in 2 size classes ... strata metal: decode window on Apple M4 Pro: ... streamed from the SSD (experts) (41.8 GB), 65664 cells, PLE on, ready in 6663 ms strata serve: prompt 104 tokens = 0 reused + 104 read in 5496 ms (18.9 tok/s), 1131 generated in 40900 ms (27.7 tok/s), drafts accepted 0 of 0 ``` iq_pack output: `conversions.json: 291 tensors converted to the engine's form (96 exact, 195 rounded; max |err| 0.0262)`, `compat-bf16: 195 tensors, 1.18 GiB`. I've deleted the files for now to free disk, but I'm happy to re-download and test a fix.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 6, 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:

  • Fill in "Area".

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

<!-- gh-comment-id:6689933280 --> @github-actions[bot] commented on GitHub (Nov 6, 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: - [ ] Fill in "Area". 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](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#3236
No description provided.