Repository navigation
Description
Filed from the pi-attn lane's measurements (~/briefs/TATTN-STATE.md, entries 21:20 / 21:22 / 21:25 / 21:29 / 22:06
/ 22:07, artifacts ~/lb/aval/fn-topk-*). Owner lane: pi-attn, PR coming.
Symptom
After the 2026-10-31 strixhalo rebuild, every HRX process faults on its first graph replay — including the c18
release tarball that was verified on the old box:
wait for HRX graph replay commands failed: …/system_event.c:122: ABORTED;
AMDGPU memory access fault at device address 0x… (reason mask 0x00000000)
ggml_backend_sched_graph_compute_async failed with error -1
58 fault lines, an llama-server completion returns HTTP 500 in <10 ms, and test-backend-ops -o TOP_K -b HRX0
hangs after aborting (the 20:34 run ate a whole 40-minute gpu-hold this way). dmesg, per fault:
[gfxhub] page fault (src_id:0 ring:64 vmid:9 pasid:749)
GCVM_L2_PROTECTION_FAULT_STATUS 0x00900880 Faulty UTCL2 client ID: CPF (0x4)
PERMISSION_FAULTS 0x8 WALKER_ERROR 0x0 MAPPING_ERROR 0x0 RW 0x0
One fault per process, always on the first replay, permission not mapping: the host-access path, not a bad
address. 5 faults across the box since the 19:40:53 boot, no MODE2 reset and no ring hang.
The A/B that decides it (libhsa × SVM, one claim, same binary)
Same binary 10703 (9206f6436), same 0.6B GGUF, same argv, 32 tokens per arm, libhsa sha256 logged per arm
(~/lb/aval/fn-topk-hsa-ab-20261101T010648Z/):
| arm | libhsa (sha256) | server | completion | new gfxhub faults |
|---|---|---|---|---|
| rel-default | release f6ef689d… |
will not start: --device … invalid device: HRX0 |
— | 0 (nothing ran) |
| rel-nosvm | release f6ef689d… + no-SVM env |
will not start, same error | — | 0 (nothing ran) |
| sdk-default | TheRock nightly 21a66824… |
up | HTTP 500, 31 fault lines | +1 |
| sdk-nosvm | TheRock nightly 21a66824… + no-SVM env |
up | HTTP 200, 260.1 tok/s | 0 |
Three HSA runtimes exist on this box and every run must name which one it used:
| runtime | path | sha256 |
|---|---|---|
release-shipped (c18 image /data/1bit-llama) |
~/wt/engine-c18/libhsa-release/libhsa-runtime64.so.1 |
f6ef689d163b42de… |
| TheRock SDK nightly (what the engine picks by default) | /opt/rocm-therock/…/_rocm_sdk_core/lib/libhsa-runtime64.so.1 |
21a6682452e159cf… |
distro (rocm 7.1, libhsa-runtime64-1) |
/usr/lib/x86_64-linux-gnu/libhsa-runtime64.so.1 |
5b11324814140eb5… |
The no-SVM env trio is the only fault-free arm. Repro/recipe for anything HRX on this box today:
HSA_USE_SVM=0 HSA_USERPTR_FOR_PAGED_MEM=0 HRX_ALLOW_NO_SVM=1 \
IREE_HAL_AMDGPU_LIBHSA_PATH=/opt/rocm-therock/lib/python3.14/site-packages/_rocm_sdk_core/lib/libhsa-runtime64.so.1 \
<binary>
It is the right knob from the source, not by luck: hrx-system/…/util/no_svm_gate.h documents that with
HSA_USE_SVM=0 (+ HSA_USERPTR_FOR_PAGED_MEM=0) libhsakmt allocates each queue's CWSR context-save area as a KFD
GTT buffer object instead of a pageable SVM range (the #315 workaround), and the HAL never sets SVM attributes
itself (it imports host memory with hsa_amd_memory_lock_to_pool), so a no-SVM ROCr only has to be allowed past the
refusal at info.c:72 — which is what HRX_ALLOW_NO_SVM=1 does. This box reports XNACK enabled: NO and
Coherent Host Access: FALSE: exactly the state where the default pageable-SVM queue path dies.
Excluded, so nobody repeats it
| hypothesis | measurement |
|---|---|
| my build | c18 release tarball (1 (4a58da9b)) fails identically — HTTP 500 in 8.8 ms, +1 fault |
| memlock (8 MiB tmux cap from the rebuild) | ulimit -l = unlimited in-shell and under systemd-run --user --scope, logged in-run; same faults |
| GTT pressure | reproduced at 115 GiB and again at 75 GiB MemAvailable |
| KFD / driver / ROCm runtime generally | plain HIP hipMalloc → H2D → memset → kernel → D2H → pinned H2D = HIP_PATH_OK, 0 faults; rocminfo Agent 2 = gfx1151 |
| HRX runtime libs | libhrx.so.0 sha e12d4cec… identical to a working lane's deps; c18's 28c94500… fails the same way |
Second defect in the same table: the release runtime cannot run a dev build at all
The release-shipped libhsa f6ef689d does not register an HRX device for these binaries — --device … invalid device: HRX0 — with or without the trio. So "engine build + release-bundled runtime" is not a supported pair today;
the release image works only because its engine and its runtime ship together. Decide: pin the nightly in the bundle,
or make libhsa selection explicit and loud at init.
The perf half (why this is also labelled perf)
The no-SVM queue path is correct but slower — same binary, same env, 5,401-token smoke:
short 216 tok: tg 8.30, pp 70.91 / long 5,401 tok: tg 7.09, pp 74.73, vs tg 14.65 / pp 205.3 historical at
the same size on the old kernel/SDK. So it is a fallback, not the answer. These are deliberately not quoted as a
row (the 18.8k row is still pending and no number will be quoted off a faulting or fallback path). Known confound,
stated up front: there is no paired with/without control — without the vars the binary faults — so a fresh row
carries both PR #161 and this queue-allocation change.
What a fix looks like
- Engine sets the trio itself when it detects the unfavourable capability lines (
XNACK enabled: NO/
Coherent Host Access: FALSE) — per process, includingtest-backend-ops, not per harness arm. Today a lane
that forgets one var gets a page fault, and the test binary turns that into a hang that eats a device claim. - Or fail loudly at init with the recipe (a precondition check), so no lane can measure off a faulting path.
- Log the libhsa path + sha256 in the HRX init line of every run (the A/B was only trustworthy because each arm
named its runtime; a silent fallback to another libhsa must be visible). - Settle the release-runtime question above.
Closes on
test-backend-ops -o TOP_K -b HRX0(484/484) and onellama-serverHRX completion green with no env vars
set on this box, dmesg gfxhub delta 0, and the libhsa used printed in the log; or the engine setting the
trio automatically with that same evidence (then the raw-fault arm becomes impossible, not just avoided).- Perf: a fault-free arm within the historical 14.65 tg / 205.3 pp at 5.4k before any 18.8k row is meaningful; if
every fault-free arm is slower, the honest close is "the box is only usable in a degraded mode", not a fast row.
Related
- hrx: gfxhub page fault + MODE2 GPU reset when GTT nears the 120 GiB ceiling (Flash-Next UD-IQ3_XXS, 18.8k ctx, 106.5 GiB GTT) #680 — same gfxhub page-fault family (there at GTT 106.5/120 with a MODE2 reset). This one reproduces at 75-115
GiB free and produced no MODE2 reset, so it is a different trigger in the same fault class. - HRX: GLM-4.7-Flash intermittent HSA memory fault / NaN logits under varied-length requests (base fork tip too) #315 (closed) —
HSA_STATUS_ERROR_MEMORY_FAULTon the HRX path;no_svm_gate.hin hrx-system carries that
workaround, and this is the same host-access fault class, now deterministic on every process after the rebuild. - hrx: long-context decode 9.70 tok/s at 18.8k ctx (prefill 74-93) vs 31.15 / 459 on a gfx1151 fork — same GGUF, same hour, short-prompt parity 28.6 vs 28.9 #679 — the 18.8k row that this blocks; HRX route pins ~107 GiB outside process RSS on a 217 GiB mmap (DeepSeek-V4.1 UD-IQ1_S), independent of -ngl/ubatch/prefetch #669/hrx: hrx_synchronous_h2d/d2h are not ordered against the compute stream #696 — the HRX memory and ordering work in the same executor.
Activity
bong-water-water-bong commentedon Nov 1, 2026
Measured on this box tonight from the Lemonade side, in case it helps the fix: with
cwsr_enable=0,autoadds nothing in either spawn path, so nothing in the shipped Lemonade packaging puts the trio in front of the kernels. The only fault-free runs I have are ones where the caller exported it.Both Lemonade paths consume that same call, so both inherit the same "nothing":
LEMONADE_ONEBIT_ONE_HOP≠0)1bit serve … --print-backend→ lemond startshrx/llama/bin/llama-serverwith the plan'senv--hrx-cwsr-placement=on; lemond has no way to pass that flag → noscripts/lemonade-hrx(Lemonade'sllamacpp-hrxrecipe)1bit serve … --print-backend-env→exporteach line → exec llama-serverLemonade does pass its own environment to the child, which is why the trio has to come from the caller: exporting it in lemond's environment lands it in the backend —
…and with that, three separate
gpu-holdwindows on the shippedlemonade-onebit-rc-2026-10-31cpackage (lemond2026.46.0~5.ef0f3b49,onebitrecipe,--device HRX0 -ngl 99) had no faults at all: chat 277.01 tok/s, chat 290.23 tok/s, and Lemonade's 31-test LLM suite green; same package in a cleanubuntu:26.04container on HRX0, 114.57 tok/s. Every fault report I have seen (including the 02:30 one on the1bit serveon port 8095) was a process started without the trio.Two notes for the fix itself:
app/hrx_cwsr.h: decide_cwsr_placementis where "auto +cwsr_enable=0" turns into "log a line, change nothing", andtests/hrx_cwsr_test.cppasserts exactly that (d.env.empty(), "auto + off: no variables"), so a default flip has to update that test — otherwise CI will hold the current behaviour in place.scripts/lemond-onebit.shin the engine package,config/lemonade/1bit-hrx.conffor the PPA drop-in) do not set the trio either, and they run lemond, so their children inherit nothing. If serve keepsautoas it is, one of those two is where the packaging has to set it.hyperloom custom: every measurement runs HRX with SVM off (engine #715)…
docs: 1bit OS v3 - the installed machine is an Ubuntu 26.04 Server (e…
bong-water-water-bong commentedon Nov 1, 2026
Closing evidence for the perf half of this issue, from three independent measurements — the merged fix (#743:
serveplaces the GTT save area by default) is safety, not a tax:runtime/src/iree/hal/drivers/amdgpu/util/info.c): 1.145x, 10/10 exact. The trio does not slow the kernel path down.10703 (9206f6436),MemoryMax=48G,GGML_HRX_GRAPH_PROGRAM_CACHE=128, 128 greedy tokens, one load per arm):env -uall three)Decode is within ~7 %, trio arm slightly ahead, and A ran first so it paid the cold page cache (that is its lower prefill, not the mode). So the "the fallback costs 3-4x" line in the original report was wrong — it came from a 32-token smoke with JIT inside the sample. Withdrawn.
Correcting my own issue text, since it matters for how this is read: the faulting mode is not "SVM", it is
HSA_USE_SVMon together withHSA_USERPTR_FOR_PAGED_MEM=0— the combination the fleet's shell harness had been setting (inherited from612-hrx.sh), not libhsakmt's default. Four-corner table on the 0.6B file:HSA_USE_SVMHSA_USERPTR_FOR_PAGED_MEMSo the GTT placement is one of three working modes, and it stays
serve's default because it is the mode the #315 soak covered and a box's defaults are not known-clean — not because it is the only one. The fleet-side fix that follows from this is to stop exportingHSA_USERPTR_FOR_PAGED_MEM=0outside the trio (done in the shared~/lb/aval-arm.shon strixhalo;612-*.shstill carry the lone line and are flagged for their own lanes).Still open from the original list, and honestly unmeasured: the 76 GiB
test-backend-ops/llama-server"no env vars set" row on this box (blocked on memory: the file needs ~92 GiB, the box has held 48-75 GiB with 34-39 GiB of swap for hours), and item 3 (log the libhsa path + sha256in the HRX init line) which nobody has taken.bong-water-water-bong commentedon Nov 1, 2026
gfxhub fault census across the two boots (measured from the journal, with the lines)
Adding the fault census the orchestrator asked for. I re-derived every number below from
journalctl -k -b 0/-b -1rather than from a summary, because the shape of the census changes what the acceptance for #713/#715 should be.
Totals
test-backend-op, 8llama-server)reset end with ret = -110llama-serverpid 4287, the coder-llm serve)Previous boot, faults per pid (
-b -1):llama-server2215493 x9, and x1 each fortest-backend-op241418,test-backend-op515003,llama-server413889, 414372, 441527, 442149, 713539, 889528,2016514. That is 18 = 9 + 9x1.
The 9x1 group is "one fault at first dispatch per process", and the 9x burst is a different thing
Every single-fault process is one fault and no more, and several of them are one fault within seconds of process start:
The reset precursor is a burst in one pid, one pasid, one second, on a different ring and vmid:
and this boot's single standing fault, which is the exact block #713/#715 should be judged against:
What this census does to my earlier statements (corrections, not excuses)
process at first dispatch is the standing condition on this box, with the trio, on a clean die. My arms that
recorded "0 new gfxhub faults" were correct as counts, but the population is ~1 fault per process sometimes, so
"0" was never a property of the mode -- it was the count for that process count. Everywhere I wrote "trio = 0 faults"
please read "the trio does not produce the burst signature"; the single first-dispatch fault survives it.
previous-boot faults were that benign single fault, including on a serve that then ran for hours (889528) and on two
test-backend-opruns that passed. The only row with the incident's time signature is the 9-fault burst at 11:13:02in one process, on ring 40 / vmid 11, one second before three processes became unsuspendable.
cheap to assert and it belongs in the acceptance: a clean run is
<=1fault per pid, allring:64 vmid:8|9; a runwith
>=2faults in one pid, or any fault on another ring/vmid, is an incident precursor and should stop the run.1947591(my d1 probe) and3689274(my 30B A/B) were the unsuspendablesetsidorphans; the harness now reaps them (~/lb/hrx-reap.sh).Consequence for #713 / #715 acceptance
The bar is not "zero faults on the box" (that is not achievable with the present runtime, whatever the SVM mode) but:
no burst -- at most one permission fault per process at first dispatch, all on
ring:64, with the runtime path andsha256 logged at HRX init (item 3 of #715) so a silent fallback to another libhsa cannot hide behind a clean count. Plus
the guardrail being worked as #764: the 76 GiB model at 18k+ context stays off the box until that merges, since the only
row in this census that precedes a reset is a long-context one.
bong-water-water-bong commentedon Nov 2, 2026
Closing on the engine setting it — the second arm of this issue's acceptance — with the one thing that is still unmeasured named
The closing condition written into this issue was: "TOP_K 484/484 + one HRX completion green with no env vars set
(fault delta 0, libhsa sha printed), or the engine setting the trio itself — the shipped serve path included, not
just Hyperloom (#718)". The second arm landed.
#794 →
b5cbe2f83(merged 2026-11-02T02:20:10Z, inmain;git merge-base --is-ancestor b5cbe2f83 origin/main→ yes),
app/hrx_cwsr.h+app/serve.cpp+scripts/hrx-env.sh+scripts/hw-gate.sh+tests/hrx_cwsr_test.cpp+tests/hrx_cwsr_route.sh(+52/−8 in serve alone). Verified in the tree atmaine6af10086, not taken from the PR text:app/hrx_cwsr.h:53—kCwsrPlacementVars[] = {"HSA_USE_SVM","HSA_USERPTR_FOR_PAGED_MEM","HRX_ALLOW_NO_SVM"}withkCwsrPlacementValues[] = {"0","0","1"}; the header's own note says "the trio is not serve's private business: anyprocess that initialises HRX on this box needs it … Three helpers so that rule lives in one place";
app/serve.cpp:1032,:1207,:1728— the trio is appended to every HRX backend's envp before start (chatserver, RAG servers, Laya scorer) and
:2841applies it to serve's own environment, so a child spawned with theinherited env cannot miss it;
app/serve.cpp:247— onemain:HRXdecision line, and serve: decide the CWSR placement once, so the log names what the user set (c20 gate red) #813a5271d92bchanged the decision to be made once andto name what the user set (that is why serve: decide the CWSR placement once, so the log names what the user set (c20 gate red) #813's summary says "so the log names what the user set");
scripts/hrx-env.shfor the harnesses andscripts/hw-gate.sh's step, so the gate no longer relies on a laneremembering;
tests/hrx_cwsr_test.cpp(decision matrix, incl. theHRX_SVM=1and--hrx-cwsr-placement=offopt-outs) andtests/hrx_cwsr_route.sh(the serve route, including "serve names it in the log").What is NOT claimed by this close
test files above (CPU-side: the decision matrix and the route harness), not by a
TOP_Kdevice arm with nothingexported. The fix's own subject — "every process must carry the trio" — is a startup property, and it is now
enforced at the spawn site rather than remembered by a lane, which is why this closes; the confirmation run is not
in this thread and I am not pretending it is.
placement and
cwsr_enable, not the runtime identity. Moved to build: the engine should fetch and pin its own HRX toolchain instead of requiring /opt/rocm-therock on the box #713 (which is exactly "which runtime did thisbuild pin and use", bucket C, post-c19) rather than left floating here; see the note on that issue.
the trio is fault-bounded — at most one permission fault per pid at first dispatch,
ring:64 vmid:8|9— and theincident signature is a burst in one pid or a fault on another ring/vmid. Nothing in serve: the save-area trio for every HRX process, and refuse to start without it (engine#715) #794 changes that; what it
changes is that a lane no longer has to know it.
test-backend-ops -b HRX0,llama-bench, a lane's own harness) still needthe trio exported — but
cwsr_env_present()now exists to assert it, andscripts/hrx-env.shis the shippingrecipe, so the ask in this issue ("or refuse at init") is answerable by any harness in one line.
Closed on the acceptance's own alternative, not on a keyword.