Issues / #3297

#3297 [Engine] gfx1201 (RX 9070, 16 GB): batched prompt read stalls when 7 tokens are left; 0.1.45 and 0.1.45.3 (follow-up to #579)

open · @JustPowell · 3 コメント · GitHub で見る

Setup & installServer & APIAMD / HIPModels & quants

本文

Follow-up to #579 (closed in the stale sweep; it asked for a new issue if it still happens on 0.1.44 or later). The same stall still happens here on 0.1.45 and on 0.1.45.3, and there's a very regular trigger: **every hang happens when the prompt's last batched step has 7 tokens left.**

## Pattern

The client is an automated loop. It sends short OpenAI-API requests: about 3-4K-token prompts, `max_tokens` 1500, `reasoning_effort: "none"`, no conversation reuse. Each request either finishes or hangs on the last step of the batched prompt read:

| prompt tokens | progress line when it stopped | tokens left |
|---|---|---|
| 3,898 | `reading the prompt: 3,891 of 3,898` | **7** (hung) |
| 4,012 | `4,005 of 4,012` | **7** (hung) |
| 3,079 | `3,072 of 3,079` | **7** (hung) |
| 3,127 | `3,126 of 3,127` | 1 (finished) |
| 3,909 | `3,908 of 3,909` | 1 (finished) |

Every hang where I could see the prompt length had 7 tokens left, and every request I saw finish had 1 left. Two more hangs stopped at token 4142 and token 2948, but I don't have their prompt lengths. After roughly 280 s the watchdog ends the engine (exit -6, `no progress for 60 s ... reading the prompt (batched), done up to token N`; once also -9 via `engine_silence_s`). The restarted engine then reads the same prompt fine.

## What I ruled out

Each change below gave the same hang at a 7-token tail:

- Strata v0.2.0-beta (engine 0.1.45.3) and v0.1.45 (engine 0.1.45), both built locally with setup
- `--spec 4 --spec-min-p 0.5 --mtp ...` (the default) and `--spec 2 --spec-min-p 0.5` without `--mtp`
- `--max-context 65536` (about 500-600 MiB VRAM free, LOW warning) and `--max-context 16384 --vram-reserve-mib 3072` (about 2.9-3.0 GiB free when the request began)
- `STRATA_RESIDENT_HEADROOM_GIB=10`; the PLE direct probe was fine (39-55K rows/s)

- `STRATA_PLE_BATCH=0` (the workaround from #541), set in the config's `env`: still hangs, at token 4393 of the batched prompt read on 0.1.45

Not tried yet: THP off and `STRATA_ARENA_PIN_GIB=0` (the other asks from #579). As in #579, the GPU also drives the desktop (KDE Plasma, Wayland).

## Environment

- GPU: AMD Radeon RX 9070 series (gfx1201, 16 GB), the only GPU, also driving the desktop
- ROCm 7.2.4, kernel 6.18.55-2-cachyos-lts (CachyOS), THP `always`
- CPU: Ryzen 7 9800X3D, 32 GB RAM (30 GiB usable), swap on
- Model: Coder IQ1_M (`coder-iq1_m`, native pack), `--expert-cache auto --prefill auto --kv int8 --resident-experts`

## Stall report (0.1.45)

```
strata serve: no progress for 60 s during a request (reading the prompt (batched), done up to token 3891) - stopping the engine so the server starts it again (issue #29)
strata serve: stall report (engine 0.1.45): stage "reading the prompt (batched), done up to token 3891" for 62 s; 0 layers served since the last finished step (0 = stopped, more = slow)
  VRAM free when this request began: 2910 MiB
  expert pool: epoch 15024, batch epoch 15024: 24 of 24 jobs claimed, 24 done; 7 of 7 workers parked, 7 sleeping; mode 0
  expert pool threads: w0=sleeping w1=sleeping w2=sleeping w3=sleeping w4=sleeping w5=sleeping w6=sleeping; host idle for 89743 ms
  verify window (last window, not the current stage): 1 tokens at position 3183, host at layer step 48; the GPU rang 48; flags: served 48, plan (A) 48, copies (B) 48
  threads waiting on the disk (state D): 0 of 33
  memory: 9519 MiB resident, 8260 MiB in swap, 10605 MiB RAM available; 3341958 major page faults so far
```

Engine command line:

```
strata --serve --pack .../packs/coder-iq1_m --native .../Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00001-of-00002.gguf --ple-gguf .../Qwen3.8-Flash-Next-GSQ-RCO-IQ1_M-00002-of-00002.gguf --expert-profile data/expert-profile-coder.bin --expert-cache auto --prefill auto --spec 2 --spec-min-p 0.5 --max-context 16384 --kv int8 --resident-experts --vram-reserve-mib 3072 --vision
```

The 0.1.45.3 stall reports look the same, with `VRAM free when this request began: 2944 MiB`. Happy to run THP off, `STRATA_ARENA_PIN_GIB=0` or other diagnostics, and to attach the full engine log.

関連リンク

インストール・モデル・リリースへのサイト内リンク。