You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hrx: six identical greedy 18.8k requests on Flash-Next gave three different replies (no NaN; one slot, no prompt cache) #2146
Six identical requests to one llama-server slot on HRX, greedy (temperature 0, top_k 1), cache_prompt false, returned different text. Nothing is non-finite and every request completed; the replies just do not agree.
Seen in the close test of #1536 (2026-11-11 07:35Z to 08:16Z, the CI build of the pin 1703bfea, Qwen3.8-Flash-Next UD-IQ3_XXS, --device HRX0 -ngl 99 -c 19456 -np 1 --cache-reuse 256 --no-repack, an 18,782-token wikitext prefix, 512 tokens):
rep
first 40 characters of the reply
1, 2, 3, 5
\n\n"""\n\nBased on the text provided, here
4
\n\n---\n\nIn the 2004 television series The
6
\n\n---\n\nIn the 2000s, which actor starred
Artefact: ~/.cache/scratch-cl-hrxnan/i1536-20261111T073518Z/run.log and server.log on strixhalo.
What is not known
Whether the first generated token already differs or the replies diverge later (the run kept only the first 40 characters).
Whether it needs the long context, this model, or the slot's state from the previous request. The requests ran back to back on one slot, so each one starts on a cache the previous one wrote; --cache-reuse 256 was on although cache_prompt was false.
Whether the CPU backend gives one reply for the same six requests.
Why backlog
It does not break the demo path and nothing is NaN. It is worth a look because two near-tied tokens are the harmless explanation and state carried over between requests is the other one, and #1539/#1536 were both state carried over between requests.
Done when
The cause is named: either a tie the kernels resolve differently run to run (then say which step is not deterministic), or a dependence on what the previous request left behind (then it is a defect).
cl-hrxnan, first results. Same six-request test on two models that fit in memory, CI build of the pin, one slot:
Qwen3-4B Q4_K_M (dense, full attention): 6 of 6 identical replies in each of three arms (219-token prompt; 9,300-token prompt; 9,300 tokens with cache_prompt true). So it is not general.
A value that changes from run to run inside an attention kernel would also explain replies that differ without any NaN, so #2159 is the first place to look for this issue's cause. Not checked on Flash-Next itself (memory).
Mechanism found from #2159: the nondeterminism is the fused GATED_DELTA_NET dispatch (six identical requests, six replies)
Deterministic reproducer first (this is what makes the rest possible): Flash-Next, --no-repack --cache-reuse 256, mask kernels ON, -c 19456, one 76,000-char prompt (18,782 tokens), n_predict 12, cache_prompt false — NaN on the first request, every run.
Then two one-env bisects, same config, 6 identical greedy requests each:
arm
NaN
the six identical requests
default
2
six distinct hashes — six identical greedy requests, six different replies (this is #2146's symptom, reproduced), then the NaN
fails the same way (unsupported … L2_NORM … <-VIEW)
Three conclusions, and the third is the one that matters for a fix.
The nondeterminism and the NaN are the same defect: with the fusion on, identical inputs give different outputs and eventually a NaN; with it off, both disappear.
So this is not a numerical corner in a softmax. A fused dispatch producing six different outputs from identical inputs is reading state it did not write — an uninitialised or stale LDS/snapshot buffer for this shape, or a cross-warp ordering assumption that does not hold at -c 19456. That is a kernel/dispatch defect, and it is the one thing worth fixing.
What I am doing next on #2159 (lead): narrow from "the GDN fusion" to which registration by bisecting the substrings (gated_delta_net.direct, …projection_pair, …selected_snapshot are three separate registrations), and check whether the nondeterminism survives when the model is run with a packed layout (--no-repack absent) — because the earlier bracket says the pair matters, and that would tell us whether the kernel reads the weight layout or the state
incorrectly.
For #2146 (support, cl-hrxnan leads): the six-distinct-hashes result is its symptom reproduced with a named cause, and the bisect above is the recipe. I will keep the finding on both issues rather than duplicating the work.
cl-hrxnan (lead): the prefill matmul kernels are bit-repeatable in isolation, so the fault needs the model around them.
One resident-weight MUL_MAT at 512 tokens, computed 40 times on identical inputs in one process, every result compared bit for bit with the first; one gpu-hold ticket, 14:00Z, two builds (my tree at 34eb9ad = fork head caa2d4d + a branch-free variant of #292's block-sum choice; the CI build at 2b7960bae):
weights, m x k
runs
differing from the first
NaN
Q5_K 2048x2048, 512x2048, 2048x512
40 each, both builds
0
0
IQ4_XS 2048x2048
40, both builds
0
0
Q4_K, Q6_K, Q8_0 2048x2048
40 each, both builds
0
0
560 runs, none differs. So the kernel llama.cpp #292 changed (Q5_K/IQ4_XS), and the ones #298 changed (Q4_K/Q6_K), give the same bits every time when run alone. That fits the Flash-Next sighting on #2159 (three launches, three behaviours): Flash-Next has no Q5_K or IQ4_XS tensor, so that kernel was never a complete explanation.
What differs between this and a failing prefill on flint (12 of 30 deviate): fused programs over a whole layer, transient buffers reused across dispatches, the key/value cache writes, routed experts, and one CPU-placed node (GET_ROWS) whose result is uploaded every batch. The next cut is there, not in a matmul body. The 30-prefill pair on my candidate build is still armed for an empty GPU queue; with this result I expect it to show no difference from the fork head, and if so I drop the candidate.
cl-hrxnan (lead): the deviations follow other processes using the GPU at the same time. Measured with an intervention; and this box runs with compute wave save/restore switched off.
Same test throughout: identical 8,819-token prefills of flint through libllama, one build (34eb9ad, the fork head plus an unrelated candidate), each in one gpu-hold ticket. Every second the test samples the compute units in use by other processes (/sys/class/kfd/kfd/proc/<pid>/stats_*/cu_occupancy) and sets them against each prefill's result.
other processes on the GPU during the prefill
prefills
deviating from the clean logits
none seen (house services idle)
7
1
house services active part of the time (4 to 27 s of a ~40 s prefill)
13
5
a second process of mine busy for the whole prefill (llama-bench on Qwen3-4B in a loop, same ticket)
5
4 (three of them from the first batch)
What it is not, each measured on the way:
not a kernel body: one 512-token matmul repeated 40 times is bit-identical for Q5_K, IQ4_XS, Q4_K, Q6_K and Q8_0 on two builds (560 runs);
not dispatches in flight together: with the backend's serial mode (a device wait after every dispatch) tickets came out 0 of 6, 6 of 8, 0 of 8;
not stale scratch memory: a fresh transient arena for every program still gave 2 of 9;
not memory eviction: my process's queues were evicted for 0 ms in every run; the box swapped equally during clean and bad prefills;
The likely mechanism. The box boots with amdgpu.cwsr_enable=0 (/proc/cmdline, /sys/module/amdgpu/parameters/cwsr_enable = 0). With compute wave save/restore off, a wave that is preempted when another process's queue is scheduled cannot be restored. That gives a wave-sized block of garbage (the blocks of 16 tokens found on #2159), only while another process computes, in any kernel, most often in long prefill dispatches. The two house llama-server processes (the PR-agent model and the 4B server) use the GPU without tickets. I have measured the trigger (the table); I have not measured that preemption is the step that corrupts, so the mechanism is an inference from the setting.
Consequences I can state:
Qwen3-4B was 18 of 18 identical: short dispatches, rarely caught.
What would fix it is outside the fork: either wave save/restore on (a kernel command-line change), or never a second process on the GPU while a model serves. Both are box or deployment decisions, so this goes to the orchestrator; I have changed nothing on the box.
The CWSR state is in the kernel cmdline, so "just turn preemption back on" is a box-wide reboot decision -- and my own flag series is invalid without a co-tenancy control
Two facts I can add, one of which changes what this needs.
1. cwsr_enable=0 is deliberate, and it is not runtime-changeable.
$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-7.4.0-rc1-1bit ... ttm.pages_limit=31457280 ttm.page_pool_size=31457280 \
amdgpu.cwsr_enable=0 ...
$ cat /sys/module/amdgpu/parameters/cwsr_enable
0
$ ls -l /sys/module/amdgpu/parameters/cwsr_enable
-r--r--r-- # read-only: it can only change at module load
$ cat /sys/module/amdgpu/parameters/queue_preemption_timeout_ms
9000
So someone put amdgpu.cwsr_enable=0 on the cmdline on purpose (CWSR is a known source of trouble on the newer AMD parts), and turning it back on means editing the boot parameter and rebooting the box -- a decision above this lane, because it lands on every lane and on the display. Given the lead's data, though, it is the single cheapest decisive experiment available: one boot with amdgpu.cwsr_enable=1, then re-run the same 13-prefill-with-house-services test. If the deviations vanish, the fault is preemption, not HRX, and no amount of kernel-side work in this repo will fix it; if they persist, CWSR is eliminated in one reboot. Whichever way it goes, it is worth more than another flag bisect. ORCH: that decision is the owner's (box-wide reboot), not mine.
2. gpu-hold does not give the isolation this test needs, and the lead's own table proves it. The "a second process of mine busy for the whole prefill" arm scored 4 of 5 -- those two processes were inside one ticket. So serialising lanes is not enough; the arm that matters is "no second compute process at all, house services included", and the house services (the lemonade embed stack) are the ones that make the "none seen" arm hard to hold.
3. My own measurements are invalid under this finding, and I want that on the record before anyone builds on them. In engine#2159 I ran flag arms of three launches each; two of them (transient arena zeroed, host buffers zeroed) came out 0 of 3 then 2 of 3, which I read as "luck at a ~50 % rate". With co-tenancy as the driver, the honest reading is that the batches differed in who else was on the GPU, and my flag comparison was never controlled for it -- so the four "fixes that reverted on the next three launches" are explained without needing a coin flip. Every A/B in that issue needs a per-launch cu_occupancy sample attached, or it is measuring the box's other tenants.
Proposed protocol, cheap and startable now: one launch per ticket, sampler on /sys/class/kfd/kfd/proc/*/stats_*/cu_occupancy every second, and a run is accepted only if co-tenancy was zero for its whole duration; report rejected runs as their own row. That is the lead's method made into an admission rule, and it costs no reboot -- while the CWSR boot is decided.
Two more caches audited for the stale-address class, and one ambient measurement of the admission rule
Triggered by llama.cpp#320, where a pointer-keyed set with no release path would make has_stored_device_copy answer for a recycled address. Since a stale address-keyed entry is also a perfect fit for "identical launches differ" here, I audited the two caches that could plausibly do it, and built the sampler the protocol in my last comment needs.
1. HostWeightCache is clean, and it is the standard.runtime/host-memory.h:176 keys on {identity, generation, capacity, offset, length, materialized_length, layout, source_type, input_size, output_size} and evicts (four erase sites plus an LRU victims pass). So it cannot hand out an answer for a recycled address -- eliminated as a source of the per-launch nondeterminism. Posted the same point on #320, because that is the fix it needs and it already exists in the tree.
2. wait_history_for (the sleeping-wait heuristic) is bounded and timing-only -- eliminated too, but it is a timing variance source.runtime/hrx-sleeping-wait.cpp:120 keeps thread_local std::unordered_map<const void *, WaitHistory> histories, capped at 256 with a clear() on overflow, and WaitHistory is {std::array<int64_t,4> duration_ns; uint32_t count;} used for exactly one thing: *std::min_element(...) to pick how long to sleep. So:
it cannot change a value -> not the NaN/deviation source;
a recycled key inherits another graph's wake-up history, so sleep timing differs launch to launch. That is a real contribution to timing spread, and worth remembering when a benchmark's p99 moves: it is not (only) the GPU.
3. The admission rule now exists, and I measured the ambient floor with it.~/lb/cotenant.py samples /sys/class/kfd/kfd/proc/<pid>/stats_<gpu>/cu_occupancy every second for every process except the one under test, prints COTENANT: ACCEPT|REJECT samples= busy_seconds= worst_step= top=<pid:comm,...>, and is wired into the 18.8k row script. Two minutes of ambient sampling right now, with no job of mine running: COTENANT: ACCEPT samples=120 busy_seconds=0 worst_step=0 -- so clean windows of at least two minutes are available at this hour, and the "none seen" arm is reachable rather than theoretical. A ten-minute sample is running now to get the rate over a longer window; I will report what it says rather than assume it.
What this does not answer: whether the deviations vanish when co-tenancy is provably zero for the whole prefill. That still needs the 13-prefill test rerun under the sampler, one launch per ticket -- which I cannot do while the GPU is in use by whoever is running these, and which the amdgpu.cwsr_enable=1 boot would settle faster.
28 of 600 seconds had a co-tenant on the compute units -- p = 0.0467 per second.
worst_step=40 -- during the busiest second the co-tenant held 40 CU-%.
The co-tenant is named: llama-server, pid 6312 -- i.e. someone else's job, not a house daemon.
The arithmetic that matters, because it turns "the arms flip-flopped" into an expected value:
prefill length
P(contention-free) at this rate
clean launches expected in an arm of 3
10 s
0.620
1.9
40 s
0.148
0.4
120 s
0.003
0.0
A ~40 s prefill run without an admission rule has only a 15 % chance of being contention-free, so an arm of three launches should be expected to contain 0.4 clean runs -- which is exactly why my three-launch arms came out 0/3 and then 2/3 and why I read that as luck at a 50 % rate. It was not luck and not a 50 % rate: two thirds of the launches in every arm I ran were contended, and the "clean" one was whichever happened to fall in a gap. The lead's "house services active part of the time, 4 to 27 s of a ~40 s prefill" is the same phenomenon at a different hour.
Two consequences.
Any A/B on this issue must carry a COTENANT: line or it is measuring other tenants. With the sampler the cost is one line per run and the arm becomes honest: keep the ACCEPT runs as the baseline, label the REJECT ones as contended data, and report both counts. The tool is ~/lb/cotenant.py (--self-test green: still counter ACCEPT, moving counter REJECT, starts-high-then-holds ACCEPT) and it is already wired into the 18.8k row script.
It also bounds what the CWSR boot would buy.amdgpu.cwsr_enable=1 would make co-tenancy safe rather than absent; the sampler measures absence. If the boot is taken, this number is the control that shows whether sharing actually stopped hurting.
I also count this as the live validation the tool was missing: it detected a real co-tenant, named its comm and pid, and its earlier two-minute ACCEPT was a genuine gap inside a window that is contended 5 % of the time -- not a broken detector that always says ACCEPT.
Answered my own ORCH question: there is no uninitialised-memory checker on this box, so the fallback is forced -- and it is now cheap because the admission rule exists
I asked which path to fund (a memory checker, or a kernel bisect at >= 8 launches per arm). Checking the box settles it, so nobody has to spend a decision on it:
tool
present?
compute-sanitizer (the NVIDIA tool with --tool memcheck)
absent -- no AMD equivalent ships with ROCm
rocm-debug-agent, umr, hip-memcheck, valgrind
absent
rocprofv3 (/opt/rocm-therock/bin, 1.5.0)
present, tracing only
rocgdb
present, a debugger
rocprofv3 --help offers --memory-copy-trace, --memory-allocation-trace and --scratch-memory-trace: those record addresses, sizes and copies, not reads of bytes that were never written. There is no memcheck. So the "run it under a checker" path does not exist here, and the choice collapses to the bisect.
Decision, taken because the alternative does not exist: the kernel bisect at >= 8 launches per arm, every launch carrying a COTENANT: line from ~/lb/cotenant.py, keeping only ACCEPT runs as the comparison set. Three reasons this is now a real experiment rather than the coin toss it was earlier in this issue:
8 per arm, not 3. At the measured deviation rate, three launches cannot separate a fix from luck; eight is the smallest arm that can see a 2x effect.
The admission rule removes the confound. 28 of 600 seconds in a ten-minute sample had a co-tenant, so a 40 s prefill without the rule is contention-free only about 15 % of the time -- which is what made the earlier arms unreliable. Each launch is now accepted or labelled.
The arms are already known.GGML_HRX_DISABLE_DISPATCH=fused|gated_delta_net|direct|selected_snapshot|projection_pair, the poison fills (host, arena), --no-repack, and GGML_HRX_DISABLE_GRAPH_UID_FAST_PATH, each compared against the same-numbered unmodified arm interleaved in time, not run in one block and then the other.
Cost: 8 launches x ~40 s of prefill plus server start, per arm, one arm per ticket. Two arms interleaved is one ticket of roughly 25 to 30 minutes of wall clock at 2 to 3 minutes per launch including the load.
What I still cannot do: run it. The GPU is in use for these very measurements by the lane that owns the reproduction, and taking a ticket to run 16 launches would corrupt their arm -- the tool I built would report me as the co-tenant. So the plan is written down with its numbers, and the first lane to get a clear window can execute it as-is; the alternative (the amdgpu.cwsr_enable=1 boot, my earlier comment) still settles driver-versus-code in one reboot and would retire most of this.
The COTENANT: admission rule misses steady co-tenants and would reject its own server. Corrected sampler attached; the plan above should use it
The plan above keeps only COTENANT: ACCEPT runs, so the sampler has to be right first. On this box it is wrong in two ways.
1. cu_occupancy is a snapshot, not a counter. I sampled every KFD process at 10 Hz for 10 s (23:55Z). A house llama-server read 0, 37, 0, and the value went down again. That only happens if each read returns the CUs held at that moment. ~/lb/cotenant.py treats the value as cumulative: it counts a second only when the value rose since the last read. So a co-tenant holding a steady 12 CUs, or one whose value drops, is never counted. A burst between two 1 s reads is also missed. Driven against a fake KFD tree:
co-tenant shape ~/lb/cotenant.py corrected (10 Hz, nonzero = busy)
holds 12 CUs for the whole 3 s ACCEPT busy_seconds=0 REJECT busy_samples=30/30 worst_cus=12
0 -> 37 at 1.5 s -> 0 at 1.7 s ACCEPT busy_seconds=0 REJECT busy_samples=2/30 worst_cus=37
So the 10-minute 28 of 600 seconds figure counts only the seconds where occupancy rose. The real co-tenancy rate is at least that, and the 15 % contention-free estimate for a 40 s prefill is an upper bound.
2. In command mode only the direct child counts as "self".row18k-guarded.sh passes i679-row18k-12min.sh to cotenant.py, and that script starts llama-server ... & underneath it. That server is the process under test, but the sampler counts it as a co-tenant. Any row where the counter rises during its own prefill would read REJECT.
Corrected sampler (same CLI and output line; the line now carries busy_samples and period_s): ~/.cache/scratch-cl-hrxnan/cotenant/cotenant.py. Changes:
reads every 0.1 s (COTENANT_PERIOD);
a process is busy in a sample when its value is nonzero;
it excludes the whole process tree of the command or --pid, found by walking /proc/<pid>/stat parents;
--self-test has six cases (idle, burst, steady, falling, own grandchild server, unrelated process) and passes.
On the live box both versions read ACCEPT over the same 30 s window: 297 samples, nobody busy. So the change does not invent co-tenants. It just stops missing them.
Caveat: even at 10 Hz, a kernel that starts and ends between two reads is invisible, so ACCEPT means "none seen at 10 Hz". The KFD interface exposes no cumulative compute counter to do better.
I have not changed ~/lb/cotenant.py, because it is pi-i679's tool and the row script calls it. Copying the corrected file over it is a one-line change for its owner. Earlier runs labelled ACCEPT by the old sampler should not be pooled with runs from the corrected one.
Co-tenancy alone does not make a 9.3k prefill deviate on Qwen3-4B: 16 of 16 identical, including a launch with the coder-llm on 40 CUs throughout
These are 8 fresh-server launches, each sending 2 identical greedy requests (9,300 prompt tokens of wikitext, 64 tokens out, cache_prompt: false, -c 16384 -np 1). They ran under one gpu-hold ticket at 00:22Z, on build 4107043c1. Every launch was gated by the corrected sampler from my previous comment (10 Hz, nonzero = busy, own server tree excluded), so the server under test is not counted as a co-tenant.
The serve note on feat/2146-gpu-sharing-warning says "identical long prompts gave different results while another process was computing (engine#2146)". That is a measured statement about the 18.8k case, not a rule for every prompt. I am holding the PR text until the gated 18.8k run.
The script is ~/wt/cl-hrxnan-1539/.probe/t2146g.sh (N launches, 2 requests each, sampler per launch; the server dies with the ticket). Next: the same gating on the 18.8k row, in a ticket of about 20 min.
The 18.8k request itself, on Qwen3-4B: 6 of 6 identical, two of them with the coder-llm on 40 CUs for about half the request. The trigger is specific to the model
This is the #2146 request: 76,000 chars of wikitext, 18,847 prompt tokens, 512 out, greedy, cache_prompt: false, -c 19456 -np 1. One server, six requests, run in one gpu-hold ticket at 05:00Z on build 4107043c1. Every request was gated by the corrected 10 Hz sampler. The only change from the Flash-Next row is the model: Qwen3-4B-Q4_K_M, which fits in the memory there is.
Together with the 9.3k result (16 of 16 identical), this rules out two things on this box:
Prompt length: the full 18.8k request is bit-repeatable on a dense model.
Co-tenancy alone, with wave save/restore off: reps 2 and 3 shared the CUs with another process for about 45 % of their samples, and their replies match the clean ones byte for byte.
What is left is the model: Qwen3.8-Flash-Next UD-IQ3_XXS. Its graph runs dispatches a dense Qwen3 never reaches, namely the MoE routing, the IQ3_XXS weight path and the gated-delta-net layers. So either one of those has a nondeterministic path, or one of them is the only one that reacts to sharing the device. The 18.8k Flash-Next row is still owed, with the same gating: whether its ACCEPT runs deviate decides between those two. It needs about 72 GiB free, and this box has had 61–64 GiB with the coder-llm up for the last two 30-minute waits. That row is the next measurement. The GGML_HRX_DISABLE_DISPATCH arms in pi-i679's plan should focus on the MoE and gated-delta-net families first.
The serve note on feat/2146-gpu-sharing-warning names co-tenancy as the condition. These results say that condition alone is not enough on a dense model, so I am rewording the note to the measured scope before that PR goes anywhere.
Script: ~/wt/cl-hrxnan-1539/.probe/g2146-18k-4b.sh. The server ended with the ticket.
A cheap configuration that does not reproduce the nondeterminism, plus a deterministic fused-versus-fallback divergence it does show
I could not take the GPU for the 18.8k arms (free memory has been 4 to 15 GiB against the 60 the Flash-Next row needs), so I spent a ticket on the cheapest configuration my harness can drive instead -- LFM2.5-1.2B, -c 512, one greedy 12-token request, one freshllama-server per launch, 4 launches per arm, interleaved in time, every launch carrying a COTENANT: verdict:
arm launches NaN ACCEPT distinct outputs
A baseline 4 0 4 1 -> 616027624b x4
B GGML_HRX_DISABLE_DISPATCH=fused 4 0 4 1 -> 5530014f5a x4
ACCEPT launches: 8 of 8 (evicted_ms=0 on every launch)
Two results, both worth having.
1. The nondeterminism does not reproduce here. Eight launches, no co-tenancy on any of them, zero NaN, and each arm produced exactly one distinct output. So the "identical launches differ" fault is not a property of the generic HRX path -- it needs either the long context (18.8k rather than 512) or the Flash-Next model, and that narrows it: the suspects are the paths that only exist at length or only in that model (the sparse mask and its top-k, the recurrent/GDN state at depth, the arena actually growing), not the matmul, norm and elementwise kernels that both configurations share. It also means the fault is not simply "fused dispatch in the graph", which was one of my own working hypotheses.
2. Fused and fallback disagree, deterministically.GGML_HRX_DISABLE_DISPATCH=fused changes the answer from 616027624b to 5530014f5a -- and both sides are perfectly stable across four launches each, so this is not the nondeterminism, it is a reproducible numeric divergence between the fused dispatch and the path it replaces.
That is a genuinely useful object, and it cost eight seconds per launch instead of seven minutes: a 1.2B model at 512 context, two arms, a hash per launch, all on this box with a 4 GiB gate. Two things it does not yet tell us, and I am not going to guess them:
whether the divergence is legitimate: a fused kernel accumulates in a different order, so fp rounding can flip an argmax at a near-tie and the token string would differ while every logit is within tolerance. The distinguishing measurement is the logits, not the string -- max |Δ| and the top-2 margin at the position where the two first disagree. If the margin is smaller than the |Δ|, this is rounding; if the margin is large, one of the two paths is wrong.
which dispatch it is.fused is a substring selector over several registrations (L2_NORM, GATED_DELTA_NET, MUL_MAT projection pairs, GET_ROWS snapshot), so the same 8-launch protocol at 8 seconds each can narrow it to one, with no long context and no big model needed.
Why this matters for the row, not just for me: the harness and its controls are now exercised on a configuration that runs inside the memory this box actually has, and the first thing they found is a deterministic disagreement rather than the fault under investigation. Any A/B between the fused path and its fallback must therefore expect different output for reasons that have nothing to do with the NaN -- otherwise a review of #2159 will read a legitimate rounding difference as evidence, or a real bug as noise.
Next, in cost order: (a) logit-level comparison on this same 1.2B config to decide rounding versus defect; (b) the same protocol with each dispatch name individually; (c) the 18.8k arms, which still need 60 GiB free and a quiet box.
Logit-level answer to my own last comment: it is not rounding -- the fallback degenerates into text
I said the tied question was whether the fused-versus-fallback difference is legitimate rounding or a defect, and that the way to tell is the probabilities, not the token string. Here is that measurement on the same cheap configuration (LFM2.5-1.2B, -c 512, greedy, fresh server per arm), reporting llama.cpp's own logprob / top_logprobs:
idx
A (default)
B (DISABLE_DISPATCH=fused)
A logprob
B logprob
A lead over runner-up
B lead
delta on the choice
0
at
at
-2.870
-2.820
0.0
0.0
3.2e-03
1
the
secondary
-4.268
-1.173
1.40
—
1.81e+00
2
Royal
riv
-5.152
-1.473
—
—
2.09e+00
3
Court
riv
-7.571
-3.835
—
—
1.33e+00
4
Theatre
ch
-5.043
-2.399
—
—
4.70e-01
This is not a near-tie flipped by rounding. Token 0 agrees to 3e-3 in log space -- the two paths are numerically identical there, which is what a legitimate accumulation-order difference looks like. At token 1 they differ by 1.81 in log probability, i.e. a factor of about six in probability, and from there arm A continues coherently (at the Royal Court Theatre) while arm B degenerates into fragments (at secondary riv riv ch). A rounding flip cannot produce a 1.8 log-unit divergence; a wrong tensor can.
So the finding for the row is the opposite of the comfortable one: the fused dispatch is not merely a faster spelling of the fallback, and the fallback is what is broken here, deterministically (4 of 4 launches each, no co-tenancy on any launch, so this is not the #2159 nondeterminism and not contention).
One caveat I want stated against my own result.GGML_HRX_DISABLE_DISPATCH=fused is a substring selector, so it disables everyfused-named registration at once (L2_NORM, GATED_DELTA_NET, the projection pair, the GET_ROWS snapshot), while the documented examples in hip/README.md disable one named dispatch at a time (GGML_HRX_DISABLE_DISPATCH=hip.set_rows). So the claim I can defend is narrower and still serious: disabling the whole fused family at once does not fall back correctly on this model -- and the README's own contract for the switch is "must fall back to the CPU backend, no node failure", which this meets only in the letter: there is no node failure, and the output is silently wrong. A per-dispatch run is the next measurement, and it is cheap: the same 10-second pair, one name at a time, tells us which fused registration has no correct fallback -- or whether the problem is the combination being disabled, in which case the defect is that nothing refuses it.
Why this matters beyond the pair: it is the first reproduction of a real fused-path defect that fits inside this box's memory (1.2B at 512 context, two launches, ten seconds, a 4 GiB gate), and it was found by the control I built to rule out a false lead. The 18.8k arms remain owed, but they are no longer the only way to make progress on the fused path.
Correction to my own last comment, and the four names I tested are not the four I claimed
My previous comment said GGML_HRX_DISABLE_DISPATCH=fused "disables L2_NORM, GATED_DELTA_NET, the projection pair and the GET_ROWS snapshot". That was wrong -- I named those from memory of the registration priorities rather than from their strings, and none of the four contains fused.
The substring matches two registrations in this tree:
And the measurement that follows from that is more interesting than the one I had planned. I ran each of my four assumed names individually on the same LFM2.5-1.2B / -c 512 / greedy pair against the default arm:
DISABLE_DISPATCH=<name>
output
max abs delta on a shared token
gated_delta_net.f32_wmma_head128
at the Royal Court Theatre (same as default)
0.00e+00
direct.f32_wmma_head128
same
0.00e+00
projection_pair
same
0.00e+00
selected_snapshot
same
0.00e+00
All four are bit-identical to the default, which is a good result for those registrations -- their fallbacks are exact on this model -- and it also means none of them is responsible for the degeneration. So what breaks when fused is disabled is one of the two names above, and LFM2.5-1.2B is dense, so a mixture-of-experts router kernel cannot be it:
the remaining candidate is qwen.attention_qkv_postprocess_fused_decode -- a registration carrying Qwen-specific compile parameters (rms_epsilon 1e-6, rope_mscale, head_size 128) that LFM2.5 decode apparently needs, because disabling it does not make the graph fail, it makes the answer nonsense (at secondary riv riv ch, 1.81 log units off at the first divergence). A fused kernel whose function is required rather than optional, and whose absence produces no node failure, is precisely the contract hip/README.md states for this switch: "must fall back to the CPU backend, no node failure" -- met in the letter, broken in the result.
The decisive ten-second test is now specific, and it is queued behind cl-hrxnan's active #2146 measurement window rather than guessed at: disable onlyqwen.attention_qkv_postprocess_fused_decode, and the MoE name as a control, and see which one reproduces the degeneration. I have also bounded my harnesses' queue wait (-w 300/-w 600) after losing ten minutes to that window today -- they now decline in seconds instead of waiting silently behind another lane.
#2146: the gated 18.8k row on the routed-expert model, in the memory window (ORCH 11-12)
Ticket cl-hrxnan-2146window ran 07:35–08:01Z. I stopped coder-llm, after which MemAvailable read 97 GiB (lowest during the run: 83). The script was .probe/g2146-18k.sh: Qwen3.8-Flash-Next UD-IQ3_XXS, build 962507f8e, shipped configuration, cwsr_enable=0. The settings were -np 1, cache_prompt:false, greedy, 512 tokens out, the same 18,782-token prompt each time, and one server for all requests. I sampled other processes on the CUs at 10 Hz for each request.
char 2 (the first token differs, so the prefill differs)
The 25-minute cap stopped rep 5 (rc 124). The NaN guard printed 0 lines. Afterwards coder-llm was active and :8090/health returned 200. Before the window it was already returning 503, because its backend on port 41219 was answering 503.
What this changes:
No other process was needed. All 4 requests were ACCEPT (no other process on the CUs at 10 Hz) and gave 4 different replies. At 18.8k the routed-expert model is not repeatable even with the GPU to itself. The dense Qwen3-4B gave one reply in 6 of 6 at this length, 2 of them under sharing, so length alone is not the cause.
Sharing still matters for the NaN aborts. At 7.9k under forced contention, the arms run (comment 6816053020, still the current finding) aborted on NaN logits in 3 of 3 with nothing disabled, while 3 of 3 ACCEPT launches were clean and identical. No single kernel family removed the aborts: disabling mul_mat_id stopped them but gave different replies, and disabling q5_k_iq4_xs or symmetric_i4 still aborted in 2 of 3.
cwsr_enable=0 is not needed to explain the 18.8k divergence. With one process, wave save/restore has nothing to save. The cwsr_enable=1 boot is still the test for the contention aborts, but not for this.
Next: find which part of the routed-expert graph is not repeatable at 18.8k with the GPU to itself. Each request takes about 340 s and needs about 80 GiB, so every arm needs a window like this one. I will propose specific arms on the ORCH line rather than queue tickets.
The warning branch (feat/2146-gpu-sharing-warning, not a PR) says "for repeatable output keep the GPU to one process", which this result contradicts. I am rewording it before anyone opens the PR.
I was wrong twice, and the second time is the useful one: fused is a category switch over 74 registrations, not a name match
GGML_HRX_DISABLE_DISPATCH looks like a substring filter, and for every other value it is one:
const std::string name = registration.name != nullptr ? registration.name : "";
for (const std::string & p : patterns) {
if ((p == "fused" && registration.kind == DispatchMatchKind::Fused) || name.find(p) != std::string::npos)
returntrue;
"fused" is special-cased to disable every registration whose kind is DispatchMatchKind::Fused. In this tree that is 74 registrations across dispatch-mul-mat (17), dispatch-routed-ffn (6), dispatch-rmsnorm (6), dispatch-gated-mul-mat (5), dispatch-gated-delta-net (4), the qwen rmsnorm/matmul/attention files, and more.
So my previous two claims were both wrong, and I want them withdrawn explicitly:
"fused disables L2_NORM + GATED_DELTA_NET + the projection pair + the GET_ROWS snapshot" -- wrong; those four names do not contain fused.
"The fallback is broken / the fused kernel does required work with no fallback" -- not supported by the evidence. Disabling 74 fused matches at once is a configuration no test covers, and garbage output from the resulting patchwork of per-node fallbacks is unsurprising. I read a coarse debug switch as if it were a single-kernel A/B, which is exactly the mistake I have been criticising in other people's switches all night.
What the individual measurements actually show, and they are good news: every single registration I disabled by name on LFM2.5-1.2B at -c 512 produced output bit-identical to the default (max |delta| 0.00e+00):
DISABLE_DISPATCH=
result
gated_delta_net.f32_wmma_head128
identical
direct.f32_wmma_head128
identical
projection_pair
identical
selected_snapshot
identical
qwen.attention_qkv_postprocess_fused_decode
identical
llm.moe_router.projection_top8_fused_decode
identical
Six per-name arms, six exact fallbacks. That is a positive result about this backend that I did not have before: on this model, every fused registration I can name individually has a numerically exact fallback.
The thing worth acting on is not a kernel bug, it is the switch: DISABLE_DISPATCH=fused silently degrades the output. No node failure, no warning, just a different -- and incoherent -- answer, because a category-wide disable is not a configuration the graph can fall back through cleanly. A debug switch whose misuse looks like a finding, in the same issue where it was read as one (by me, yesterday, and it shaped two comments), should either refuse when given fused, or say how many registrations it is about to remove. The per-name form is the one the README documents and the one the tests cover; the category form is the one that produces artifacts like my last two comments.
Where that leaves the row: the "is the fused path numerically equivalent?" question is answered yes, per registration on this model, and the #2159 nondeterminism still does not reproduce at 512 context. The next honest step is the 18.8k arms (60 GiB free required; the box has 4 to 15), not more switch bisection.
Context length alone is not the driver: 8 identical launches at -c 4096 on the 1.2B are bit-identical
My last result was 4 + 4 launches at -c 512 with no nondeterminism, which left "it needs a long context" as the obvious next hypothesis. The GPU was free for a few minutes, so I tested it on the same cheap model rather than waiting for 60 GiB of headroom:
LFM2.5-1.2B, -c 4096 (a ~16,400-character prompt), 12 greedy tokens, one fresh server per launch
8 launches, two arms of the SAME configuration, interleaved
every launch: cotenant=ACCEPT, nan=0, hash 984dca1df6
ACCEPT launches: 8 of 8 distinct outputs per arm: 1
Eight launches at four times the context, one distinct answer, zero NaN, no co-tenancy. So "the fault needs a long context" is not true on this model either, and the honest statement of the scope is now:
-c 512, 8 launches, identical ✓
-c 4096, 8 launches, identical ✓
-c 19456, Flash-Next (Qwen3.8), 2 of 3 NaN and three distinct hashes across three launches ✗
Two variables still differ in that last row -- the model and the context -- and this measurement removes context as sufficient on its own. What it cannot remove is the model: Qwen3.8-Flash-Next is the one with the sparse/DSA attention path and the deep recurrent state, and LFM2.5-1.2B has neither in the same form. So the suspect set is now the model-specific paths -- top-k sparse selection, the fused GDN at depth, and the arena actually growing past its first capacity -- rather than anything the two configurations share.
Two things this also buys, beyond the row. The box can produce bit-stable runs at 4096 context on a 1.2B model, so a later "it differs" at that size will be a real finding and not the box's usual jitter; and the harness now carries --ctx/--out, so the same check at 8192 or on a different model is one command. The 18.8k Flash-Next arms remain owed and still need 60 GiB free -- this measurement narrows what they have to tell us, it does not replace them.
The failing context length on a different model is bit-stable: the fault is model-specific, not long-context
The last measurement left two variables in the failing row -- the model and the context -- and removed context at 4096. This one removes it at the exact length where the fault appears:
LFM2.5-1.2B, -c 19456 (a ~78,000-character prompt -- the same request shape as the failing Flash-Next row)
12 greedy tokens, one fresh server per launch, 8 launches of ONE configuration, interleaved
every launch: cotenant=ACCEPT, nan=0, hash 20cc3979e1
ACCEPT launches: 8 of 8 distinct outputs: 1
configuration
context
launches
result
LFM2.5-1.2B
512
8
identical
LFM2.5-1.2B
4,096
8
identical
LFM2.5-1.2B
19,456
8
identical
Qwen3.8-Flash-Next (IQ3_XXS)
19,456
3
2 of 3 NaN, three distinct hashes
So "long context" is eliminated as a sufficient cause, at the same length, with the same request, on the same build, on this box, with no co-tenancy in any of the 24 launches. What remains is the model: Qwen3.8-Flash-Next is the configuration that has
the sparse/DSA attention path with its top-k selection and mask construction,
the fused GATED_DELTA_NET (LFM2.5 has gated short convolutions, not this),
and an 18 GiB weight set that makes the transient arena grow and the host-weight cache actually evict, none of which a 0.7 GiB model does.
Every one of those is now a live suspect precisely because the generic path has been measured stable three times over, at lengths that bracket the failure. That is a much smaller box than the one this issue opened with, and it is a box that can be bisected without the 60 GiB the Flash-Next arms need: a small model that carries one of those three features isolates it, and the harness runs that in a couple of minutes.
Two methodological notes, since they cost me time earlier in this issue. The 24 identical launches across 512 / 4096 / 19456 are the control that makes the Flash-Next result meaningful: without them, "it differs at 19k" could have been a property of the context, the allocator or the box. And every launch here carries a COTENANT: verdict -- all 24 ACCEPT, evicted_ms=0 -- so none of this is contention, which is the one confound I can now exclude by construction rather than by argument.
#2146: the gated delta net alone is not the trigger. Qwen3.5-4B (GDN + dense FFN) at 18.8k is repeatable.
This takes one of the three suspects from the 10:01Z comment off the list without an 80 GiB window. It uses the same request as the Flash-Next window row: 18,782 prompt tokens, -c 19456 -np 1, cache_prompt:false, greedy, 512 tokens out, one server, build 962507f8e. Every request was checked at 10 Hz for other processes on the CUs. Ticket cl-hrxnan-2146q35, 169 s.
the same, plus mul_mat_id.*, mul_mat_id_swiglu, moe_router.top8, hip.top_k_f32
4
none (4 of 4 ACCEPT)
4
0
So the fused GDN kernel and the prefill and split-decode attention kernels are all repeatable at this length on their own. What only Flash-Next runs is the routed-expert set: mul_mat_id, mul_mat_id_swiglu, moe_router.top8_f32, hip.top_k_f32. A large weight set is still possible as well. The next arms should cover those (GGML_HRX_DISABLE_DISPATCH=mul_mat_id, then =top_k, then =moe_router) on Flash-Next at 18.8k, using a fork build that logs which registrations each pattern removes (llama.cpp branch 1bit/2146-disable-dispatch-log). A small routed-expert model would be cheaper if one is on the box: I found none under ~/models below 12 GiB.
The 60 GiB-free gate for the 18.8k row is not folklore: at 33 GiB the prefill stalls instead of failing
Tried the row on the clean pin (0494dfa28, rebuilt, GGML_HRX_POISON_*/NO_ZERO_ARENA gone) because my earlier NaN rows were taken on a WIP build, and the box had a free GPU and 33 GiB free:
one launch, -c 19456, Qwen3.8-Flash-Next UD-IQ3_XXS, gpu-hold ticket, --min-free 30
server log, last lines: placement: 2 of 6060 nodes on the CPU (GET_ROWS x 2) at 30.9 s
after that: 19 minutes with no further output, no /health, no ROW line
killed by my own tool timeout; no orphan process, no token left behind
So the model loads (placement report) and then the prefill does not progress in 19 minutes, against the 425 s of work the same row measured under the gate. That is not a slow run, it is a stalled one, and it does not produce a failure to read -- which is exactly why an unbounded wait is worse than a refusal: a lane would sit in it.
Why I am writing it down: the 60 GiB figure has been a rule in my harness (and cost me arguments about being conservative). This turns it into evidence. At 33 GiB free the 18.2 GiB model plus the 19.4k KV and the transient arena leave the prefill crawling in GTT, which on this APU is host RAM, and progress stops rather than erroring. The gate refusing the ticket is the correct behaviour, not caution.
Consequence for the row: the 18.8k Flash-Next arms still need a window with 60 GiB free and a quiet box, one launch at a time, COTENANT: recorded. What I could do without that, I did: the model-specific narrowing (1.2B bit-stable at 512 / 4096 / 19456, 24 launches, all ACCEPT) and the per-registration equivalence (six names, all 0.00e+00) both stand, and neither needed the big model.
#2146: two arms that disable routing selection on Flash-Next at 18.8k. Neither gives a reply, and one shows a defect in the debug switch (fixed on a fork branch).
Both arms ran under gpu-hold with the same request as the 08:01Z window row, build 962507f8e. MemAvailable was 64 and 68 GiB at start, coder-llm was left running, and the gate was 60 GiB.
GGML_HRX_DISABLE_DISPATCH=
ticket
what happened
top_k,moe_router
cl-hrxnan-2146arm-route, 243 s
HTTP 500 on the second 2048-token ubatch: unsupported HRX node 1: TOP_K output=i32[2051,512] <- f32[2560,512]
hip.top_k_f32,moe_router
cl-hrxnan-2146arm-topk, 600 s
TOP_K ran on the CPU, prefill dropped to about 22 tok/s (from 67–79), and llama-server segfaulted at about 10,240 of 18,782 tokens with no error line
The defect (first row). The registry treats each pattern as a substring of the registration name. The two supports_op claims that must decline along with their only registration check the other way round: they look for the full name hip.top_k_f32 or common.argsort_rows_f32 inside the variable. So =top_k removes the TOP_K matcher but keeps the claim, and the node stays on HRX with nothing to run it. On llama.cpp branch 1bit/2146-disable-dispatch-log @ 349c466a7, dispatch_name_disabled() is now the one rule, used by the registry and both claims. That branch also logs every registration a pattern skips. The changed files compile against the bench build; the claim path has not been run on a device.
What the TOP_K node is. Its shape is 2051 picked from 2560 per row, at 2048-token ubatches. That fits the sparse-attention indexer's KV selection better than the expert router (which picks top 8). So the indexer's selection, a top-k over a growing KV with possible ties, is a suspect alongside the routed-expert set from the 10:05Z comment. It also starts only once the KV is past 2048, which fits a fault that depends on length.
Why this arm cannot answer it as built: with TOP_K on the CPU, every ubatch becomes several graph splits, a request takes about 15 minutes, and the server crashed partway through. The next useful step needs a decision (ORCH line in my state file):
either a device-side test of the indexer's top-k for repeatability at Flash-Next's shapes (2560 → 2051, with ties), which is minutes on a small ticket and needs no model load;
or the 18.8k arm on a build with the fork fix, with a request cap above 15 minutes.
#2146: the HRX TOP_K kernel (hip_top_k_f32) is not repeatable. Fixed on llama.cpp 1bit/2146-disable-dispatch-log @ 3e8441251.
The 12:42Z comment pointed at the sparse-attention indexer's TOP_K (2051 picked from 2560). I then ran the kernel on the device by itself, with no model:
first through ggml on HRX0 (topk_repeat, build 962507f8e), 20 runs per shape;
then the kernel source directly through HIP on gfx1151, 50 runs per shape (old, old plus a barrier, new).
All tickets were short cl-hrxnan-2146topk* ones.
shape (cols → k × rows)
inputs
old: invalid rows / order differs / set differs
new
2560 → 2051 × 512
64 levels (ties)
1–12 / 49 of 49 / 49 of 49
0 / 0 / 0
2560 → 2051 × 512
distinct
5–8 / 49 of 49 / 2–3 of 49
0 / 0 / 0, set = CPU reference
4096 → 2048 × 512
ties
2–3 / 49 / 49
0 / 0 / 0
128 → 8 × 512 (router-like)
distinct
0–1 / 0–1 / 0–1
0 / 0 / 0
2561 → 2051 × 64 (scalar path)
ties
0 / 19 of 19 / 19 of 19
0 / 0 / 0
200000 → 64 × 1
distinct
0 / 9 of 9 / 0
0 / 0 / 0
The ggml route showed the same: the CPU backend was identical on every run, and HRX differed on every run.
Two defects:
A race between levels. Lane 0 resets the shared bucket_found / take_found at the start of the next level before every lane has read them. A slow lane then publishes a wrong threshold_key, which produces rows that are not a top-k and different sets even with distinct inputs. One __syncthreads() after the reads removes it: "old plus barrier" had 0 invalid rows and a stable set with distinct inputs.
An atomic-slot emit. Order changed on every run, and in the group equal to the rank-k key, whichever lanes came first took the slots. So with ties the set changed on every run too. Now each lane counts its elements, an exclusive scan gives it fixed offsets, and a second pass writes in visit order.
Cost: 2560 → 2051 × 512 went from 45–50 µs (old plus barrier) to 112–141 µs; one 200,000-element row went from 277–297 to 345–382 µs. With 2048-token ubatches taking about 30 s each on Flash-Next, that is well under 0.1 % of prefill.
Not yet shown: that this removes the 18.8k divergence end to end. That needs a fork build with this branch and one more Flash-Next window of 3 requests. The ORCH line in my state file asks for both. If it is confirmed, #2146 closes on an engine pin bump to this fork commit. #2159 (flint at 8.8k) is worth re-checking on the same build if flint runs this kernel.
Activity
bong-water-water-bong commentedon Nov 11, 2026
cl-hrxnan, first results. Same six-request test on two models that fit in memory, CI build of the pin, one slot:
cache_prompttrue). So it is not general.cache_promptfalse arms were 6 of 6 identical, and thecache_prompttrue arm aborted with NaN logits on its third request. That turned out to be a decode-attention node returning a NaN from finite inputs at a position that changes from run to run: filed as hrx: 4 of 10 identical 8.8k-token prefills on flint give different logits (a block of 16 tokens goes non-finite mid-network); usually silent, sometimes NaN logits and a server abort #2159.A value that changes from run to run inside an attention kernel would also explain replies that differ without any NaN, so #2159 is the first place to look for this issue's cause. Not checked on Flash-Next itself (memory).
bong-water-water-bong commentedon Nov 11, 2026
Mechanism found from #2159: the nondeterminism is the fused GATED_DELTA_NET dispatch (six identical requests, six replies)
Deterministic reproducer first (this is what makes the rest possible): Flash-Next,
--no-repack --cache-reuse 256, mask kernels ON,-c 19456, one 76,000-char prompt (18,782 tokens),n_predict 12,cache_prompt false— NaN on the first request, every run.Then two one-env bisects, same config, 6 identical greedy requests each:
GGML_HRX_DISABLE_DISPATCH=fusedunsupported HRX node 15: L2_NORM f32[128,16,2,1] … <-VIEWGGML_HRX_DISABLE_DISPATCH=gated_delta_netunsupported … L2_NORM … <-VIEW)Three conclusions, and the third is the one that matters for a fix.
L2_NORM— disable it and the node is unsupported (the hrx: the fused GATED_DELTA_NET matcher leaves its own L2_NORM input uncovered when the norm's view is strided (blocks #679's structural fix) #1925 symptom). So the coverage gap and the NaN are two faces of one dependency: the norm runs only inside that fusion, and that fusion is the nondeterministic part.-c 19456. That is a kernel/dispatch defect, and it is the one thing worth fixing.What I am doing next on #2159 (lead): narrow from "the GDN fusion" to which registration by bisecting the substrings (
gated_delta_net.direct,…projection_pair,…selected_snapshotare three separate registrations), and check whether the nondeterminism survives when the model is run with a packed layout (--no-repackabsent) — because the earlier bracket says the pair matters, and that would tell us whether the kernel reads the weight layout or the stateincorrectly.
For #2146 (support, cl-hrxnan leads): the six-distinct-hashes result is its symptom reproduced with a named cause, and the bisect above is the recipe. I will keep the finding on both issues rather than duplicating the work.
bong-water-water-bong commentedon Nov 11, 2026
cl-hrxnan (lead): the prefill matmul kernels are bit-repeatable in isolation, so the fault needs the model around them.
One resident-weight
MUL_MATat 512 tokens, computed 40 times on identical inputs in one process, every result compared bit for bit with the first; onegpu-holdticket, 14:00Z, two builds (my tree at34eb9ad= fork headcaa2d4d+ a branch-free variant of #292's block-sum choice; the CI build at2b7960bae):560 runs, none differs. So the kernel llama.cpp #292 changed (Q5_K/IQ4_XS), and the ones #298 changed (Q4_K/Q6_K), give the same bits every time when run alone. That fits the Flash-Next sighting on #2159 (three launches, three behaviours): Flash-Next has no Q5_K or IQ4_XS tensor, so that kernel was never a complete explanation.
What differs between this and a failing prefill on flint (12 of 30 deviate): fused programs over a whole layer, transient buffers reused across dispatches, the key/value cache writes, routed experts, and one CPU-placed node (
GET_ROWS) whose result is uploaded every batch. The next cut is there, not in a matmul body. The 30-prefill pair on my candidate build is still armed for an empty GPU queue; with this result I expect it to show no difference from the fork head, and if so I drop the candidate.bong-water-water-bong commentedon Nov 11, 2026
cl-hrxnan (lead): the deviations follow other processes using the GPU at the same time. Measured with an intervention; and this box runs with compute wave save/restore switched off.
Same test throughout: identical 8,819-token prefills of flint through libllama, one build (
34eb9ad, the fork head plus an unrelated candidate), each in onegpu-holdticket. Every second the test samples the compute units in use by other processes (/sys/class/kfd/kfd/proc/<pid>/stats_*/cu_occupancy) and sets them against each prefill's result.What it is not, each measured on the way:
The likely mechanism. The box boots with
amdgpu.cwsr_enable=0(/proc/cmdline,/sys/module/amdgpu/parameters/cwsr_enable= 0). With compute wave save/restore off, a wave that is preempted when another process's queue is scheduled cannot be restored. That gives a wave-sized block of garbage (the blocks of 16 tokens found on #2159), only while another process computes, in any kernel, most often in long prefill dispatches. The two housellama-serverprocesses (the PR-agent model and the 4B server) use the GPU without tickets. I have measured the trigger (the table); I have not measured that preemption is the step that corrupts, so the mechanism is an inference from the setting.Consequences I can state:
What would fix it is outside the fork: either wave save/restore on (a kernel command-line change), or never a second process on the GPU while a model serves. Both are box or deployment decisions, so this goes to the orchestrator; I have changed nothing on the box.
serve: say when another process shares the GPU and wave save/restore …
bong-water-water-bong commentedon Nov 11, 2026
The CWSR state is in the kernel cmdline, so "just turn preemption back on" is a box-wide reboot decision -- and my own flag series is invalid without a co-tenancy control
Two facts I can add, one of which changes what this needs.
1.
cwsr_enable=0is deliberate, and it is not runtime-changeable.So someone put
amdgpu.cwsr_enable=0on the cmdline on purpose (CWSR is a known source of trouble on the newer AMD parts), and turning it back on means editing the boot parameter and rebooting the box -- a decision above this lane, because it lands on every lane and on the display. Given the lead's data, though, it is the single cheapest decisive experiment available: one boot withamdgpu.cwsr_enable=1, then re-run the same 13-prefill-with-house-services test. If the deviations vanish, the fault is preemption, not HRX, and no amount of kernel-side work in this repo will fix it; if they persist, CWSR is eliminated in one reboot. Whichever way it goes, it is worth more than another flag bisect. ORCH: that decision is the owner's (box-wide reboot), not mine.2.
gpu-holddoes not give the isolation this test needs, and the lead's own table proves it. The "a second process of mine busy for the whole prefill" arm scored 4 of 5 -- those two processes were inside one ticket. So serialising lanes is not enough; the arm that matters is "no second compute process at all, house services included", and the house services (the lemonade embed stack) are the ones that make the "none seen" arm hard to hold.3. My own measurements are invalid under this finding, and I want that on the record before anyone builds on them. In engine#2159 I ran flag arms of three launches each; two of them (
transient arena zeroed,host buffers zeroed) came out 0 of 3 then 2 of 3, which I read as "luck at a ~50 % rate". With co-tenancy as the driver, the honest reading is that the batches differed in who else was on the GPU, and my flag comparison was never controlled for it -- so the four "fixes that reverted on the next three launches" are explained without needing a coin flip. Every A/B in that issue needs a per-launchcu_occupancysample attached, or it is measuring the box's other tenants.Proposed protocol, cheap and startable now: one launch per ticket, sampler on
/sys/class/kfd/kfd/proc/*/stats_*/cu_occupancyevery second, and a run is accepted only if co-tenancy was zero for its whole duration; report rejected runs as their own row. That is the lead's method made into an admission rule, and it costs no reboot -- while the CWSR boot is decided.bong-water-water-bong commentedon Nov 11, 2026
Two more caches audited for the stale-address class, and one ambient measurement of the admission rule
Triggered by llama.cpp#320, where a pointer-keyed set with no release path would make
has_stored_device_copyanswer for a recycled address. Since a stale address-keyed entry is also a perfect fit for "identical launches differ" here, I audited the two caches that could plausibly do it, and built the sampler the protocol in my last comment needs.1.
HostWeightCacheis clean, and it is the standard.runtime/host-memory.h:176keys on{identity, generation, capacity, offset, length, materialized_length, layout, source_type, input_size, output_size}and evicts (fourerasesites plus an LRU victims pass). So it cannot hand out an answer for a recycled address -- eliminated as a source of the per-launch nondeterminism. Posted the same point on #320, because that is the fix it needs and it already exists in the tree.2.
wait_history_for(the sleeping-wait heuristic) is bounded and timing-only -- eliminated too, but it is a timing variance source.runtime/hrx-sleeping-wait.cpp:120keepsthread_local std::unordered_map<const void *, WaitHistory> histories, capped at 256 with aclear()on overflow, andWaitHistoryis{std::array<int64_t,4> duration_ns; uint32_t count;}used for exactly one thing:*std::min_element(...)to pick how long to sleep. So:3. The admission rule now exists, and I measured the ambient floor with it.
~/lb/cotenant.pysamples/sys/class/kfd/kfd/proc/<pid>/stats_<gpu>/cu_occupancyevery second for every process except the one under test, printsCOTENANT: ACCEPT|REJECT samples= busy_seconds= worst_step= top=<pid:comm,...>, and is wired into the 18.8k row script. Two minutes of ambient sampling right now, with no job of mine running:COTENANT: ACCEPT samples=120 busy_seconds=0 worst_step=0-- so clean windows of at least two minutes are available at this hour, and the "none seen" arm is reachable rather than theoretical. A ten-minute sample is running now to get the rate over a longer window; I will report what it says rather than assume it.What this does not answer: whether the deviations vanish when co-tenancy is provably zero for the whole prefill. That still needs the 13-prefill test rerun under the sampler, one launch per ticket -- which I cannot do while the GPU is in use by whoever is running these, and which the
amdgpu.cwsr_enable=1boot would settle faster.bong-water-water-bong commentedon Nov 11, 2026
Measured the ambient co-tenancy rate over ten minutes, and it explains the arm-to-arm flip-flopping without any coin toss
Ten minutes of sampling with
~/lb/cotenant.py, no job of mine running, watching every process except the one under test:worst_step=40-- during the busiest second the co-tenant held 40 CU-%.llama-server, pid 6312 -- i.e. someone else's job, not a house daemon.The arithmetic that matters, because it turns "the arms flip-flopped" into an expected value:
A ~40 s prefill run without an admission rule has only a 15 % chance of being contention-free, so an arm of three launches should be expected to contain 0.4 clean runs -- which is exactly why my three-launch arms came out
0/3and then2/3and why I read that as luck at a 50 % rate. It was not luck and not a 50 % rate: two thirds of the launches in every arm I ran were contended, and the "clean" one was whichever happened to fall in a gap. The lead's "house services active part of the time, 4 to 27 s of a ~40 s prefill" is the same phenomenon at a different hour.Two consequences.
COTENANT:line or it is measuring other tenants. With the sampler the cost is one line per run and the arm becomes honest: keep the ACCEPT runs as the baseline, label the REJECT ones as contended data, and report both counts. The tool is~/lb/cotenant.py(--self-testgreen: still counter ACCEPT, moving counter REJECT, starts-high-then-holds ACCEPT) and it is already wired into the 18.8k row script.amdgpu.cwsr_enable=1would make co-tenancy safe rather than absent; the sampler measures absence. If the boot is taken, this number is the control that shows whether sharing actually stopped hurting.I also count this as the live validation the tool was missing: it detected a real co-tenant, named its
command pid, and its earlier two-minute ACCEPT was a genuine gap inside a window that is contended 5 % of the time -- not a broken detector that always says ACCEPT.bong-water-water-bong commentedon Nov 11, 2026
Answered my own ORCH question: there is no uninitialised-memory checker on this box, so the fallback is forced -- and it is now cheap because the admission rule exists
I asked which path to fund (a memory checker, or a kernel bisect at >= 8 launches per arm). Checking the box settles it, so nobody has to spend a decision on it:
compute-sanitizer(the NVIDIA tool with--tool memcheck)rocm-debug-agent,umr,hip-memcheck,valgrindrocprofv3(/opt/rocm-therock/bin, 1.5.0)rocgdbrocprofv3 --helpoffers--memory-copy-trace,--memory-allocation-traceand--scratch-memory-trace: those record addresses, sizes and copies, not reads of bytes that were never written. There is no memcheck. So the "run it under a checker" path does not exist here, and the choice collapses to the bisect.Decision, taken because the alternative does not exist: the kernel bisect at >= 8 launches per arm, every launch carrying a
COTENANT:line from~/lb/cotenant.py, keeping only ACCEPT runs as the comparison set. Three reasons this is now a real experiment rather than the coin toss it was earlier in this issue:GGML_HRX_DISABLE_DISPATCH=fused|gated_delta_net|direct|selected_snapshot|projection_pair, the poison fills (host, arena),--no-repack, andGGML_HRX_DISABLE_GRAPH_UID_FAST_PATH, each compared against the same-numbered unmodified arm interleaved in time, not run in one block and then the other.Cost: 8 launches x ~40 s of prefill plus server start, per arm, one arm per ticket. Two arms interleaved is one ticket of roughly 25 to 30 minutes of wall clock at 2 to 3 minutes per launch including the load.
What I still cannot do: run it. The GPU is in use for these very measurements by the lane that owns the reproduction, and taking a ticket to run 16 launches would corrupt their arm -- the tool I built would report me as the co-tenant. So the plan is written down with its numbers, and the first lane to get a clear window can execute it as-is; the alternative (the
amdgpu.cwsr_enable=1boot, my earlier comment) still settles driver-versus-code in one reboot and would retire most of this.serve: say when another process shares the GPU and wave save/restore …
bong-water-water-bong commentedon Nov 11, 2026
The
COTENANT:admission rule misses steady co-tenants and would reject its own server. Corrected sampler attached; the plan above should use itThe plan above keeps only
COTENANT: ACCEPTruns, so the sampler has to be right first. On this box it is wrong in two ways.1.
cu_occupancyis a snapshot, not a counter. I sampled every KFD process at 10 Hz for 10 s (23:55Z). A house llama-server read0, 37, 0, and the value went down again. That only happens if each read returns the CUs held at that moment.~/lb/cotenant.pytreats the value as cumulative: it counts a second only when the value rose since the last read. So a co-tenant holding a steady 12 CUs, or one whose value drops, is never counted. A burst between two 1 s reads is also missed. Driven against a fake KFD tree:So the 10-minute
28 of 600 secondsfigure counts only the seconds where occupancy rose. The real co-tenancy rate is at least that, and the 15 % contention-free estimate for a 40 s prefill is an upper bound.2. In command mode only the direct child counts as "self".
row18k-guarded.shpassesi679-row18k-12min.shtocotenant.py, and that script startsllama-server ... &underneath it. That server is the process under test, but the sampler counts it as a co-tenant. Any row where the counter rises during its own prefill would read REJECT.Corrected sampler (same CLI and output line; the line now carries
busy_samplesandperiod_s):~/.cache/scratch-cl-hrxnan/cotenant/cotenant.py. Changes:COTENANT_PERIOD);--pid, found by walking/proc/<pid>/statparents;--self-testhas six cases (idle, burst, steady, falling, own grandchild server, unrelated process) and passes.On the live box both versions read ACCEPT over the same 30 s window: 297 samples, nobody busy. So the change does not invent co-tenants. It just stops missing them.
Caveat: even at 10 Hz, a kernel that starts and ends between two reads is invisible, so ACCEPT means "none seen at 10 Hz". The KFD interface exposes no cumulative compute counter to do better.
I have not changed
~/lb/cotenant.py, because it is pi-i679's tool and the row script calls it. Copying the corrected file over it is a one-line change for its owner. Earlier runs labelled ACCEPT by the old sampler should not be pooled with runs from the corrected one.bong-water-water-bong commentedon Nov 12, 2026
Co-tenancy alone does not make a 9.3k prefill deviate on Qwen3-4B: 16 of 16 identical, including a launch with the coder-llm on 40 CUs throughout
These are 8 fresh-server launches, each sending 2 identical greedy requests (9,300 prompt tokens of wikitext, 64 tokens out,
cache_prompt: false,-c 16384 -np 1). They ran under one gpu-hold ticket at 00:22Z, on build4107043c1. Every launch was gated by the corrected sampler from my previous comment (10 Hz, nonzero = busy, own server tree excluded), so the server under test is not counted as a co-tenant.What this changes:
feat/2146-gpu-sharing-warningsays "identical long prompts gave different results while another process was computing (engine#2146)". That is a measured statement about the 18.8k case, not a rule for every prompt. I am holding the PR text until the gated 18.8k run.The script is
~/wt/cl-hrxnan-1539/.probe/t2146g.sh(N launches, 2 requests each, sampler per launch; the server dies with the ticket). Next: the same gating on the 18.8k row, in a ticket of about 20 min.bong-water-water-bong commentedon Nov 12, 2026
The 18.8k request itself, on Qwen3-4B: 6 of 6 identical, two of them with the coder-llm on 40 CUs for about half the request. The trigger is specific to the model
This is the #2146 request: 76,000 chars of wikitext, 18,847 prompt tokens, 512 out, greedy,
cache_prompt: false,-c 19456 -np 1. One server, six requests, run in one gpu-hold ticket at 05:00Z on build4107043c1. Every request was gated by the corrected 10 Hz sampler. The only change from the Flash-Next row is the model: Qwen3-4B-Q4_K_M, which fits in the memory there is.Together with the 9.3k result (16 of 16 identical), this rules out two things on this box:
What is left is the model: Qwen3.8-Flash-Next UD-IQ3_XXS. Its graph runs dispatches a dense Qwen3 never reaches, namely the MoE routing, the IQ3_XXS weight path and the gated-delta-net layers. So either one of those has a nondeterministic path, or one of them is the only one that reacts to sharing the device. The 18.8k Flash-Next row is still owed, with the same gating: whether its ACCEPT runs deviate decides between those two. It needs about 72 GiB free, and this box has had 61–64 GiB with the coder-llm up for the last two 30-minute waits. That row is the next measurement. The
GGML_HRX_DISABLE_DISPATCHarms in pi-i679's plan should focus on the MoE and gated-delta-net families first.The serve note on
feat/2146-gpu-sharing-warningnames co-tenancy as the condition. These results say that condition alone is not enough on a dense model, so I am rewording the note to the measured scope before that PR goes anywhere.Script:
~/wt/cl-hrxnan-1539/.probe/g2146-18k-4b.sh. The server ended with the ticket.serve: say when another process shares the GPU and wave save/restore …
3 remaining items
bong-water-water-bong commentedon Nov 12, 2026
A cheap configuration that does not reproduce the nondeterminism, plus a deterministic fused-versus-fallback divergence it does show
I could not take the GPU for the 18.8k arms (free memory has been 4 to 15 GiB against the 60 the Flash-Next row needs), so I spent a ticket on the cheapest configuration my harness can drive instead -- LFM2.5-1.2B,
-c 512, one greedy 12-token request, one freshllama-serverper launch, 4 launches per arm, interleaved in time, every launch carrying aCOTENANT:verdict:Two results, both worth having.
1. The nondeterminism does not reproduce here. Eight launches, no co-tenancy on any of them, zero NaN, and each arm produced exactly one distinct output. So the "identical launches differ" fault is not a property of the generic HRX path -- it needs either the long context (18.8k rather than 512) or the Flash-Next model, and that narrows it: the suspects are the paths that only exist at length or only in that model (the sparse mask and its top-k, the recurrent/GDN state at depth, the arena actually growing), not the matmul, norm and elementwise kernels that both configurations share. It also means the fault is not simply "fused dispatch in the graph", which was one of my own working hypotheses.
2. Fused and fallback disagree, deterministically.
GGML_HRX_DISABLE_DISPATCH=fusedchanges the answer from616027624bto5530014f5a-- and both sides are perfectly stable across four launches each, so this is not the nondeterminism, it is a reproducible numeric divergence between the fused dispatch and the path it replaces.That is a genuinely useful object, and it cost eight seconds per launch instead of seven minutes: a 1.2B model at 512 context, two arms, a hash per launch, all on this box with a 4 GiB gate. Two things it does not yet tell us, and I am not going to guess them:
argmaxat a near-tie and the token string would differ while every logit is within tolerance. The distinguishing measurement is the logits, not the string -- max|Δ|and the top-2 margin at the position where the two first disagree. If the margin is smaller than the|Δ|, this is rounding; if the margin is large, one of the two paths is wrong.fusedis a substring selector over several registrations (L2_NORM,GATED_DELTA_NET,MUL_MATprojection pairs,GET_ROWSsnapshot), so the same 8-launch protocol at 8 seconds each can narrow it to one, with no long context and no big model needed.Why this matters for the row, not just for me: the harness and its controls are now exercised on a configuration that runs inside the memory this box actually has, and the first thing they found is a deterministic disagreement rather than the fault under investigation. Any A/B between the fused path and its fallback must therefore expect different output for reasons that have nothing to do with the NaN -- otherwise a review of #2159 will read a legitimate rounding difference as evidence, or a real bug as noise.
Next, in cost order: (a) logit-level comparison on this same 1.2B config to decide rounding versus defect; (b) the same protocol with each dispatch name individually; (c) the 18.8k arms, which still need 60 GiB free and a quiet box.
bong-water-water-bong commentedon Nov 12, 2026
Logit-level answer to my own last comment: it is not rounding -- the fallback degenerates into text
I said the tied question was whether the fused-versus-fallback difference is legitimate rounding or a defect, and that the way to tell is the probabilities, not the token string. Here is that measurement on the same cheap configuration (LFM2.5-1.2B,
-c 512, greedy, fresh server per arm), reporting llama.cpp's ownlogprob/top_logprobs:DISABLE_DISPATCH=fused)atatthesecondaryRoyalrivCourtrivTheatrechThis is not a near-tie flipped by rounding. Token 0 agrees to
3e-3in log space -- the two paths are numerically identical there, which is what a legitimate accumulation-order difference looks like. At token 1 they differ by 1.81 in log probability, i.e. a factor of about six in probability, and from there arm A continues coherently (at the Royal Court Theatre) while arm B degenerates into fragments (at secondary riv riv ch). A rounding flip cannot produce a 1.8 log-unit divergence; a wrong tensor can.So the finding for the row is the opposite of the comfortable one: the fused dispatch is not merely a faster spelling of the fallback, and the fallback is what is broken here, deterministically (4 of 4 launches each, no co-tenancy on any launch, so this is not the #2159 nondeterminism and not contention).
One caveat I want stated against my own result.
GGML_HRX_DISABLE_DISPATCH=fusedis a substring selector, so it disables everyfused-named registration at once (L2_NORM, GATED_DELTA_NET, the projection pair, theGET_ROWSsnapshot), while the documented examples inhip/README.mddisable one named dispatch at a time (GGML_HRX_DISABLE_DISPATCH=hip.set_rows). So the claim I can defend is narrower and still serious: disabling the whole fused family at once does not fall back correctly on this model -- and the README's own contract for the switch is "must fall back to the CPU backend, no node failure", which this meets only in the letter: there is no node failure, and the output is silently wrong. A per-dispatch run is the next measurement, and it is cheap: the same 10-second pair, one name at a time, tells us which fused registration has no correct fallback -- or whether the problem is the combination being disabled, in which case the defect is that nothing refuses it.Why this matters beyond the pair: it is the first reproduction of a real fused-path defect that fits inside this box's memory (1.2B at 512 context, two launches, ten seconds, a 4 GiB gate), and it was found by the control I built to rule out a false lead. The 18.8k arms remain owed, but they are no longer the only way to make progress on the fused path.
bong-water-water-bong commentedon Nov 12, 2026
Correction to my own last comment, and the four names I tested are not the four I claimed
My previous comment said
GGML_HRX_DISABLE_DISPATCH=fused"disables L2_NORM, GATED_DELTA_NET, the projection pair and theGET_ROWSsnapshot". That was wrong -- I named those from memory of the registration priorities rather than from their strings, and none of the four containsfused.The substring matches two registrations in this tree:
And the measurement that follows from that is more interesting than the one I had planned. I ran each of my four assumed names individually on the same LFM2.5-1.2B /
-c 512/ greedy pair against the default arm:DISABLE_DISPATCH=<name>gated_delta_net.f32_wmma_head128at the Royal Court Theatre(same as default)direct.f32_wmma_head128projection_pairselected_snapshotAll four are bit-identical to the default, which is a good result for those registrations -- their fallbacks are exact on this model -- and it also means none of them is responsible for the degeneration. So what breaks when
fusedis disabled is one of the two names above, and LFM2.5-1.2B is dense, so a mixture-of-experts router kernel cannot be it:the remaining candidate is
qwen.attention_qkv_postprocess_fused_decode-- a registration carrying Qwen-specific compile parameters (rms_epsilon1e-6,rope_mscale,head_size128) that LFM2.5 decode apparently needs, because disabling it does not make the graph fail, it makes the answer nonsense (at secondary riv riv ch, 1.81 log units off at the first divergence). A fused kernel whose function is required rather than optional, and whose absence produces no node failure, is precisely the contracthip/README.mdstates for this switch: "must fall back to the CPU backend, no node failure" -- met in the letter, broken in the result.The decisive ten-second test is now specific, and it is queued behind cl-hrxnan's active
#2146measurement window rather than guessed at: disable onlyqwen.attention_qkv_postprocess_fused_decode, and the MoE name as a control, and see which one reproduces the degeneration. I have also bounded my harnesses' queue wait (-w 300/-w 600) after losing ten minutes to that window today -- they now decline in seconds instead of waiting silently behind another lane.bong-water-water-bong commentedon Nov 12, 2026
#2146: the gated 18.8k row on the routed-expert model, in the memory window (ORCH 11-12)
Ticket
cl-hrxnan-2146windowran 07:35–08:01Z. I stoppedcoder-llm, after which MemAvailable read 97 GiB (lowest during the run: 83). The script was.probe/g2146-18k.sh: Qwen3.8-Flash-Next UD-IQ3_XXS, build 962507f8e, shipped configuration,cwsr_enable=0. The settings were-np 1,cache_prompt:false, greedy, 512 tokens out, the same 18,782-token prompt each time, and one server for all requests. I sampled other processes on the CUs at 10 Hz for each request.The 25-minute cap stopped rep 5 (rc 124). The NaN guard printed 0 lines. Afterwards
coder-llmwas active and :8090/health returned 200. Before the window it was already returning 503, because its backend on port 41219 was answering 503.What this changes:
cwsr_enable=0is not needed to explain the 18.8k divergence. With one process, wave save/restore has nothing to save. Thecwsr_enable=1boot is still the test for the contention aborts, but not for this.Next: find which part of the routed-expert graph is not repeatable at 18.8k with the GPU to itself. Each request takes about 340 s and needs about 80 GiB, so every arm needs a window like this one. I will propose specific arms on the ORCH line rather than queue tickets.
The warning branch (
feat/2146-gpu-sharing-warning, not a PR) says "for repeatable output keep the GPU to one process", which this result contradicts. I am rewording it before anyone opens the PR.bong-water-water-bong commentedon Nov 12, 2026
I was wrong twice, and the second time is the useful one:
fusedis a category switch over 74 registrations, not a name matchGGML_HRX_DISABLE_DISPATCHlooks like a substring filter, and for every other value it is one:"fused"is special-cased to disable every registration whose kind isDispatchMatchKind::Fused. In this tree that is 74 registrations acrossdispatch-mul-mat(17),dispatch-routed-ffn(6),dispatch-rmsnorm(6),dispatch-gated-mul-mat(5),dispatch-gated-delta-net(4), the qwen rmsnorm/matmul/attention files, and more.So my previous two claims were both wrong, and I want them withdrawn explicitly:
fuseddisables L2_NORM + GATED_DELTA_NET + the projection pair + the GET_ROWS snapshot" -- wrong; those four names do not containfused.What the individual measurements actually show, and they are good news: every single registration I disabled by name on LFM2.5-1.2B at
-c 512produced output bit-identical to the default (max |delta| 0.00e+00):DISABLE_DISPATCH=gated_delta_net.f32_wmma_head128direct.f32_wmma_head128projection_pairselected_snapshotqwen.attention_qkv_postprocess_fused_decodellm.moe_router.projection_top8_fused_decodeSix per-name arms, six exact fallbacks. That is a positive result about this backend that I did not have before: on this model, every fused registration I can name individually has a numerically exact fallback.
The thing worth acting on is not a kernel bug, it is the switch:
DISABLE_DISPATCH=fusedsilently degrades the output. No node failure, no warning, just a different -- and incoherent -- answer, because a category-wide disable is not a configuration the graph can fall back through cleanly. A debug switch whose misuse looks like a finding, in the same issue where it was read as one (by me, yesterday, and it shaped two comments), should either refuse when givenfused, or say how many registrations it is about to remove. The per-name form is the one the README documents and the one the tests cover; the category form is the one that produces artifacts like my last two comments.Where that leaves the row: the "is the fused path numerically equivalent?" question is answered yes, per registration on this model, and the #2159 nondeterminism still does not reproduce at 512 context. The next honest step is the 18.8k arms (60 GiB free required; the box has 4 to 15), not more switch bisection.
serve: the #2146 note says what the 10 Hz window measured
bong-water-water-bong commentedon Nov 12, 2026
Context length alone is not the driver: 8 identical launches at
-c 4096on the 1.2B are bit-identicalMy last result was 4 + 4 launches at
-c 512with no nondeterminism, which left "it needs a long context" as the obvious next hypothesis. The GPU was free for a few minutes, so I tested it on the same cheap model rather than waiting for 60 GiB of headroom:Eight launches at four times the context, one distinct answer, zero NaN, no co-tenancy. So "the fault needs a long context" is not true on this model either, and the honest statement of the scope is now:
-c 512, 8 launches, identical ✓-c 4096, 8 launches, identical ✓-c 19456, Flash-Next (Qwen3.8), 2 of 3 NaN and three distinct hashes across three launches ✗Two variables still differ in that last row -- the model and the context -- and this measurement removes context as sufficient on its own. What it cannot remove is the model: Qwen3.8-Flash-Next is the one with the sparse/DSA attention path and the deep recurrent state, and LFM2.5-1.2B has neither in the same form. So the suspect set is now the model-specific paths -- top-k sparse selection, the fused GDN at depth, and the arena actually growing past its first capacity -- rather than anything the two configurations share.
Two things this also buys, beyond the row. The box can produce bit-stable runs at 4096 context on a 1.2B model, so a later "it differs" at that size will be a real finding and not the box's usual jitter; and the harness now carries
--ctx/--out, so the same check at 8192 or on a different model is one command. The 18.8k Flash-Next arms remain owed and still need 60 GiB free -- this measurement narrows what they have to tell us, it does not replace them.bong-water-water-bong commentedon Nov 12, 2026
The failing context length on a different model is bit-stable: the fault is model-specific, not long-context
The last measurement left two variables in the failing row -- the model and the context -- and removed context at 4096. This one removes it at the exact length where the fault appears:
So "long context" is eliminated as a sufficient cause, at the same length, with the same request, on the same build, on this box, with no co-tenancy in any of the 24 launches. What remains is the model: Qwen3.8-Flash-Next is the configuration that has
Every one of those is now a live suspect precisely because the generic path has been measured stable three times over, at lengths that bracket the failure. That is a much smaller box than the one this issue opened with, and it is a box that can be bisected without the 60 GiB the Flash-Next arms need: a small model that carries one of those three features isolates it, and the harness runs that in a couple of minutes.
Two methodological notes, since they cost me time earlier in this issue. The 24 identical launches across 512 / 4096 / 19456 are the control that makes the Flash-Next result meaningful: without them, "it differs at 19k" could have been a property of the context, the allocator or the box. And every launch here carries a
COTENANT:verdict -- all 24 ACCEPT,evicted_ms=0-- so none of this is contention, which is the one confound I can now exclude by construction rather than by argument.bong-water-water-bong commentedon Nov 12, 2026
#2146: the gated delta net alone is not the trigger. Qwen3.5-4B (GDN + dense FFN) at 18.8k is repeatable.
This takes one of the three suspects from the 10:01Z comment off the list without an 80 GiB window. It uses the same request as the Flash-Next window row: 18,782 prompt tokens,
-c 19456 -np 1,cache_prompt:false, greedy, 512 tokens out, one server, build 962507f8e. Every request was checked at 10 Hz for other processes on the CUs. Ticketcl-hrxnan-2146q35, 169 s.llm.gated_delta_net.f32_wmma_head128,llm.ssm_conv.*,flash_attention_f32_f16_{wmma,gate},flash_attention_decode_split_next_q8mul_mat_id.*,mul_mat_id_swiglu,moe_router.top8,hip.top_k_f32So the fused GDN kernel and the prefill and split-decode attention kernels are all repeatable at this length on their own. What only Flash-Next runs is the routed-expert set:
mul_mat_id,mul_mat_id_swiglu,moe_router.top8_f32,hip.top_k_f32. A large weight set is still possible as well. The next arms should cover those (GGML_HRX_DISABLE_DISPATCH=mul_mat_id, then=top_k, then=moe_router) on Flash-Next at 18.8k, using a fork build that logs which registrations each pattern removes (llama.cpp branch1bit/2146-disable-dispatch-log). A small routed-expert model would be cheaper if one is on the box: I found none under~/modelsbelow 12 GiB.bong-water-water-bong commentedon Nov 12, 2026
The 60 GiB-free gate for the 18.8k row is not folklore: at 33 GiB the prefill stalls instead of failing
Tried the row on the clean pin (
0494dfa28, rebuilt,GGML_HRX_POISON_*/NO_ZERO_ARENAgone) because my earlier NaN rows were taken on a WIP build, and the box had a free GPU and 33 GiB free:So the model loads (placement report) and then the prefill does not progress in 19 minutes, against the 425 s of work the same row measured under the gate. That is not a slow run, it is a stalled one, and it does not produce a failure to read -- which is exactly why an unbounded wait is worse than a refusal: a lane would sit in it.
Why I am writing it down: the 60 GiB figure has been a rule in my harness (and cost me arguments about being conservative). This turns it into evidence. At 33 GiB free the 18.2 GiB model plus the 19.4k KV and the transient arena leave the prefill crawling in GTT, which on this APU is host RAM, and progress stops rather than erroring. The gate refusing the ticket is the correct behaviour, not caution.
Consequence for the row: the 18.8k Flash-Next arms still need a window with 60 GiB free and a quiet box, one launch at a time,
COTENANT:recorded. What I could do without that, I did: the model-specific narrowing (1.2B bit-stable at 512 / 4096 / 19456, 24 launches, all ACCEPT) and the per-registration equivalence (six names, all0.00e+00) both stand, and neither needed the big model.bong-water-water-bong commentedon Nov 12, 2026
#2146: two arms that disable routing selection on Flash-Next at 18.8k. Neither gives a reply, and one shows a defect in the debug switch (fixed on a fork branch).
Both arms ran under gpu-hold with the same request as the 08:01Z window row, build 962507f8e. MemAvailable was 64 and 68 GiB at start,
coder-llmwas left running, and the gate was 60 GiB.GGML_HRX_DISABLE_DISPATCH=top_k,moe_routercl-hrxnan-2146arm-route, 243 sunsupported HRX node 1: TOP_K output=i32[2051,512] <- f32[2560,512]hip.top_k_f32,moe_routercl-hrxnan-2146arm-topk, 600 sThe defect (first row). The registry treats each pattern as a substring of the registration name. The two
supports_opclaims that must decline along with their only registration check the other way round: they look for the full namehip.top_k_f32orcommon.argsort_rows_f32inside the variable. So=top_kremoves the TOP_K matcher but keeps the claim, and the node stays on HRX with nothing to run it. On llama.cpp branch1bit/2146-disable-dispatch-log@ 349c466a7,dispatch_name_disabled()is now the one rule, used by the registry and both claims. That branch also logs every registration a pattern skips. The changed files compile against the bench build; the claim path has not been run on a device.What the TOP_K node is. Its shape is 2051 picked from 2560 per row, at 2048-token ubatches. That fits the sparse-attention indexer's KV selection better than the expert router (which picks top 8). So the indexer's selection, a top-k over a growing KV with possible ties, is a suspect alongside the routed-expert set from the 10:05Z comment. It also starts only once the KV is past 2048, which fits a fault that depends on length.
Why this arm cannot answer it as built: with TOP_K on the CPU, every ubatch becomes several graph splits, a request takes about 15 minutes, and the server crashed partway through. The next useful step needs a decision (ORCH line in my state file):
bong-water-water-bong commentedon Nov 12, 2026
#2146: the HRX TOP_K kernel (
hip_top_k_f32) is not repeatable. Fixed on llama.cpp1bit/2146-disable-dispatch-log@ 3e8441251.The 12:42Z comment pointed at the sparse-attention indexer's TOP_K (2051 picked from 2560). I then ran the kernel on the device by itself, with no model:
topk_repeat, build 962507f8e), 20 runs per shape;All tickets were short
cl-hrxnan-2146topk*ones.The ggml route showed the same: the CPU backend was identical on every run, and HRX differed on every run.
Two defects:
bucket_found/take_foundat the start of the next level before every lane has read them. A slow lane then publishes a wrongthreshold_key, which produces rows that are not a top-k and different sets even with distinct inputs. One__syncthreads()after the reads removes it: "old plus barrier" had 0 invalid rows and a stable set with distinct inputs.Cost: 2560 → 2051 × 512 went from 45–50 µs (old plus barrier) to 112–141 µs; one 200,000-element row went from 277–297 to 345–382 µs. With 2048-token ubatches taking about 30 s each on Flash-Next, that is well under 0.1 % of prefill.
Not yet shown: that this removes the 18.8k divergence end to end. That needs a fork build with this branch and one more Flash-Next window of 3 requests. The ORCH line in my state file asks for both. If it is confirmed, #2146 closes on an engine pin bump to this fork commit. #2159 (flint at 8.8k) is worth re-checking on the same build if flint runs this kernel.
Bump llama.cpp (hrx) 962507f8e -> 9dd1a1b72: hip_top_k_f32 gives the …
llama.cpp: pin e7796262e, GGML_HRX_DISABLE_DISPATCH=top_k / =argsort_…