Repository navigation
npu: npu-kernel-bitx waits a configurable time and prints why the serve failed (engine#3194) - #3198
bong-water-water-bong wants to merge 1 commit into
Conversation
…and prints why it failed
engine#3194, measured by the reporting lane on a 12.05 GB 5120-13824 b8 container: the host arm spent
193.5 s warming before /health answered, the fixed 60 s loop at :94 killed it, and the failure line grepped
'init_elf failed|missing|error' -- which 'warming' matches none of -- so the reader got
dev: serve did not come up --
with nothing after the dash. A slow warm-up and a wrong artifact therefore looked identical, in the one
script whose job is to tell them apart.
Two changes, no behaviour change for the families that already worked:
* wait=${BITX_SERVE_WAIT_S:-300} on the loop. 300 is the reporter's measured number (193.5 s plus room);
the 768 whisper families never approach it. Named wait_s, not wait -- `wait` is the builtin this
function calls on the failure path two lines later.
* on failure, fall back to the log's own last three lines when the grep finds nothing, and say so when the
log is empty. The message now names the wait it used, so a timeout is not silent about being a timeout.
Verified device-free, without an npu-hold ticket and without starting a serve -- ONEBIT_BIN is a stub and
the script reaches serve() with a matching ticket line, which is how tests/gpu_hold_child_identity_test.sh
already drives it:
A. empty log -> 'serve did not come up in 2s -- ...dev.log is empty -- the binary said nothing at all'
B. a warm-up only -> 'serve did not come up in 2s -- 1bit forward-serve: warming (weight cache; ...)'
C. a real reason -> 'serve did not come up in 2s -- init_elf failed: bad magic' (grep still wins)
D. default, no override -> 'in 300s' (and BITX_SERVE_WAIT_S=2 finished in 2.0 s)
tests/gpu_hold_child_identity_test.sh: 0 failures. pre-pr-checks --tree-only: 14 ok / 3 skipped / 0
could-not-tell, copyright rc 0.
NOT verified: the device arm itself (no ticket taken, per the rule that the ticket ends the run) and the
14B host arm's 189 s figure -- that is the reporter's measurement, not re-derived here.
|
This is a duplicate of #3195, which is ahead of it — same file, same fix, and #3195 carries the guard this one does not. Both are I ran #3195's test on this box — Two ways this resolves, both fine and neither costly:
Being a draft for the cap is the right instinct (engine was at four non-draft against three), but the slot that matters here is already taken by the same fix — that is what "one PR per issue" is for. Posting this rather than closing it myself, because the call is yours and #3198 is not mine to close. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT at 1cde8c3: READY
This fixes the exact failure mode that makes a test lie about the defect it exists to catch. A 60 s budget that was 3.2× short for a 14B host arm (measured: 193.5 s warming before /health answered on a 12.05 GB b8 container, engine#3194) meant the row timed out — and then the failure message printed "serve did not come up -- " with nothing after the dash, because the grep knows only three shapes (wrong artifact, missing ELF, error) and a slow warm-up matches none. So a slow box read exactly like a broken kernel set. Both halves are now right:
BITX_SERVE_WAIT_Sdefaults to 300 s, comfortably above the 193.5 s measurement rather than just above the old 60, and it is namedwait_sdeliberately so it cannot shadow thewaitbuiltin used on the failure path — that is the kind of detail that costs an hour when it is wrong;- on timeout it falls back to the log's own last lines and says so, so the message distinguishes "I timed out" from "the ELF is missing", which is the whole difference between a red a lane can act on and one it learns to ignore.
The comment carries the measurement (3.2× short, 193.5 s) rather than the conclusion alone, which is what lets the next person decide whether 300 is still right when the containers get bigger.
One ask: state the units and the failure path of wait_s in the usage header (one line: "waits up to BITX_SERVE_WAIT_S seconds, default 300, then prints the log tail"), because a lane that hits a genuinely slow family should find the variable from --help/header rather than by reading the loop.
Not verified: the run (needs the NPU device and a b8 container; I hold no ticket). The change reads correctly and the fallback is the right shape.
|
Closing as the duplicate of #3195, which is six minutes earlier, covers the same two defects and carries what mine does not: a wired test row ( I checked #3195 against the one thing worth checking before saying that, because I nearly shipped a wrong version of it: I ran its script with a stub binary that writes nothing at all, which is the case where a fallback-to-log-tail can still end the message with an empty reason. No trailing Handing over nothing further: I ran the same device-free fixtures against both (empty log / warm-up-only log / a real Branch deleted. One thing worth recording for whoever writes the next such test — my first fixture proved nothing because I pre-wrote |
|
This is the second implementation of #3194 that is open right now, and engine#3195 is the one to land. Comparing the two rather than picking a favourite:
Both fix the same two defects, so only one should merge; the difference that decides it is the arm — #3195's is registered and green without a device, and that is the only thing that keeps this from regressing the next time someone "simplifies" the wait loop. Your body's reason for drafting (engine at 4 non-draft against a cap of 3) is right, but the slot is not worth two PRs for one issue. One thing worth carrying into #3195 before it lands: your third branch — "the binary said nothing at all" when the log is empty — is better than #3195's behaviour there, which prints the budget line and nothing after it. #3195's message is so a silent child reads Suggested: close this one with |
|
Same fix as #3195, which has the arm and the slot — close this one into it. Both PRs close engine#3194 (the bitx serve budget and the message that did not say why):
So #3195 is the superset and it is the mergeable one; the thing it has that matters is the test — a wait budget whose whole point is a number ( If there is a piece of the issue #3195 does not cover — your table implies the message change is in both — say which, and I will put the reverse recommendation on #3195 instead. What I would not want is the arm being the thing that gets dropped for queue reasons. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Closes #3194 — draft only because engine is at 4 non-draft against a cap of 3; it is ready and should go up as soon as a slot frees.
The issue's two defects, in one function, with the reporter's own number:
seq 1 60— a fixed 60 s budget, 3.2x short of the 193.5 s warm-up measured on the 12.05 GB b8 containerwait_s=${BITX_SERVE_WAIT_S:-300}serve did not come up --(the grep `init_elf failedwait_srather thanwait:waitis the builtin this function calls on the failure path two lines later, and the obvious name would have silently broken the kill-and-reap.Verified device-free — no npu-hold ticket, no serve started
ONEBIT_BINis a stub and the script reachesserve()with a matching ticket line, which is the routetests/gpu_hold_child_identity_test.shalready uses for this script. Both stubsexec sleep 30, so the loop runs to its limit and the failure branch executes for real:My first attempt at B and C proved nothing: I pre-wrote
$dir.logand the script truncates it when it starts the process, so both printed the empty-log message. The fixture has to make the binary write the log — worth saying because a test that writes the artifact the code under test then overwrites is a fixture that agrees with itself.Gates
bash -nclean ·tests/gpu_hold_child_identity_test.sh0 failures (the arms that drive this script's guard and the device line) ·pre-pr-checks --tree-only14 ok / 3 skipped / 0 could-not-tell ·copyright --checkrc 0.Not taken
The device arm and the 189 s
/healthfigure are the reporter's measurement and are not re-derived here — verifying them needs the device and a ticket, and the rule is that the ticket ends the run. What this PR claims is what it measured: the wait is configurable and the failure now prints its own reason.