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

未关闭
#7,263 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
C++
星标
11.6k
派生
1k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Niko1221/Strata 的其他 Issue

查看 Niko1221/Strata 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。