[Engine] gfx1201: fused prompt experts (default since 0.2.15) hang prompt reading on IQ3_XXS; still on 0.2.22

Aperta
#7,263 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start by tracing the gfx12 fused prompt experts enabled by default for IQ3_XXS and the prompt reading path reported at layer 18; compare behavior with STRATA_PF_FUSED=0. Reproduce on gfx1201 with the supplied long-prompt setup and logs, then isolate the fused gate/up and staged fused entry if the build allows it. Done when the fused path completes repeated runs without stalls while retaining its speed benefit.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area: [Engine]

Desktop app, Terminal or source? Source (setup.sh or a build)

Reproduction status: Reproduced locally

What happened

Since 0.2.15, long prompts on my RX 9070 XT sometimes freeze in the middle of a prompt chunk. The GPU's work stays "still running", the host is idle, and after 60 s the watchdog restarts the engine (issue #29 path). Shorter freezes of ~30 s also happen. They recover by themselves and leave nothing in the log; you only see them as a drop in the prompt speed, for example one 33K prompt at 782 tok/s while the other two ran at ~3,170.

It comes from the gfx12 fused prompt experts that 0.2.15 turned on by default for IQ3_XXS on Linux (96fef73d2 / 5410b3bc0):

  • 0.2.12 (engine 0.1.58), with no fused kernels: never stalled, across all my runs since 2026-11-07.

  • 0.2.15 (0.1.61), 0.2.19 (0.1.65) and 0.2.22 (0.1.69), fused at the default: every one stalls within the first benchmark run.

  • 0.2.19 with **STRATA_PF_FUSED=0**: a full run with 0 stalls. The log then says "every chunk runs 48 of 48 layers on the int8 kernels".

0.2.22 still stalls, even with the gfx12 LDS wait + barrier in nw_barrier() (#6515) and DEBUG_HIP_DYNAMIC_QUEUES=0 (both in 0.2.20). Its log says "chunks of 3072 tokens or more run 48 of 48 layers on the fused kernels; shorter chunks run 48 on the staged fused entry."

When it runs, the fused path is clearly faster here: about +10% at 4K, +15% at 32K and +20% at 130K over 0.2.12. So I'd much rather see it fixed than turned off.

Same-day numbers (prefill tok/s, 3 reps from a fresh service restart, community RX 9070 benchmark.py):

prompt

0.2.12

0.2.22 (default)

prompt 0.2.12 0.2.22 (default) 0.2.19 STRATA_PF_FUSED=0
2K 1,459 ~1,470 1,522
4K 1,971 ~2,165 1,868
32K 2,751 3,170 / 782 / 3,165 2,537
130K 2,773 3,335, then a 60 s stall + engine restart 2,479
stalls 0 1 freeze + 1 restart 0

Things I ruled out:

  • Same ROCm on every version. The ROCm wheels in the venv (7.10.0a20251120) date from 2026-10-06 and never changed, so the stable and the stalling engines ran on the same ROCm.

  • Not disk or memory. Every report shows 0 threads in D state, 0 swap, several GB of RAM available, and the expert pool parked with all jobs done.

  • NUMA balancing is off (kernel.numa_balancing=0, one node), so #4866 does not apply.

  • The hang moves around. It has stopped at layers 41, 28, 19 and 18, in chunks starting at tokens 0, 64984 and 113764.

Smallest steps that reproduce it

  1. RX 9070 XT on Linux, Qwen3.8-Flash-Next IQ3_XXS, --max-context 131072 --prefill auto, everything else at the defaults (the engine command is below).

  2. Send ~130K-token prompts a few times (I use the community RX 9070 benchmark.py: lengths 2048, 4096, 32768 and 128000, 3 reps each, plus needles at 128K).

  3. Within one run I get at least one stall; the 60 s ones are in the log as no progress for 60 s.

  4. Set STRATA_PF_FUSED=0 and the same run is clean.

Strata version

0.2.22 (engine 0.1.69), built from source. Also seen on 0.2.15 (0.1.61) and 0.2.19 (0.1.65). Fine on 0.2.12 (0.1.58).

Graphics card, memory and system

  • Card: AMD Radeon RX 9070 XT, 16 GB (gfx1201)

  • CPU and RAM: Ryzen 9 9950X3D, 62 GB of RAM

  • OS: Arch Linux, kernel 7.3.6 (also seen on 7.3.4 and 7.3.5)

  • Drivers: linux-firmware-amdgpu 20261019, mesa 26.3.1, ROCm wheels 7.10.0a20251120

  • Memory settings: THP always, no hugetlb pages (vm.nr_hugepages=0)

Model, size and settings

Qwen3.8-Flash-Next GSQ-RCO IQ3_XXS, with MTP (spec 4). Context 131072, KV int8. Pictures are on, read by the CPU reader. Started by the Terminal's server:

strata --serve --pack <data>/packs/iq3_xxs --native <data>/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf <data>/models/IQ3_XXS/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00002-of-00002.gguf --expert-profile <terminal>/data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <data>/mtp/rt --max-context 131072 --kv int8 --vision --vram-reserve-mib 3072 

The engine picked: prompt chunk auto 16384 tokens with a 96-slot ring, expert cache 3593 slots (5.86 GiB), and the prompt path borrowing 3148 cache slots.

Logs

The stall report from 0.2.22 (engine 0.1.69):

strata serve: no progress for 60 s during a request (reading the prompt (batched): layer 18 of the prompt chunk from token 64984) - stopping the engine so the server starts it again (issue #29) strata serve: stall report (engine 0.1.69): stage "reading the prompt (batched): layer 18 of the prompt chunk from token 64984" for 60 s; 0 layers served since the last finished step (0 = stopped, more = slow)   VRAM free when this request began: 3132 MiB   the prompt's GPU work (GPU 0) was still running   expert pool: epoch 82149, batch epoch 82149: 98 of 98 jobs claimed, 98 done; 15 of 15 workers parked, 15 sleeping; mode 0   expert pool threads: w0..w14=sleeping; host idle for 80165 ms   verify window (last window, not the current stage): 4 tokens at position 130227, 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 44   memory: 48667 MiB resident, 0 MiB in swap, 5741 MiB RAM available; 9 major page faults so far   GPU work paused by the graphics driver: 4016 ms since the engine started, 161 ms in this request (the AMD driver pauses all of the engine's GPU work while Linux moves memory the GPU uses)   2 s later:   the prompt's GPU work (GPU 0) was still running   (unchanged: pool parked, host idle for 82165 ms, 0 in D, 0 ms paused by the driver in the last 2 s) strata: released the verify window's GPU waits (#267): the GPU finished in 0 ms 

The earlier ones (same signature each time):

stall report (engine 0.1.61): stage "reading the prompt (batched): layer 41 of the prompt chunk from token 0" for 60 s stall report (engine 0.1.65): stage "reading the prompt (batched): layer 28 of the prompt chunk from token 64984" for 60 s stall report (engine 0.1.65): stage "reading the prompt (batched): layer 19 of the prompt chunk from token 113764" for 60 s 

I'm happy to run a debug build, an env switch or a branch on this card. If there's a way to turn the fused gate/up and the staged fused entry on separately, I can test each one alone to narrow it down.

Lingua principale
C++
Stelle
11.6k
Fork
1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Niko1221/Strata

Tutte le issue di Niko1221/Strata

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.