Skip to content

loom: Flash-Next IQ3_XXS card registers only after an ssm_out Q6_K fix, then dies at first inference with gpu.event_wait (DATA_LOSS) #3482

Backlog

Description

@bong-water-water-bong

Summary

The Loom card for the file this fleet ships and measured in #679 — Qwen3.8-Flash-Next UD-IQ3_XXS — is a UD-Q4_K_XL splice (/data/dev/cl-i679/flashnext-card, variant ud-iq3-xxs-vision-mtp) and it does not serve:

  1. Registration fails with blk.2.ssm_out.weight requires 16711680 bytes from checkpoint source zero, but its entry has 12902400. Root cause: the card kept the UD-Q4_K_XL card's layer-2 q8_0 special case for ssm_out; the IQ3_XXS file is Q6_K in all 36 layers. Forcing the q6_K path in program/dispatch/projection.loom makes registration reach ready.
  2. It then dies on the first inference (~32 s) with IREE HAL device event: driver_failure status=DATA_LOSS(15) backend_result=0x9 message="gpu.event_wait" — no amdgpu/MES kernel fault. Reproduced with drafting on and off and with --pool_backing=fixed + the card's completion_spin_ns=4294967295 device URI.
  3. The appliance and GPU are fine: same session, fallback llama.cpp llama-bench -m Qwen3-0.6B-Q4_K_M -dev HRX0 -ngl 99 -p 0 -n 8 = 351.46 tok/s, no faults. So the failure is the card's programs for this file. Remaining likely cause: more UD-Q4_K_XL quant-layout assumptions (e.g. the routed-expert kernels) that registration's size checks do not catch.

Consequence: the Flash-Next IQ3_XXS row of the #3158 gate cannot be measured until the card is re-ported for IQ3_XXS. #679 was closed as not planned (llama.cpp route frozen), so this is Loom-coverage work.

Environment

  • strixhalo / 1bit-OS appliance, gfx1151, kernel 7.4.0-rc1-1bit, 124 GB unified.
  • hrx-loom 0.3.0 (loom-serve commit e2c41a72) at /data/dev/cl-i679/hrxloom030.
  • card: /data/dev/cl-i679/flashnext-card (variant ud-iq3-xxs-vision-mtp; 4 IQ3_XXS GGUF shards, mmproj-BF16, MTP Q8_0).
  • deployment used: /data/dev/cl-i679/takeover/loom-fn-32k.json (32k context, 4k prefill, rows 1, draft_depth 3); a draft_depth 0 variant was also tested.

What passes

  • the two stalled loom-run recordings on this card (lrb-c16: IQ4NL/Q2_0 down experts at chunk16; lrb-ic16: IQ2_S): all rc=0 — the dequant kernels themselves are fine.
  • reference GPU work in the same ticket: llama-bench 0.6B Q4_K on HRX0 = 351.46 ± 0.00 tok/s; no faults, no OOM.

Failure 1 — registration byte-size mismatch, and the fix

Per-layer quant types in the IQ3_XXS file (parsed header of all four shards):

tensor types across 36 layers
blk.*.ssm_out.weight 36 × Q6_K (6144×2560, 12,902,400 B)
blk.*.attn_qkv.weight 35 × Q6_K, blk.2 Q8_0 (27,852,800 B)
blk.*.attn_gate.weight 35 × Q6_K, blk.2 Q8_0 (16,711,680 B)

The card's program/dispatch/projection.loom special-cased layer 2 for all three (fn_is_layer2): q8_0 views <2560x192x34xi8> for ssm_out. That is right for blk.2 attn_qkv/attn_gate (they really are Q8_0), but wrong for ssm_out, where every layer is Q6_K, so registration demanded 16,711,680 B from a 12,902,400 B entry.

Fix applied in the lane artifact: ssm_out now always takes the q6_K path (view<2560x24x210xi8>, @fn.project_dense_q6k); original kept as projection.loom.orig-20261124. With that, registration reaches registration: "ready" and /v1/models lists the model.

Failure 2 — first inference (unfixed)

With registration ready, the known-answer request (17×23 → 391, max_tokens 16, temperature 0, chat_template_kwargs.enable_thinking false) returns nothing after ~32 s (http=000), and serve.log carries:

IREE HAL device event: type=driver_failure severity=error sequence=0
  driver_failure: status=DATA_LOSS(15) backend_result=0x0000000000000009 message="gpu.event_wait"
  device: driver=amd device=n/a physical_device=n/a queue=n/a executable=0x0000000000000000 export=n/a

Reproduced with: draft_depth 3 and draft_depth 0; --pool_backing=fixed; device URI 'amdgpu://?completion_spin_ns=4294967295'; fresh server each time. dmesg/journal has no amdgpu or MES fault and no OOM.

Reproducer

D=/data/dev/cl-i679; HSA=/opt/rocm-therock/lib/libhsa-runtime64.so.1
IREE_HAL_AMDGPU_LIBHSA_PATH=$HSA $D/hrxloom030/scripts/loom-serve \
  --model=$D/takeover/loom-fn-32k.json \
  '--device=amdgpu://?completion_spin_ns=4294967295' --pool_backing=fixed \
  --listen=127.0.0.1:18311 --heartbeat_ms=0
# in another shell (after /v1/status says registration ready):
curl -s localhost:18311/v1/status
curl -s -w '\nhttp=%{http_code}\n' localhost:18311/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"Qwen3.8-Flash-Next-IQ3_XXS-32k","messages":[{"role":"user","content":"What is 17*23? Answer with the number only."}],"max_tokens":16,"temperature":0,"chat_template_kwargs":{"enable_thinking":false}}'

Pre-fix this fails at registration (message in Failure 1); post-fix registration is ready and the chat request dies as in Failure 2.

Suggested next step

A real IQ3_XXS port rather than more one-line fixes: regenerate/validate every weight view and kernel the card takes from the file (routed experts prominent among them) for the IQ3_XXS layouts, then registration + known-answer and the #3158 speed row (Loom vs fallback at short/2k/18.8k) can run.

Alternative if an IQ3_XXS port is not wanted now: gate the published unsloth-Qwen3.8-Flash-Next-loom card against the UD-Q4_K_XL file it was built for (116.4 GB of shards; card asks ~118 GB device memory — fits this 124 GB appliance, not a 32 GB GPU), and keep it out of the IQ3_XXS row; the gate row then is not for the file this fleet actually ships.

Evidence retained

/data/dev/cl-i679/takeover/README.md and takeover/out/probe*/ (status JSON, serve logs, request/answer captures); card program patch + .orig backup in /data/dev/cl-i679/flashnext-card/program/dispatch/.

Refs: #3156 (coverage), #3158 (gate), #679 (closed, not planned).

Activity

  1. added
    bug
    hrx
    on Nov 24, 2026
  2. bong-water-water-bong commented on Nov 24, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Follow-up: root cause narrowed to the three new IQ-format kernels. Full card registers on this appliance, then the first request GPU page-faults — the appliance has no persistent journal, but rsyslog in /var/log/messages has it:

    amdgpu: [gfxhub] page fault (src_id:0 ring:24) ... Process loom-serve ... in page starting at address 0x7f...
            GCVM_L2_PROTECTION_FAULT_STATUS:0x00801031  Faulty UTCL2 client ID: TCP (0x8)  PERMISSION_FAULTS: 0x3  RW: 0x0
    amdgpu: MES failed to respond to msg=REMOVE_QUEUE ... GPU reset begin! ... GPU reset(3) succeeded! ... device wedged
    

    The faulting addresses are GPU-visible host mappings of the loom-serve process (not VRAM), so this is a kernel read/write outside a mapped model buffer; failure_timeout_ms=900000 changes nothing (it is not a completion timeout).

    Bisect (method: make a spliced kernel's body empty — kernel.return only — so registration and command-level parameter binding stay valid):

    • Stub all seven new kernels → request succeeds (HTTP 200, garbage tokens, no faults). The stock card programs, PLE gather, head, tokenizer and serving plumbing are fine.
    • One active kernel at a time, one 2-token request each:
    active kernel result
    expert_down_iq4nl page fault + reset
    expert_down_q2_0 clean
    expert_gate_up_iq2s clean
    expert_gate_up_iq3xxs page fault + reset
    expert_gate_up_iq4xs faulted once, clean on re-run (flaky)
    fn_linear_q6k clean
    fn_shared_gate_up_q6k clean

    Fault regions differ per kernel (IQ3_XXS: 33.2 MB host mapping at ~27.9-28.4 MB; IQ4_NL: 4.2 MB mapping at ~3.1-3.2 MB), so these are separate out-of-range accesses in the hand-written format helpers — IQ3_XXS (ggml_kquant_iq3xxs_lane_parts path) and IQ4_NL/IQ4_XS (fn_chunk_partial formats 0/2) — not one shared bug. IQ2_S, Q2_0 and Q6_K paths are clean.

    So the port is close: three helper paths need the expert/feature extremes and sub-block indexing checked against gguf-py, then known-answer and the gate row. Harness (stub_test.sh, bisect_active.sh) and evidence are in /data/dev/cl-i679/takeover/.

  3. bong-water-water-bong commented on Nov 27, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    cl-i679 (the card's author), picking this up from the board. Thank you for the bisect and the takeover notes, which narrowed it a long way.

    Failure 1 is mine and is fixed in the generator, not only in the staged card. My splice wrapped ssm_out in the same layer-2 Q8_0 branch as attn_qkv / attn_gate. Against the file's header census, ssm_out is Q6_K in all 36 layers, and the other three layer-2 exceptions (attn_qkv, attn_gate, shared gate/up) really are Q8_0. The splice now binds ssm_out as Q6_K in every layer.

    Failure 2, ruled out offline (no box time):

    • The layer -> format dispatch: the generated layer sets equal the file's map exactly (IQ3_XXS 21 layers, IQ4_XS layer 47, Q2_0 down 8/10/13), all tested against %layer. So no kernel is pointed at a smaller tensor.
    • Constant data / rodata reads: I compiled the two faulting kernels (expert_down_iq4nl, expert_gate_up_iq3xxs) and two clean ones (expert_down_q2_0, expert_gate_up_iq2s) for gfx1151. All four have only the 64-byte kernel-descriptor .rodata, no s_getpc, and no relocations. The IQ4 codebook table.lookup compiles to selects (IQ4_NL .text 10.5 KB vs Q2_0 3 KB). So every load goes through a buffer argument.
    • The span read: @flash_next_token_count reads word 0 of the epoch only.
    • Static address arithmetic: checked twice, matching your offline review.

    What fits what's left: a data-dependent address, i.e. a value read at run time (an expert id or the live token count) driving an otherwise-correct load out of range. That would explain why bounded unit tests pass, the served card faults, and IQ4_XS is flaky.

    Next: one exclusive box ticket with diagnostic builds of the three faulting kernels that cannot fault. Each variant clamps one class of runtime-derived offset to its buffer:

    • (A) expert id <= 511;
    • (B) weight offset <= buffer.length(weight);
    • (C) activation offset <= buffer.length(input).

    Whichever variant stops the fault names the bad access. I cancelled my own queued registration ticket for this card before it ran: with failure 1 fixed it would have reached inference and reset the GPU for everyone.

    🤖 Generated with Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughrx

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions