[GH-ISSUE #5487] [Engine] Rope yarn 4x anchored at native + 1M capacity: GPU command buffer never completes (deterministic, Metal, M3 Max) #5457

Open
opened 2026-11-07 20:39:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Qfbxz on GitHub (Nov 7, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5487

Engine issue draft: GPU command buffer never completes with --rope-scaling yarn --rope-scale 4 (1M context)

Area: [Engine] (Mac Metal)
Version: engine 0.1.57 (component 0.1.57-macos-arm64-metal), product 0.2.11
Hardware: Apple M3 Max, 128 GB unified memory, macOS 27.2 (26B123)
Reproducibility: deterministic (3/3 runs), same machine and config

Repro

Model: Qwen3.8-Flash-Next UD-IQ4_XS-v31 (Unsloth GGUF set, repacked native 64.9 GB, PLE shard external).

strata --serve --pack <pack> --native <64.9GB-native> --ple-gguf <shard4> \
  --max-context 1010000 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144 \
  --spec 2 --mtp <rt> ... (full argv in serve log, attached)

Any first prompt (even a tiny one) hangs: the prefill never progresses past position 0.

What the sample shows (full sample attached: r2-yarn4x-gpu-freeze-sample.txt)

Main thread, 100% of 2534 samples:

main -> ... -> strata::prefill::Prefill::run
     -> strata::metal_engine::prompt_run
     -> -[_MTLCommandBuffer waitUntilCompleted]  (Metal)
     -> _pthread_cond_wait

The GPU command buffer submitted by prompt_run never completes. No host-side spin, no OOM
lines (memory checks pass), no engine error - a silent GPU-side hang.

The narrowing (all on the same machine, same corpus/protocol)

config result
--max-context 524288, no rope scaling runs, 599 s prefill, answers
--max-context 1010000, no rope scaling (pure extrapolation) runs, 1189 s prefill, answers
--max-context 1010000 --rope-scaling yarn --rope-scale 2 --yarn-orig-ctx 524288 runs, 1203 s prefill, answers
--max-context 1010000 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144 hangs, 3/3
--max-context 262144 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144, expert-cache 16 / reserve 4096 / conv-cache 0 (full memory headroom), tiny prompt runs, answers

Only the 4x-anchored-at-native configuration at 1M capacity hangs. Yarn 4x alone at the
native 256K capacity with full memory headroom answers fine, and 2x-anchored-at-512K and
pure extrapolation at the same 1M capacity both work. So the hang is the combination
of rope_yarn factor 4.0 with the 1M-capacity buffers, not yarn 4x by itself and not the
1M capacity by itself - pointing at the rope_yarn index/band math or a buffer sized from
it (scale-dependent frequency tables or position buffers) only at scale=4 + 1010000.

Notable

  • ext-factor/attn-factor were the engine defaults (1.0/1.0) in all arms.
  • The 2x@524288 arm passed a 14-task T1-T6 suite at parity with the 256K baseline, so the
    1M capacity itself is fine on this hardware; only the 4x yarn configuration hangs.
Originally created by @Qfbxz on GitHub (Nov 7, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/5487 # Engine issue draft: GPU command buffer never completes with --rope-scaling yarn --rope-scale 4 (1M context) **Area**: [Engine] (Mac Metal) **Version**: engine 0.1.57 (component 0.1.57-macos-arm64-metal), product 0.2.11 **Hardware**: Apple M3 Max, 128 GB unified memory, macOS 27.2 (26B123) **Reproducibility**: deterministic (3/3 runs), same machine and config ## Repro Model: Qwen3.8-Flash-Next UD-IQ4_XS-v31 (Unsloth GGUF set, repacked native 64.9 GB, PLE shard external). ``` strata --serve --pack <pack> --native <64.9GB-native> --ple-gguf <shard4> \ --max-context 1010000 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144 \ --spec 2 --mtp <rt> ... (full argv in serve log, attached) ``` Any first prompt (even a tiny one) hangs: the prefill never progresses past position 0. ## What the sample shows (full sample attached: r2-yarn4x-gpu-freeze-sample.txt) Main thread, 100% of 2534 samples: ``` main -> ... -> strata::prefill::Prefill::run -> strata::metal_engine::prompt_run -> -[_MTLCommandBuffer waitUntilCompleted] (Metal) -> _pthread_cond_wait ``` The GPU command buffer submitted by prompt_run never completes. No host-side spin, no OOM lines (memory checks pass), no engine error - a silent GPU-side hang. ## The narrowing (all on the same machine, same corpus/protocol) | config | result | |---|---| | --max-context 524288, no rope scaling | runs, 599 s prefill, answers | | --max-context 1010000, no rope scaling (pure extrapolation) | runs, 1189 s prefill, answers | | --max-context 1010000 --rope-scaling yarn --rope-scale 2 --yarn-orig-ctx 524288 | runs, 1203 s prefill, answers | | --max-context 1010000 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144 | **hangs, 3/3** | | --max-context 262144 --rope-scaling yarn --rope-scale 4 --yarn-orig-ctx 262144, expert-cache 16 / reserve 4096 / conv-cache 0 (full memory headroom), tiny prompt | runs, answers | Only the 4x-anchored-at-native configuration at 1M capacity hangs. Yarn 4x alone at the native 256K capacity with full memory headroom answers fine, and 2x-anchored-at-512K and pure extrapolation at the same 1M capacity both work. So the hang is the **combination** of rope_yarn factor 4.0 with the 1M-capacity buffers, not yarn 4x by itself and not the 1M capacity by itself - pointing at the rope_yarn index/band math or a buffer sized from it (scale-dependent frequency tables or position buffers) only at scale=4 + 1010000. ## Notable - ext-factor/attn-factor were the engine defaults (1.0/1.0) in all arms. - The 2x@524288 arm passed a 14-task T1-T6 suite at parity with the 256K baseline, so the 1M capacity itself is fine on this hardware; only the 4x yarn configuration hangs.
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#5457
No description provided.