mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1691] gfx906: 0.1.41 verify timeouts ("timed out at layer N"); prompt-read stalls are pre-existing (clamp blame retracted) #676
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#676
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 @KevinX8 on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1691
Bisected a gfx906 regression to the q8_1 clamp pair. Reporter setup below, A/B table, then logs.
Setup
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906(docs/AMD_HIP.md recipe)--kv-resident 32768,--resident-budget-gib 43, MTP--spec 4 --spec-min-p 0.5, single GPUcudaStreamCreateWithPriority/cudaDeviceGetStreamPriorityRangeininclude/strata/platform/hip_compat/strata_hip.h(a732a19fixed the neighbouringcudaEventBlockingSyncbut not these;src/core/mtp.cpp:423-424uses them)What 0.1.41 does (
fb58e0d)Two failure signatures on the same box where 0.1.40.x serves all day:
Unrecoverable native verification failure: verify: timed out at layer 10and... layer 26; its GPU waits were released— decode stalls (18 -> 4.7 tok/s) then the engine exits, twice.no progress for 60 s during a request (reading the prompt (batched): waiting for the GPU (attention, router) ...— twice more.Decode on the runs that complete: ~19.8 tok/s vs ~26-28 tok/s on 0.1.40.x.
Bisect (v0.1.40.4 base, same flags/config/machine)
ccd657a(HC norm scratch): 3 stories, 29.0/27.6 tok/s after warmup, no hang. Exonerated.e372d4f+7a0e302(q8_1 clamps, isolated, noccd657a): 4 consecutive prompt-read hangs across mixed traffic — a 27-token prompt dying 12 tokens in, a 2.6K prompt dying 5 tokens from the end, a 3.8K prompt dying 5 tokens from the end — every onewaiting for the GPU (attention, router), each ended by the 60 s watchdog + engine restart. Nothing else served in between except the hangs.So the clamp pair alone reproduces a hang on gfx906. The 0.1.41 verify-timeout crashes were not re-tested to 5x (stopped per the reporter's rule after the bisect landed); they may be the same root cause surfacing in decode.
Happy to re-run anything on this card (single MI50 16 GB, can build any commit with the one-line patch above).
@KevinX8 commented on GitHub (Oct 9, 2026):
Correction — the bisect conclusion above is wrong; please disregard the clamp blame.
no progress for 60 s ... waiting for the GPU (attention, router)stall report in my logs by the binary that was running: clean v0.1.40.4 (only the compat-header defines added) 6, 0.1.41 5, .4+ccd657a / .4+clamps 4, and clean 0.1.40 also has them. So it happens on every build. Every report shows the host under memory pressure (1.5–4.9 GB RAM available, often 2–8 GB in swap, with--resident-budget-gib 43on a 60 GB box). My clamp run just hit a bad stretch of them.-Rpass-analysis=kernel-resource-usage: occupancy is the same for all 363 kernels. fused_gr has identical resources; gdn_step_norm_multi_kernel<false,true> spills 196 instead of 168 bytes/lane; s26_swiglu_q8_1_kernel uses 17 VGPRs instead of 16. Only the numerics of overflowing blocks change.Unrecoverable native verification failure: verify: timed out at layer N(layers 26, 17, 0, 10, 47). Every one I can attribute came from 0.1.41, and I saw none in about 3 h on 0.1.40.4. That one is not bisected yet.Sorry for the noise. I'll update here if I bisect the verify timeout properly.
@KevinX8 commented on GitHub (Oct 9, 2026):
Root cause found - and it is not the clamps (already retracted) nor the kernel. It is
805088d(#1194: file-tier hot-fraction rule), bisected by revert-screening on plain v0.1.40.4:805088dreverted: 346 / 364 tok/s on the same prompts, 0.0 s of KFD queue suspension, no stalls.f236dbbgfx906 fixes): 358-366 tok/s, 0.0 s suspended idle and per prompt, survives a 6 GiB RAM hog, full benchmark clean.Mechanism, all measured on 1x MI50 16 GB (gfx906), ROCm 10.0 and 10.1, 60 GB RAM, 43 GiB resident budget (12.4 GiB of experts read from files, ~6.6 GiB of file-cache room):
805088dchanged file_cache_keeps to a 5%-of-read-bytes rule, so this box reads the file tier THROUGH the page cache. 0.1.40 required room >= all read bytes, so it read UNBUFFERED.Why your Tesla-P100 measurement does not transfer: on NVIDIA, reclaim around registered memory does not suspend all GPU queues, so through-cache wins there down to 7% room. On AMD the reclaim side effect (queue eviction) dwarfs the read-speed benefit.
Suggested upstream fix: on HIP builds, do not apply the 5% hot-fraction rule (keep hot_fraction=1.0 / the old room >= read_bytes rule), or pick unbuffered whenever a large registered arena exists. Separately, mlock'ing the HIP-registered arena (my 5-line patch in expert_source.cpp: lock_off = 0 on HIP) halves the damage as hardening but does not fix the throughput - the cache churn itself costs ~2x prompt speed (175 vs 360 tok/s with the arena locked).
Happy to open a PR gating the rule on HIP, and to re-run anything on this card.
@KevinX8 commented on GitHub (Oct 9, 2026):
Fix verified on v0.1.41 itself and PR opened: #1752 (from KevinX8:fix-1691-hip-filetier-pin). v0.1.41 + the 11-line HIP-only patch, same box/config, full benchmark: 316-366 tok/s prompt reads, 0.0-0.1 s suspended per prompt, 0 stalls, 0 verify timeouts - including through a 6 GiB RAM-pressure phase. Leaving the box on plain v0.1.40 for daily use until this lands.
@Niko1221 commented on GitHub (Oct 10, 2026):
Thanks for the correction. The prompt-read stalls you list all show 1.5-4.9 GB of RAM available and 2-8 GB in swap with --resident-budget-gib 43 on a 60 GB box: that is the host-memory-pressure mechanism of #1705/#750 (the GPU's queues suspended while the kernel reclaims pinned pages). Please try HSA_USERPTR_FOR_PAGED_MEM=0 in the env block, a smaller --resident-budget-gib (e.g. 32) and swap off or vm.swappiness low, and see whether both the stalls and the verify timeouts go away; if the timeouts remain with the RAM free, a bisect of the verify timeouts between 0.1.40.4 and 0.1.41 is the useful next step. The cudaStreamCreateWithPriority defines you needed on 0.1.40 are not needed on main (that code is skipped in the gfx906 build; we compile-checked it). v0.1.42 also adds the opt-in query swizzle and reduce12 attention switches from 0FL01.
@KevinX8 commented on GitHub (Oct 10, 2026):
Ran your three suggestions on stock v0.1.42 (same box: MI50 16 GB, ROCm 10.0, 60 GB RAM). Stock 0.1.42 at 43 GiB first, for the baseline: 4 watchdog stalls in one benchmark run, first prompt kills the engine - still broken, same as 0.1.40.4/0.1.41.
805088drevert-screen (plain .4 + revert = 346/364 tok/s, 0.0 s suspended, on the unlocked paced path), the evidence keeps pointing at cached file-tier reads -> reclaim -> HMM invalidation -> queue suspension, rather than pressure alone: the 35 GiB budget run on 0.1.40.4 (12.6 GB RAM free, no pressure) stalled the same way.No verify timeouts in either test run (they were always rarer than the stalls). PR #1752 still applies cleanly to the v0.1.42 tree. Happy to run the swappiness arm if you still want it.
@KevinX8 commented on GitHub (Oct 10, 2026):
Third arm done (swappiness 10, runtime-only, stock v0.1.42, 43 GiB budget): prompt 1 at 66.6 tok/s (367 s), prompt 2 at 44.0 tok/s, 1 watchdog stall. Still broken.
Full table on stock v0.1.42:
So two arms stabilize but none restores speed; only the
805088drevert (or 0.1.40) gives 350+ tok/s with 0.0 s suspended. No verify timeouts appeared in any of these runs either (they remain the rarer signature). PR #1752 stands.@KevinX8 commented on GitHub (Oct 12, 2026):
Retested on the new v0.1.43 (same box: 1x MI50 16 GB gfx906, ROCm 10.0, 60 GB RAM, 43 GiB resident budget, default checkpoints off the table - config is the one setup writes plus --max-context 262144 --kv q4_0). Summary: stock v0.1.43 is still broken here, and PR #1752 fixes it.
Stock v0.1.43 (805088d's 5% rule still in file_tier_unbuffered): the file tier reads through the page cache, the GPU is suspended 130 s of the first 168 s prompt (46 tok/s), and the engine is dead on prompt 2 (watchdog: waiting for the GPU). Same failure as v0.1.40.4, v0.1.41 and v0.1.42.
v0.1.43 + PR #1752 (now only the 6-line HIP rule change; I dropped the mlock part - you were right that it needs
ulimit -lraised, and the benchmark does not need it; locked memory 0.0 GiB in this run):Without the PR, Strata is effectively unusable on an MI50 16 GB at this configuration: every release since 0.1.40.2 (the first one containing
805088d) dies on the first real prompt or crawls. The workarounds you suggested do stabilise it, but at roughly a sixth of the speed (tested on v0.1.42: HSA_USERPTR_FOR_PAGED_MEM=0 -> 51-61 tok/s, budget 32 -> 54 cold / 168 warm, vm.swappiness=10 -> 44-67 tok/s with 1 stall). Only unbuffered file-tier reads give the 350+ tok/s that v0.1.40 had on this card, and the PR is the only change that gets 0.1.4x back there.Limits of what I measured: one box, one card, one RAM size (60 GB). The mechanism (unpinned HMM arena + cached reads -> reclaim -> queue suspension) should hold for any gfx906 with a resident budget close to RAM, but I have not tested other RAM sizes. One thing the PR does not fix: while a large RAM hog is actively running with no request in flight, the GPU is still suspended for most of that window (the #1705/#750 pressure case); the next request after it is unaffected.
@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.
@KevinX8 commented on GitHub (Oct 14, 2026):
Trying to get you that stock-0.1.44 proof run, but stock v0.1.44.1 does not build for gfx906 on a ROCm-only box (no CUDA toolkit here, and 0.1.43 built fine with the same flags). New breakage from the NVFP4 work:
CMakeLists.txt:1449addsstrata_mmq_w4a4(mmq_nvfp4_w4a4.cu) unconditionally tostrata_mmq, which the HIPstratabinary links. That TU pullsggml-cuda/vendors/cuda.h-><cuda_runtime.h> <cuda.h> <cublas_v2.h> <cuda_bf16.h>, none of which exist without the CUDA toolkit:Build flags (same as my working 0.1.43 gfx906 build):
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906 -DSTRATA_PORTABLE=ON, ROCm 10.1 clang,CMAKE_PREFIX_PATH=/opt/rocm/core-10.1.git show v0.1.43:CMakeLists.txt | grep -c w4a4= 0, so this is new in 0.1.44.The W4A4 path is documented as RTX-50-only with runtime fallback to W4A8, so gating that TU on CUDA availability (or the CUDA compiler) should be safe for the gfx906 build. Point me at a flag if one already exists, otherwise I need that gate before I can run the stock proof you asked for. Worktree is sitting at the v0.1.44.1 tag ready to rebuild.
@KevinX8 commented on GitHub (Oct 14, 2026):
Stock v0.1.44.1 proof, same box (1x MI50 16 GB gfx906, ROCm 10.1, 60 GB RAM, standard 256k setup config, resident budget 43 GiB). The issue still applies verbatim.
Build note (disclosed): stock v0.1.44.1 does not compile for gfx906 on a ROCm-only box (NVFP4 W4A4 TU + qwen35 engine need the CUDA toolkit - see my previous comment). To run stock I gated those two TU blocks on
CMAKE_CUDA_COMPILERin CMakeLists.txt. Engine sources are byte-identical to the tag (git diff --stat: 1 file, CMakeLists.txt +12/-0). Neither skipped object can run here anyway (W4A4 is RTX-50-only with W4A8 fallback; qwen35 runs only for qwen35moe models; this run is IQ4_XS Qwen3.8-Flash-Next).Stock v0.1.44.1 takes the cached path, same as every release since 0.1.40.2:
2x ~4k prompts (streaming, client-measured):
Totals for the run: 1 watchdog stall, 0 verify timeouts (it died before verifying anything). Same signature as stock v0.1.43 on this box (46 tok/s, dead on prompt 2). With only the 6-line HIP file-tier rule from #1752 on top of 0.1.43, the same prompts run 356-365 tok/s with 0 stalls - I have not re-run the full benchmark on .1, but nothing in .1 touches
file_tier_unbuffered(the 5% rule is still at expert_source.cpp:530), so there is no reason to expect different stock behavior.The v0.1.43.1 watchdog grace (10 s of file-tier activity) cannot cover this: the GPU is gone for tens of seconds at a time, not one silent second.
@KevinX8 commented on GitHub (Oct 14, 2026):
Supplement to the proof above, with the exact version line you asked for, plus the retest on the rebased PR since that comment:
That line is from the same stock run (log
strata-0144-stock.log, engine binary built from the v0.1.44.1 tag, only CMakeLists.txt gated as disclosed).And the other half, measured since: v0.1.44.1 + PR #1752 (rebased, two commits) on the same box and config - file tier reads unbuffered, prompt 2 at 273 tok/s warming to 287-300, 300-token story 26.5 tok/s decode, 0 stalls / 0 verify timeouts. A same-session back-to-back A/B with forced restarts and identical prompts gives 0.1.43+PR 286/297 tok/s vs 0.1.44.1+PR 276/289 tok/s with identical 25.7 tok/s decode, so no version gap - the 356-365 figures in my earlier comment were quieter-box runs. Stock on the same box and day: 18 tok/s wall with a mid-prompt watchdog kill, dead on prompt 2.
So: still reproduces on stock 0.1.44.1, still fixed by the PR's 6-line rule change. Please reopen.