Skip to content

npu: after a failed runlist the serve keeps answering code 614 on a dead context (a fresh process answers 200) #1013

Closed

Description

@bong-water-water-bong

What happens

On the appliance, one driver TDR leaves the serve process with a dead context, and nothing in it notices: the
request that hit the TDR is answered with the runtime's error, and every later request on that same process fails the
same way
— while a fresh process on the same, already power-cycled device answers 200.

Measured on the c22 board (rc-2026-11-04-c22, amdxdna 0007, boot 12:23 AST), from /data/logs/.../lemond.log and the
same boot's dmesg (captured on ryzen, ~/tmp-ort/puppy-c22-hw/):

when what result
12:24:27 1bit unified -m /data/models/Qwen3-0.6B -p 8001, private route dx, dx: kernel set serves up to 4096 cached tokens (128 attention blocks) ready in 606 ms
12:56:27 a chat that crossed ~512 positions SSE frame npu runtime: invalid call (code 614): state 8, run 0 of 28; dmesg aie2_tdr_recover_all: Array stopped dispatching, power-cycling NPU
13:10 a short request on the SAME serve pid (alive 44 min) HTTP 500, same 614, and a second TDR (aie2_tdr_work_func: Device isn't making progress → power-cycle)
13:10 Lemonade unload + load (serve pid 39326 exits, new serve process) 200 OK, coherent text, no module reload

So the device recovers (0007 power-cycles it), the client does not. Reproduce-on-demand from the orchestration:
max_tokens 400 → 429 positions OK, 480 → 509 OK, 600 → crosses 512 → 614 + 1 TDR, fresh backend each time
(temperature 0, /no_think).

Where it comes from, in public code

npu/lane.cpp waits on a runlist; runlist::wait() (npu/npu_rt_api.h) throws when a run did not complete, and the
runtime's message is the one above. app/unified.cpp catches it, writes the error frame (stream) or a 500 (non-stream),
and carries on serving on a context the driver has already power-cycled under it. The engine cannot rebuild that
context: the hwctx and BOs belong to the private runtime's session (npu/private_route.h), and there is no public call
to re-create one.

Proposal (smallest fix with measured evidence behind it)

1bit unified answers the failing request exactly as today, then exits non-zero, which is the contract serve
already implements for a backend that lost its device (app/serve_watchdog.h, device_lost_line → kill, exit non-zero,
Lemonade's BackendWatchdog reloads). On this device a reloaded backend is the measured-good state (the 13:10 row above).
Teardown stays cooperative: stop accepting, let the workers join, let the Engine destruct, return 1 — no thread killed,
no _exit().

Known limit, and it is another issue's: a load started ~2 s after an evict can die twice on the appliance (#1010), so the
user's Retry may need one more attempt. That is the reload path, not this defect.

Scope

Activity

  1. added
    bug
    npu
    on Nov 4, 2026
  2. bong-water-water-bong commented on Nov 4, 2026

    @bong-water-water-bong
    CollaboratorAuthor

    Local rows for this issue, so the record is not only the board's: with the c22 board's own binary and kernels on this box's fleet boot, the ladder is clean, so the wedge does not reproduce here (details in #1017) — and the fix's healthy-path row matches.

    row payload binary (unfixed) this PR's build (fixed)
    64 tok 200, 0 TDR 200, 0 TDR
    400 tok 200, completion 400, 0 TDR 200, completion 400, identical text, 0 TDR
    480 tok (525 positions) 200, 0 TDR 200, identical text, 0 TDR
    600 tok (645 positions) 200, 0 TDR 200, identical text, 0 TDR
    600 tok streamed 200, 598 SSE lines, [DONE], 0 TDR 200, 598 SSE lines, [DONE], 0 TDR
    16 tok, same process / fresh process 200 / 200 200 / 200
    amdxdna.*ERROR / Array stopped dispatching 0 / 0 0 / 0

    Logs: ~/lb/c22ladder-20261104/run3.log (payload) and run5.log (fixed), each under one npu-hold ticket.

    The 614 → exit 1 row is not in this table, and I will not claim it: getting a 614 on this boot on demand needs pi-hrx-fabric's provocation (modprobe amdxdna tdr_timeout_ms=1 + one long dispatch), i.e. a module reload, which is an owner decision. Asked in ~/briefs/TNPUFEAT-STATE.md under ## OWNER. If declined, the c23 appliance's chat-npu-after-tdr row is the measurement.

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

    bugnpu

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions