Repository navigation
docs: the NPU runlist-failure contract (what a 614 does to the request and the process) - #1058
Conversation
…t and the process) The engine has answered a failed runlist this way since #1021, and the doc said nothing about it, so an operator who sees `npu runtime: invalid call (code 614): state 8, run 0 of 28` and a backend that exited 1 has nothing to read. Documents: the error frame's shape and how to read it (category = hundreds digit, `run N of M` = the layer run inside the token's runlist); that the failing request is answered and the process then exits instead of serving on a dead context (the c22 board's backend answered 614 to every later request while a fresh process answered normally, so an in-process retry is not available to the engine); that a supervisor rebuilds the context; and that when even a fresh backend cannot create one the device needs the driver reloaded, which backend restarts cannot fix. Points at `app/serve_watchdog.h` (`npu_run_failed`) and `tests/serve_watchdog_test.cpp`. Behaviour only: no numbers, no model rows, and no claim about how often a runlist fails.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 270cd84a — docs only, and every claim in the section traces to a line of code I checked.
The contract as written matches the implementation:
- "answers the request that hit it with an error frame and then exits non-zero" —
handle_generate()(unified.cpp:158) takes anon_run_failedcallback, and both call sites (:301,:335) fire it only whennpu_run_failed(ex.what())is true, i.e. the frame goes out first and the exit is requested after it. - the classifier it points at —
app/serve_watchdog.h:59iswhat.find("npu runtime:") != npos && (find("(code 614)") || find("ERT_CMD_STATE_TIMEOUT")). The doc's "match its own prefix plus either code, never a barestate 8" is exactly that, and the test pins it in both directions:expect_npu(true, "npu runtime: invalid call (code 614): state 8, run 0 of 28"),truefor theERT_CMD_STATE_TIMEOUTspelling, andfalsefor a bare"npu runtime: state 8"and forcode 500. run N of Mis the layer run inside the token's runlist — that is the string the runtime builds innpu_rt.cpp'sfail(errc::runlist_failed, "state N, run M of K"), which I read while reviewing npu-kernels #26 tonight, andMisruns.size().- "the driver refuses new contexts until
amdxdnais reloaded" — matches the-ENODEVcascade recorded in that same lane's evidence for the per-count fallback (aie2_hwctx_restart: … has no host buffer address, then every new context refused). - "
tests/serve_watchdog_test.cpp(ctestserve_watchdog, in CI)" — real and registered; I built and ran it tonight as one of #1055's three tests (3/3 passed).
tools/copyright.py --check rc 0. The section sits in the unified-serve part of docs/npu.md next to the endpoint examples, which is where an operator who just pasted that 614 into a grep would land. No numbers, no model rows, no frequency claim — so nothing here can go stale behind a measurement, which is the right shape for a contract section.
One thing I would add if the file is touched again, not a change request: the section explains when a 6xx is fatal but not how to tell it apart from the 614 a client sees when the device is already wedged (the case where a fresh backend also fails). The last paragraph does say "if a fresh backend also fails, the device is the thing to look at", so the information is there — a one-line cross-reference from the "device is wedged" symptom to this section would close the loop for someone reading from the other end.
Docs only. The engine has answered a failed runlist this way since #1021 and
docs/npu.mddid not mention it, so anoperator who sees
in a client and a backend that exited 1 has nothing to read.
What the section says
6xx= a call made in the wrong state or onthe wrong object), and
run N of Mis the index of the layer run inside that token's runlist that did not complete;non-zero, rather than serving later requests on a hardware context whose state is dead — with the reason the engine
cannot do better in-process (the c22 board's backend answered 614 to every subsequent request while a fresh process
answered normally);
context, so a client sees one failed request and the next lands on a working backend;
contexts until
amdxdnais reloaded, and backend restarts cannot fix that;app/serve_watchdog.h(npu_run_failed()) andtests/serve_watchdog_test.cpp.Behaviour only: no numbers, no model rows, no claim about how often a runlist fails. It deliberately does not
describe the firmware-side cause, which is still open.
tools/copyright.py --checkrc 0. One file, docs.