mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[GH-ISSUE #579] AMD/HIP RX 9070 XT (gfx1201) stalls during batched prompt ingestion on ROCm 10.0 #272
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#272
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @s91402001 on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/579
Summary
On an AMD Radeon RX 9070 XT (
gfx1201) under Ubuntu 24.04, Strata's HIP engine stalls during batched prompt ingestion. The 60-second watchdog reports no progress and aborts the engine; OpenCode then receives:This was still reproducible after upgrading Strata to v0.1.38 and installing AMD ROCm 10.0.0 for gfx1201. A short OpenAI-compatible request succeeds; a long prompt hangs during batched prefill.
Environment
v0.1.38, commit99f3dbd0.1.38, locally built HIP engine, targetgfx1201gfx1201gfx1103(Strata config selects GPU 0, the RX 9070 XT)6.17.0-40-generic10.0.0-4for gfx12017.15.26333-0000000amdgpu-dkms 7.1.3.31500000, firmware31.50amdgpu 6.16.13(the new DKMS driver has been installed but not yet tested after reboot)--expert-cache auto --prefill 512 --spec 4 --spec-min-p 0.5 --max-context 131072 --kv int8 --kv-resident 32768 --mmap-expertsSTRATA_PLE_BATCHis unset for the current ROCm 10 build.Reproduction
reading the prompt (batched)and the watchdog aborts the engine after 60 seconds without progress.A short API request succeeds. A synthetic prompt of about 21.5K tokens was also tried.
Observed failure
With the ROCm 10 build, the server log reported:
The engine log contains the corresponding stall report. At the time, it reported about 20 GiB of RAM available and effectively no swap use; this does not look like ordinary system-RAM exhaustion.
The earlier ROCm 7.2.4 log shows the same stall class at multiple layers (for example layers 5, 14, 16, 20, 23, 27 and 38), also during batched prompt ingestion. That older log predates the ROCm 10 cleanup/reinstall, so the attached logs should be read with their timestamps in mind.
What I tried
--prefill autoand--prefill 512; the stall persisted.gfx1201; the stall persisted.STRATA_PLE_BATCH=0; it did not prevent the reported failure./opt/rocm/core-10.0, and verified the binary loads ROCm 10 HIP/hipBLAS/rocBLAS libraries. A short API request succeeded./tmp/strata-rocm10.logoccurred before I noticed that cleaning up ROCm 7 had removed ROCm 10 files; ROCm 10 was subsequently reinstalled. Please treat that run as a useful but not fully clean A/B result.Attachments
strata-iq2_xs.log— engine log with repeated stall reports./tmp/strata-rocm10.log— server output from the ROCm 10 run, including the 21.5K-token request and watchdog error.strata-iq2_xs.log
strata-rocm10.log
@Niko1221 commented on GitHub (Oct 3, 2026):
Thanks, very clear report. This isn't the hang 0.1.38 fixed (#382 stalled at the end of a chunk); yours stops inside the chunk. #541 and #613 also have KV streaming (
--kv-resident 32768) on a gfx1201 card while reading a prompt, so that's where we're looking.Two things would help: does the long prompt still stall with
--max-context 32768and no--kv-resident(the KV cache then stays in VRAM, no streaming)? And please paste the stall report lines the engine writes intostrata-iq2_xs.logjust before theno progressline of the ROCm 10 run.@s91402001 commented on GitHub (Oct 4, 2026):
Follow-up tests against #579 and #605
I ran a controlled PLE I/O comparison on the same host and engine using a fixed 9,209-token prompt. Each trial started a fresh server/engine; the only A/B setting changed was
--ple-io.99f3dbd; local HIP engine 0.1.38 forgfx1201gfx1201), with Radeon 780M (gfx1103) as the secondary GPU; Strata selected GPU 06.17.0-40-genericamdgpumodule reports7.1.3.31500000rt/dev/nvme0n1p2, ext4,rotational=0)--expert-cache auto --prefill 512 --spec 4 --spec-min-p 0.5 --max-context 131072 --kv int8 --kv-resident 32768 --mmap-experts--ple-inflightremained at its default of 256.The same synthetic request was sent sequentially in each trial: 9,209 rendered prompt tokens,
max_tokens=1, no tools. The content was generated with seed579605; its content SHA-256 isac27c4521cd3d79d73d4c3288d51fba7f108af6c22cbb601517703279cc491ee. The exact API request is attached asfixed-request.json.directdirectmmapmmapThe
mmapfailures do not match the specific #605 case where--ple-io directon rotational storage deadlocks and--ple-io ramresolves it. The model is on NVMe, and changing fromdirecttommapdid not prevent the stall.At the watchdog in the retained repeated
mmaprun, Strata reported 0 layers served, 0 GPU doorbells, and 0 of 0 expert-pool jobs claimed. Near-watchdog process snapshots showed five engine threads inR, two HIP threads inkfd_wait_on_events, noD/folio_wait_bit_commonthreads, about 24 GiB of available system RAM, and an unchanged per-process read-byte counter across the three captures. GPU 0 utilization was reported as 3% in those captures; VRAM allocation was 97%. This differs from #605's block-I/O-wait signature and remains consistent with a HIP/GPU-side batched-prefill stall such as #579, but does not establish the root cause.Stall report from the ROCm 10
strata-iq2_xs.logThe requested excerpt from the original engine log is attached as
stall-report-rocm10.txt. The original log prints the watchdogno progressline immediately before the stall report:I also tried
--no-pleas a diagnostic ablation, but this native IQ2_XS load path rejects it before engine startup:--native requires --ple-gguf (the PLE key is native too). I could not obtain a valid no-PLE comparison with this pack.The PLE reader self-test passed (1/1; about 13 seconds):
strata-iq2_xs.log
stall-report-rocm10.txt
@Niko1221 commented on GitHub (Oct 4, 2026):
Thanks again. Reading the code, the batched prompt path has no GPU wait on a host flag and doesn't copy from pageable memory. Your stalled layers (5, 14, 16, 20, 23, 27, 38) are mostly not the full-attention layers where KV streaming does its work, so we can't tell yet whether
--kv-residentis the cause or only goes with the long prompts. 0.1.39 adds two switches to narrow it down:STRATA_PF_STEP_SYNC=1: the prompt path waits for the GPU after each step and logs any step over 250 ms. A stall then names the step it's in: the K/V staged from RAM, the K/V append, or a layer's experts. It's slower and meant only for this test.STRATA_KV_HOST_DMA=1(AMD builds only): during a prompt, no GPU kernel writes the RAM copy of the K/V; it is copied over by DMA instead. Same answers.If you can, please run the long prompt with
STRATA_PF_STEP_SYNC=1, then withSTRATA_KV_HOST_DMA=1, and also once withGPU_PINNED_MIN_XFER_SIZE=1000000(it turns off ROCm's in-place locking of pageable copies, the idea behind #640). Paste thepf-stepand stall-report lines.dmesg -T | grep -iE "amdgpu|timeout|MES|reset|fault"right after a stall would tell a GPU reset from a host stall. Your system also runs the 6.16 kernel's amdgpu with the DKMS 7.1.3 driver installed but not loaded; a reboot onto it before the next runs would rule that out.@s91402001 commented on GitHub (Oct 4, 2026):
Thanks for the 0.1.39 diagnostics. This run set was performed with the DKMS driver loaded: both
/sys/module/amdgpu/versionandmodinfo -F version amdgpureport7.1.3.31500000on kernel6.17.0-40-generic.I built Strata v0.1.39 (
6f32ec070f23ced9f50e704d854d775da52591ab) as a local HIP engine forgfx1201, linked against ROCm 10 in/opt/rocm/core-10.0/lib. All four runs used the same fixed 9,209-token request (max_tokens=1, no tools); each started a fresh server/engine. PLE I/O remained the defaultdirect, with--ple-inflight 256. Only the listed environment variable changed in each diagnostic run.STRATA_PF_STEP_SYNC=1-6; watchdog at batched layer 21, chunk token 8704STRATA_KV_HOST_DMA=1-6; watchdog at batched layer 17, chunk token 3584GPU_PINNED_MIN_XFER_SIZE=1000000-6; watchdog at batched layer 25, chunk token 1536The stall report for all three failures has
0 layers served,0 of 0 jobs claimed, GPU rang 0, andthreads waiting on the disk (state D): 0 of 33. Available RAM was approximately 23–24 GiB.STRATA_KV_HOST_DMA=1andGPU_PINNED_MIN_XFER_SIZE=1000000did not prevent the stall.With
STRATA_PF_STEP_SYNC=1, the engine emitted nostrata pf-step:lines before the watchdog. The stall remained at layer 21 / chunk token 8704; no completed step over 250 ms was reported before it stopped progressing. The stall report also recorded 0 of 33 threads waiting in D state and 0 GPU doorbells for the current chunk.I ran the requested command immediately after each stall
:
I found no GPU reset, ring timeout, or GPU fault signature. The ring buffer does contain
amdgpu_amdkfd_restore_userptr_worker [amdgpu] hogged CPU for >10000uswarnings, with the reported count reaching 131 by the first capture and 259 by the last. The attached dmesg files are matching ring-buffer history since boot, so older entries repeat in later captures.pf-step-and-stall-lines.txtcontains the requested step/stall excerpts. The fixed request and prompt hash are also included.dmesg-captures.txt
pf-step-and-stall-lines.txt
@Niko1221 commented on GitHub (Oct 6, 2026):
0.1.40 adds the post-store fence from #697 to the HIP doorbell kernels, which may be what stalls the batched prompt. Could you try it? If it still stalls, please also try transparent huge pages off and STRATA_ARENA_PIN_GIB=0 and post the log.
@s91402001 commented on GitHub (Oct 7, 2026):
Tested 0.1.40.1 on an RX 9070 XT (gfx1201): the 40K prompt completed 3 of 3, no stall — plus a speed-isolation matrix
Thank you for the reply and for adding the #697 fence in 0.1.40. I rebuilt the engine from the v0.1.40.1 tag and ran the test you asked for: the long prompt three times, upstream defaults. It completed three of three with no stall, so the THP-off /
STRATA_ARENA_PIN_GIB=0fallback was not needed. Details and a speed-isolation matrix below.1. Test environment
always [madvise] never/opt/rocm/core-10.0)82f46a8c) with-DSTRATA_ENABLE_HIP=ON,CMAKE_HIP_ARCHITECTURES=gfx1201,STRATA_PREFILL_MMQ=ON,STRATA_NATIVE_EXPERTS=ON--native), MTP draft layer, expert-profile,--expert-cache auto(7507 of 24576 expert slots resident)0f1390bd(#697) adds__threadfence_system()after the store indoorbell_ring,doorbell_publishanddoorbell_publish_res2. Test conditions
--prefill 512 --spec 4 --spec-min-p 0.5 --mtp --max-context 131072 --kv int8 --kv-resident 32768 --mmap-expertsSTRATA_*/HSA_*/GPU_*from the environment; my 0.1.39 workarounds (hipEventQuery polling,STRATA_PREFILL_SINGLE_STREAM) are off (kept on a local branch)max_tokens: 64, temperature: 0no progress for N s during a request ... - stopping3. Results — no stall, three of three
"no progress" appears 0 times in all three engine logs and the watchdog snapshot files are empty. The #697 fence looks like it fixed the stall on this machine — I did not need the THP-off /
STRATA_ARENA_PIN_GIB=0fallback.(One note:
max_tokens: 64ran out while the model was still reasoning, so the replies were thinking-only completions (choices: null); I did not verify the needle answer itself — the measurement here is the prompt read.)4. Speed isolation matrix
The baseline read (40,051 tokens at 145–151 tok/s) looked slow for this card, so I ran the same request on the same machine, one variable at a time (one fresh server per arm, all completed, no stall) for your reference:
--prefill 512--mmap-experts--prefill auto(2 runs)--mmap-expertsSTRATA_HIP_WMMA=1--mmap-experts--mmap-experts--mmap-experts@Niko1221 commented on GitHub (Oct 7, 2026):
Please retest on 0.1.40, which adds a fence on the doorbell ring (#697). Then with THP off and STRATA_ARENA_PIN_GIB=0, and send the log with the stall line. Same cluster as #541, #613.
@s91402001 commented on GitHub (Oct 8, 2026):
Reproduced on 0.1.40.1: the stall fires when a desktop client renders on the same GPU (12/12), and never when the desktop is idle (0/23)
Answering your three asks in order. (1) Retested on 0.1.40.1 with the #697 fence (commit
0f1390bdconfirmed in my build): with the desktop idle, my original config completes — 3/3 at--prefill 512, 143.7–145.2 tok/s. (2) THP off +STRATA_ARENA_PIN_GIB=0: 3/3 completed, 137.0–145.3 tok/s, THP state recorded per run. (3) Stall lines: I found a deterministic trigger, and the clue was my own observation —start.shstalls when I run it in the local graphical terminal, but never when I launch it from an SSH session. The difference is not the session: it is whether the desktop is rendering. With one animating window the 40K prompt stalls 12/12; with the desktop idle it completed 0 stalls in 23 runs. Stall lines, thread snapshots and per-run kernel logs are in the attached bundle.1. Test environment
amdgpumodule7.1.3.31500000(DKMS); ROCm user-space 10.0.082f46a8c),-DSTRATA_ENABLE_HIP=ON,CMAKE_HIP_ARCHITECTURES=gfx1201; fence commit0f1390bdconfirmed (__threadfence_system()after the store indoorbell_ring,doorbell_publish,doorbell_publish_res)--native), MTP draft layer,--expert-cache auto(7507 of 24576 expert slots resident)2. Test conditions
--expert-cache auto --spec 4 --spec-min-p 0.5 --mtp --max-context 131072 --kv int8 --kv-resident 32768 --mmap-experts— the same KV-streaming setup as #541/#613 — with--prefillas given per runSTRATA_*/HSA_*/GPU_*); one immutable 40,051-token request (max_tokens: 64,temperature: 0, sha2562ccf63fd…); each run is a fresh server startvkcuberendering continuously — an xcb client, so the path is Vulkan → Xwayland → mutter compositing, ~5% GPU busy)no progress for N s during a request ... - stopping; per run the harness recordsgpu-samples.jsonl(1 sgpu_busy_percent+ load liveness),kernel-window.log(journalctl -kfor the run window) and the launching shell's session context3. The trigger: desktop rendering on the same GPU
All tests, same request, one fresh server per rep, GNOME session logged in throughout:
--prefillenv -ilogin envSTRATA_ARENA_PIN_GIB=0env -ilogin envThe stall line, identical fingerprint to my original report in all twelve runs:
gpu-samples.jsonl: card busy sits at 5% the whole request in the load runs and 0% in the idle runs — the only controlled differencekfd_wait_on_events; the engine waits on the GPU, not on the disk (0 threads in D state)kernel-window.logfor the stall runs: no amdgpu reset / ring timeout / fault message; the watchdog aborts the engine (exit -6, HTTP 503) and the next request works again — per-request, not a dead GPU4. Reproduction recipe
vkcube(~5% GPU busy at 60 fps)strata servewith the §2 config (--prefill auto) and send the 40K promptno progress for 60 s ... layer N of the prompt chunk from token T— 12/125. What does not change the outcome
--prefill 512(my original config): stalls 3/3 under loadSTRATA_ARENA_PIN_GIB=0: stalls 3/3 under load6. Your retest asks, on 0.1.40.1 with the desktop idle
--prefill 512, upstream defaults, THP defaultmadvise: 3/3 completed, 143.7–145.2 tok/s (default-512-0108-{1,2,3})never, set via sysfs, recorded per run) +STRATA_ARENA_PIN_GIB=0,--prefill 512: 3/3 completed, 137.0–145.3 tok/s (thpoff-pin0-{1,2,3})no progressappears 0 times; the §3 runs are the stall lines you asked for, now reproducible on demand7. Speed note
With the desktop idle,
--prefill autocompletes in 105.7–141.5 s for the 40K prompt (283.1–378.8 tok/s in the six bundled runs; my fastest daytime run was 470.7 tok/s). A 30K run also recalled the needle correctly. Speed-isolation logs (chunk size, WMMA,--mmap-expertsOOM) are kept in my internal report — happy to attach them if useful.8. Log bundle
Attached:
followup-01401-upload.zip— 24 runs: the §3 testsdesk-load-{1,2,3},ssh-load-{1,2,3},load-512-{1,2,3},load-pin0-{1,2,3},desk-idle-{1,2,3},ssh-idle-{1,2,3}and the §6 retestsdefault-512-0108-{1,2,3},thpoff-pin0-{1,2,3}. Per run:config.json,run-metadata.json(THP/kernel/rocm-smi + launching shell's session context),engine.log,server.log,watchdog-snapshots.jsonl,gpu-samples.jsonl,kernel-window.log,result.json;runtime-snapshots.jsonlonly for the twelve stall runs.request.jsonat the bundle root is the single immutable request used by every run (sha2562ccf63fd…). Plusdmesg-thpoff-0108.txt, the harnessdiagnostic_followup_01401.py, andSHA256SUMS.txt.followup-01401-upload.zip
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.