Skip to content

HIP (gfx1030): intermittent 'verify: timed out at layer N (#267)' with UD-Q4_K_XL — repro data #649

Closed as not planned

Description

@jollyroger1480

Environment

  • RX 6950 XT (gfx1030), ROCm 7.1, HIP backend, engine 0.1.37 and current main (99f3dbd) — same behavior on both
  • 31 GB RAM, UD-Q4_K_XL (--native GGUF-in-place, --resident-budget-gib), --spec 2, STRATA_HC_SPLIT=0 (the default hc staging path also hangs on this card)
  • Model: the Huihui abliterated re-split of Qwen3.8-Flash-Next UD-Q4_K_XL (needs the split-shard arch-guard fix from native dense: run the architecture guard only on the first shard of a split #648 to load at all)

Symptom

Decode usually starts and can generate 24+ tokens correctly, then a verify window dies:

strata generate: verify: timed out at layer 11; its GPU waits were released but the GPU did not finish within 5 s (#267)
  • Always at a full-attention layer (3, 11, 13, 25, 35, 46 seen — every N was (L+1)%4==0).
  • Intermittent: same command, same budget: one run completes 24 tokens, the next hangs on the first verify round.
  • When the release message says 'the GPU finished' the spin ended at release; when it says 'did not finish within 5 s' the graph was still running 25 s in.
  • Frequency scales with --resident-budget-gib: 12 GiB hung 2/2 runs; 7 GiB roughly 1-in-3.

Ruled out

Suspect

Timing-sensitive flag handshake between the CPU expert pool and the verify window's spin kernels — the warm-page-cache runs (fast PLE, fast prefill) hang more often than the first cold run, which completed. Happy to run any instrumented build or capture rocm-smi/rid traces if useful.

Activity

  1. Niko1221 commented on Oct 3, 2026

    @Niko1221
    Owner

    Thanks for the careful repro data. The pattern (always a full-attention layer, more often with a larger --resident-budget-gib and a warm page cache, not fixed by --sync-every-layer) points at the handshake between the CPU expert pool and the verify window's GPU waits on HIP. We'll look there and come back with an instrumented build for you to run.

  2. Niko1221 commented on Oct 4, 2026

    @Niko1221
    Owner

    0.1.39 adds an opt-in trace for this, STRATA_VERIFY_TRACE=1. It records:

    • each verify window's handshake: when the GPU rang each layer, when the CPU served it, and the seq / flag / A / B words with host timestamps;
    • GPU breadcrumbs, a timestamp at each stage of each layer, written to host-mapped memory so they can still be read while the GPU hangs.

    On a timeout it prints all of this before and after the GPU waits are released, so we can see where the GPU stopped and whether it moved again once released. One note from reading your report: the layers you saw (3, 11, 13, 25, 35, 46) aren't all full-attention layers. In this model those are every 4th layer (3, 7, 11, ...), so 13, 25 and 46 are linear-attention layers. We're no longer treating full attention as the common factor.

    Could you build 0.1.39 (or main once it's tagged) and run the same command with STRATA_VERIFY_TRACE=1 until it hangs? Please paste the strata verify trace block from the log. If you have time, three A/B runs (one setting each) would also help:

    1. STRATA_VERIFY_COHERENT=1: the handshake words in explicitly coherent host memory.
    2. STRATA_DOORBELL_STORE=1: the GPU stores each layer's ring value instead of a read-modify-write over PCIe.
    3. STRATA_RESIDENT_PIN=0 with the same --resident-budget-gib 12.

    Also, dmesg | grep -iE "amdgpu|kfd|ttm" right after a hang, and rocm-smi --showuse while it hangs (0% busy vs 100% tells a stalled queue from a spinning kernel).

  3. jollyroger1480 commented on Oct 4, 2026

    @jollyroger1480
    ContributorAuthor

    Update from your trace build (thanks — it's a nice instrument): 4/4 clean runs on 0.1.39+ with the trace enabled and our tuned low-RAM flags (STRATA_RESIDENT_PIN=0, STRATA_ADAPT_NOWAIT=1, --resident-budget-gib 7, --kv int8, --expert-cache 2048, ctx 2048), decode 0.22-0.64 tok/s on 31 GB RAM. The hang has not reproduced since we stopped pinning the resident budget (STRATA_RESIDENT_PIN=0): on this 31 GB box mlock-ing the arena was both the slowdown and, we suspect, the trigger — memory pressure stalls the CPU pool thread, which misses the verify handshake window. If that holds up on your side, the signature is worth a look: budget-pinned + low RAM = pool starvation presenting as #267 timeouts. (Separately: your fix/split-shard-arch-guard from #648 is what lets this abliterated re-split load at all — still needed on latest main.)

  4. added a commit that references this issue on Oct 4, 2026
  5. added a commit that references this issue on Oct 7, 2026
  6. xoykor commented on Oct 10, 2026

    @xoykor

    Additional repro: 6700XT gfx1031 (runs as gfx1030, ROCm gfx103X-all wheels), CachyOS, 32GB RAM, coder-IQ1_M, engine 0.1.41 commit fb58e0d, --max-context 65536 --kv q4_0 --mmap-experts --resident-budget-gib 12 (self-caps to 10.82-12.00 by RAM) --kv-resident 32768 --expert-cache auto --prefill auto, env PIN=0 HEADROOM=6 HSA_USERPTR_FOR_PAGED_MEM=0 STRATA_HIP_ADAPT_KERNEL_COPY=1.

    #267 timeouts on layers 9, 15, 38 and #29 watchdog on 45 (all GDN; QSA here are 3,7,...,47). Layer-45 stall report: host step45 GPU rang45 served45 planA45 copiesB45, pool 36/36 done 11 parked, host idle 1.7-4s, disk D 0/36, mem 15.4GB resident 9GB avail then 14.4/6.6GB, 7993 faults. 5s drain fail every time (exit -15), once abort -6. VRAM free 318-426MiB throughout. HSA and ADAPT_KERNEL changed nothing (ADAPT active confirmed in log). Continuing with STRATA_VERIFY_TRACE=1 to send the trace block.

  7. xoykor commented on Oct 10, 2026

    @xoykor

    Workaround that stabilized it here (6700XT gfx1031, CachyOS, 32GB RAM, coder-IQ1_M, engine 0.1.41, 64k): #267 timeouts on layers 1/9/15/38/45 plus the #29 watchdog on 45 are gone.

    Final config: --max-context 65536 --kv q4_0 --mmap-experts --resident-budget-gib 12 (self-caps to 7-12 by RAM) --kv-resident 32768 --expert-cache auto --prefill auto --no-prefill-borrow --spec 4 --spec-min-p 0.5 --mtp rt --adapt-every 0 --adapt-swaps 0, env PIN=0 HEADROOM=6 HSA_USERPTR_FOR_PAGED_MEM=0 STRATA_HIP_ADAPT_KERNEL_COPY=1.

    Measured: 13.3k prompt at 239.9 tok/s, 14.6k + 8192 generated at 10.3 tok/s, KV streaming 99.9% VRAM, 0 exchanged with the VRAM tier, no timeout since the switch. Note: --spec 0 does not start on this IQ pack (needs --spec >= 2), so spec stayed on; what removed the hang was no prefill borrow plus zeroed adaptive swaps.

  8. Niko1221 commented on Oct 13, 2026

    @Niko1221
    Owner

    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.

  9. jollyroger1480 commented on Oct 14, 2026

    @jollyroger1480
    ContributorAuthor

    Update after running a 0.1.44.1-based build (our port branch rebased onto the tag) on the same box and model as the original report (Qwen3.8-Flash-Next Q2_0, 31 GB RAM):

    If it recurs on this build we'll reopen with the STRATA_VERIFY_TRACE block per your instructions. Thanks for the 0.1.39 trace instrument — that's what surfaced the PIN connection for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions