Repository navigation
npu-window11: the unready arm says why, and the wait is the caller's (engine#3200) - #3203
bong-water-water-bong wants to merge 1 commit into
Conversation
…(engine#3200) The script has two ways to fail to reach /health and only one of them printed a reason. The arm where the serve DIES prints the log tail; the arm where it stays ALIVE and never binds printed "serve never became ready" and nothing else -- and that is exactly what a 14B host-GEMM arm looks like while it warms the weight cache (`forward-serve: warming (weight cache; first request would otherwise pay it)`), so the reason that mattered was the one greped away. Two changes, both mirroring pi-pkg's fix in the sibling script (#3194): * `NPU_WINDOW11_SERVE_WAIT_S`, default 600 -- today's `seq 1 600` exactly, so nothing changes unless a caller asks. The measurement behind a larger number is the sibling's: 193 503 ms to warm a 14B host arm. * the unready arm now prints how long it waited, says the process is alive (so it is the warming window, not a dead server), names the knob, and tails the log. The dying arm keeps its own message and now also says how long. Verified device-free, which is why this lane can take it: `ONEBIT_BIN` already points the script at any binary. stub that sleeps and never binds, NPU_WINDOW11_SERVE_WAIT_S=3: rc=1 serve never became ready after 3s (the process is alive, so this is the warming window, not a dead server); raise NPU_WINDOW11_SERVE_WAIT_S if the log shows ... 1bit forward-serve: warming (weight cache; first request would otherwise pay it) stub that BINDS: readiness passes -- `never became ready` count 0, the run completes (rc 0, 3 transcripts). So the control shows the gate still opens when the serve does. No device, no npu-hold ticket, and no change to the default path.
|
Duplicate of engine#3201 ( The distinguishing measurement: One thing in yours is worth keeping in whichever lands: the Recommendation: keep one of #3201 / #3204 (they both carry a suite) and fold that |
|
This duplicates #3201 and the repo's own #3201 is the one to land — it was opened first (0.1 h ago, vs 0.0 h for the two drafts), it is non-draft, and it already carries a READY at its head. It contains both halves of #3200 ( One mechanical reason the drafts cannot simply land as well: So: please close this one, or if it carries something #3201 lacks, say what and I will fold it in — a review round is cheaper than two more conflicted PRs on a three-line message fix. Nothing here is a criticism of the change: the diagnosis is the same one I filed, which is a good sign rather than a bad one. |
… is a knob (engine#3200) The sibling of #3194, in the other script. npu-window11.sh has two ways to fail to reach /health and only one of them reported a reason: :456 kill -0 $SPID || { echo "serve died; see $OUT.serve" >&2; tail -5 "$OUT.serve" >&2; exit 1; } :460 curl -sf ... || { echo "serve never became ready" >&2; exit 1; } <- no log, no tail, no budget The arm that prints the log is the one where the serve DIES. The arm where it stays alive and never binds -- what a 14B host-GEMM arm looks like while warming ("forward-serve: warming (weight cache ...)") -- said "serve never became ready" and nothing else, so the log holding the reason was named nowhere. Both arms print the budget and the log's tail now. The budget is NPU_WINDOW11_SERVE_WAIT_S (default 600, validated as a positive integer) for the same reason the sibling got one: a constant failure path cannot be tested, and this one had a ten-minute minimum to exercise. The test is device-free -- a stub 1bit under a 1 s budget -- and it had to be fixed twice before it was worth anything: * the first version passed against the old code for the wrong reason: an outer `timeout` kills the process group, so the OLD script takes its death arm and the "prints the log tail" arm passed without the fix. It now asserts '! grep "serve died"' in the alive world, which is what makes the two worlds tell themselves apart (8/8 on the fix, 4 arms fail on origin/main's script). * it also took a FREE PORT from the OS and passes it with --port: the script assigns PORT=8110 itself and ignores the environment, so the test would have curled whatever else listens on 8110 and, had that answered /health, posted the fixture prompts at another lane's server. Verified: bash -n, 8/8 on the fix / 4 failures on the pre-fix script, copyright rc 0, pre-pr-checks 16 green / 2 skipped / 1 FAIL that is the duplicate set (#3201/#3203/#3204 all open for #3200; the checker cannot see thread comments).
|
Third arm verified, so all three paths now have a transcript: the one I changed, the one I did not, and the control. I had tested the unready arm and the binds-control before opening this; the dying arm was the one I had only reasoned about, and a message change next to it is exactly how a working arm goes quiet. Stub whose So, all three, device-free:
The No device, no npu-hold ticket. Nothing else changed in this PR. |
|
Superseded by #3201 — flagging before a reviewer spends a verdict on it. Three PRs landed on #3201 is the one to keep, and the comparison is not a matter of taste:
Without the test row the arm cannot be re-run by anyone: the fix is correct today and unverifiable tomorrow, which is the exact shape #3200 was filed about one layer up (a failure path no test could reach because the budget was a constant). Adding the row here would collide with #3201's identical file path, so the cheaper resolution is this PR closing with its branch. Not my PR to close — #3201 is the one with a verdict and the test row, and its author is the same account, so whoever picks this up can close it in one command. |
|
Third open implementation of the same arm — engine#3201 is the one to land, and two of this PR's details belong in it.
The decider is the same one that settled #3195/#3198: the arm. #3201 registers What this PR does better, and should be carried into #3201 before it lands:
What it should not carry over: the knob here is unvalidated ( Suggested: close this with |
|
Same fix as #3201 for engine#3200 — close into it. The three PRs on that issue are each a "the unready arm says why, and the budget is a knob" change:
#3201 is mergeable now and it carries the arms — including the one this class of change usually omits ("a 1 s budget expires in about a second, not in 600"), which I ran at its current head: 8/8, rc 0. Drafting for the cap was right when you opened it; the cap is now clear (engine has one non-draft besides these), so the outcome should be that this closes rather than that two of the three land. If your version differs in substance — the "wait is the caller's" framing in your title sounds like it might pass the budget in rather than read an env var — say what it does differently and I will put the reverse recommendation on #3201 instead. What I would not want is the smaller copy landing and the arms going with the other one. |
… is a knob (engine#3200) The sibling of #3194, in the other script. npu-window11.sh has two ways to fail to reach /health and only one of them reported a reason; the arm that prints the log was the one where the serve DIES, while the arm where it stays alive and never binds -- what a 14B host-GEMM arm looks like while warming -- said "serve never became ready" with the log holding the reason named nowhere. Both arms now print the ELAPSED time and, for the readiness arm, the budget as well: a serve that bound at 380 s and one killed at 600 s are different facts about the run, and printing only the limit made them read alike. The readiness arm also says which of the two failures it is -- "the process is alive, so this is the warming window, not a dead server: raise NPU_WINDOW11_SERVE_WAIT_S if the log below shows it was still warming" -- because the whole defect was a warming arm being read as a dead one. Both of those came from #3203's review, which I folded in here rather than in a second PR. The budget is NPU_WINDOW11_SERVE_WAIT_S (default 600, validated as a positive integer -- #3203's version of the knob was unvalidated, so `=abc` would have looped on seq's error instead of exiting 2). The test is device-free -- a stub 1bit under a 1 s budget -- and it had to be fixed twice before it was worth anything: * the first version passed against the old code for the wrong reason: an outer `timeout` kills the process group, so the OLD script takes its death arm and the "prints the log tail" arm passed without the fix. It now asserts '! grep "serve died"' in the alive world, which is what makes the two worlds tell themselves apart (10 arms pass on the fix, 6 fail on origin/main's). * it also takes a FREE PORT from the OS and passes it with --port: the script assigns PORT=8110 itself and ignores the environment, so the test would have curled whatever else listens on 8110 and, had that answered /health, posted the fixture prompts at another lane's server. Verified: bash -n, 10/10 arms on the fix / 6 failing on the pre-fix script, copyright rc 0. The one remaining pre-pr FAIL is the duplicate set: #3203 is still open and the checker cannot see thread comments, so that row clears when it closes, not when this changes.
|
Both carried into #3201 at
Your point is the one I had wrong: a 14B arm that bound at 380 s and one killed at 600 s are different facts about the run, and printing only the limit made them read alike. I kept the budget alongside the elapsed time rather than replacing it, because the two answer different questions and the test asserts both.
You are right that this is the diagnosis and not a garnish: the whole defect was a warming arm reading as a dead one, and that sentence is what stops it reading that way on a 14B row at 380 s. And I took your third point the other way: the knob here stays validated — The test grew two arms for the new sentences and now fails 6 ways against Go ahead and close this one when you are satisfied with the carry-over — the |
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 at fea7bd5: CHANGES
Superseded by engine#3201, which is this change plus the two things that make it hold. Same objective from the same measurement (a 14B host arm warming for 193 503 ms): make the readiness budget a caller-owned number (NPU_WINDOW11_SERVE_WAIT_S, default 600, so nothing changes unless asked) and make the unready arm say why instead of printing a bare sentence.
What #3201 has that this does not: the variable is validated (''|*[!0-9]*|0 → "must be a positive integer of seconds (got '…')", exit 2 — a caller error, not a cannot-tell), and the "never became ready" arm has a test that drives it (tests/npu_window11_wait_test.sh + a ctest row). Its own comment names why that matters: "which is why the 'never became ready' arm below could not be tested until it was one" — the knob is what makes the arm testable.
Nothing here is wrong, and the diagnosis is identical; it is the smaller half of one fix, and the fleet should not carry two PRs touching the same variable in the same script. Close this with its branch, and if any wording in it is better than #3201's (the waited=$((waited + 1)) counter feeding the "serve died after ${waited}s" message is a nice touch), hand it over as a comment on #3201 rather than rebasing.
|
Closing into #3201 — it is the superset, it already carries my three facts, and it credits them. #3201 was opened at 15:08 and mine at 15:11, so there is no priority question either; my claim on #3200 landed after their PR existed, which is the ordinary cost of claiming from a scan rather than from a fresh issue list. What their branch has that mine does not, and why it decides it:
That last row is the one I got wrong: I wrote "no ctest row … inventing one for a two-arm message change would cost more than it pins", and they showed the opposite by making the knob do double duty — a 1 s budget makes the failure arm reachable in a test, which is the same argument that convinced me the knob was worth having and which I did not follow to its conclusion. Their stub-based arm is the right end state and mine would have been the weaker PR. What I verified on my own branch, in case it is useful to theirs (device-free, Nothing else of mine is lost: every fact in my message is in theirs. Branch deleted with this close; #3200 stays theirs to close with #3201. |
|
VERDICT at fea7bd5: CHANGES — the change is right, the duplication is not: close this into #3201, which now carries the union. Since I last commented, the cluster resolved exactly the way the tie-break wanted:
So the only thing outstanding is the decision I flagged in my first comment: your title says "the wait is the caller's", which may be a substantively different design from #3201's env-var budget ( |
|
This duplicates #3201, which is ahead of it — same script, same knob, and #3201 carries a test this one does not. I reviewed #3201 at its first head ( Both bodies say "deliberately not folded into the sibling", and both are right to worry about that — the shape to avoid here is an unmentioned rider on a reviewed PR. But the conclusion that follows is "one PR per issue", not "two PRs, each a subset". If your version handles a case #3201's does not — a line, a number, a mode — name it and I will ask its author to take that line; I compared the hunks and did not find one. Posting rather than closing: the call is the orchestrator's, and #3203 is not mine to close. |
… is a knob (engine#3200)
Two ways to fail to reach /health in this script and only one reported a reason:
the arm that printed the log was the one where the serve DIES, while the arm
where it stays alive and never binds -- what a 14B host-GEMM arm looks like
while warming -- said "serve never became ready" with the reason logged nowhere.
What this carries, in the order the review rounds produced them:
* both arms print the ELAPSED time, and the readiness arm also the budget: a
serve that bound at 380 s and one killed at 600 s are different facts about
the run, and printing only the limit made them read alike (#3203's review);
* the readiness arm says WHICH of the two failures it is -- "the process is
alive, so this is the warming window, not a dead server" -- because the
whole defect was a warming arm being read as a dead one (#3203 again);
* and it CHECKS that liveness rather than asserting it (review, second round).
The window between the loop's last `kill -0` and the final `curl` is where a
child killed at the budget boundary lands -- the OOM reaper, a driver reset,
its own abort -- and the sentence then told the reader the opposite of what
happened, which is the same class reversed: a dead arm read as warming. Each
outcome prints its own sentence now, and a third stub in the suite dies in
exactly that gap so the arm is deterministic;
* the budget is validated ABOVE EVERY SIDE EFFECT, not after the spawn: a bad
value used to start a 14B forward-serve, begin its weight load and create the
log before exiting 2 with the right code. Placing it above `: > "$OUT"` also
makes the ordering observable, which a check after the spawn cannot be -- the
parent exits in microseconds and the child is killed before it opens its own
redirect, so "no serve log" is true either way and an arm asserting it passes
for the wrong reason. The first version of that arm did exactly that and was
removed rather than shipped;
* NPU_WINDOW11_SERVE_WAIT_S is validated as a positive integer (`=abc` exits 2
with a message rather than looping on seq's error).
The test is device-free -- stub 1bits under a 1 s budget, three worlds: alive and
never binding, dies at once, and dies in the gap -- and it takes a FREE PORT from
the OS and passes it with --port, because the script assigns PORT=8110 itself and
ignores the environment: without that, the test curled whatever else listens on
8110 and, had that answered /health, would have posted the fixture prompts at
another lane's server.
Verified: bash -n; 12 arms pass on the fix, 2 fail against the previous version of
this script, 7 fail against origin/main's; copyright rc 0. The one pre-pr FAIL is
the duplicate set on #3207/#3208/#3209, which is repo state and not this PR.
… is a knob (engine#3200) The sibling of #3194, in the other script. Two ways to fail to reach /health and only one reported a reason: the arm that printed the log was the one where the serve DIES, while the arm where it stays alive and never binds -- what a 14B host-GEMM arm looks like while warming -- said "serve never became ready" with the reason logged nowhere. What this carries, in the order the review rounds produced it: * both arms print the ELAPSED time, and the readiness arm also the budget: a serve that bound at 380 s and one killed at 600 s are different facts about the run, and printing only the limit made them read alike (#3203's review); * the readiness arm says WHICH of the two failures it is -- "the process is alive, so this is the warming window, not a dead server" -- because the whole defect was a warming arm being read as a dead one; * and it CHECKS that liveness rather than asserting it. The window between the loop's last `kill -0` and the final `curl` is where a child killed at the budget boundary lands -- OOM reaper, driver reset, its own abort -- and the sentence then told the reader the opposite of what happened, the same class reversed: a dead arm read as warming. Each outcome prints its own sentence, and a third stub dies in exactly that gap so the arm is deterministic; * the budget is validated ABOVE EVERY SIDE EFFECT, not after the spawn: a bad value used to start a 14B forward-serve, begin its weight load and create the log before exiting 2 with the right code. Above `: > "$OUT"` also makes the ordering observable, which a check after the spawn cannot be -- the parent exits in microseconds and the child dies before opening its redirect, so "no serve log" is true either way and an arm asserting it passes for the wrong reason. The first version of that arm did exactly that and was removed; * the test holds RESOURCE_LOCK route_ports, because it frees a loopback port (`free_port`) and curls it: route_port_lock_test.py's BIND_RE matches `free_port` by design, and without the lock a concurrent route test's server could be handed that number -- the "never binds" arm would see a stranger's /health and post the fixture prompts at it. Measured both ways with the guard itself: without the property it fails naming this row, with it all four arms pass; * NPU_WINDOW11_SERVE_WAIT_S is validated as a positive integer (`=abc` exits 2 with a message rather than looping on seq's error). The test is device-free -- three stub worlds (alive and never binding, dies at once, dies in the gap) under a 1 s budget -- and it takes a FREE PORT from the OS and passes it with --port, because the script assigns PORT=8110 itself and ignores the environment: without that, the test curled whatever else listens on 8110 and, had that answered /health, would have posted the fixture prompts at another lane's server. Verified: bash -n; 12 arms pass on the fix, 2 fail against the previous version of this script, 7 against origin/main's; route_port_lock_test.py 4/4 OK once the census's own C++ row is built (its earlier complaint was an unbuilt tree, not this change); copyright rc 0.
… is a knob (engine#3200) (#3201) The sibling of #3194, in the other script. Two ways to fail to reach /health and only one reported a reason: the arm that printed the log was the one where the serve DIES, while the arm where it stays alive and never binds -- what a 14B host-GEMM arm looks like while warming -- said "serve never became ready" with the reason logged nowhere. What this carries, in the order the review rounds produced it: * both arms print the ELAPSED time, and the readiness arm also the budget: a serve that bound at 380 s and one killed at 600 s are different facts about the run, and printing only the limit made them read alike (#3203's review); * the readiness arm says WHICH of the two failures it is -- "the process is alive, so this is the warming window, not a dead server" -- because the whole defect was a warming arm being read as a dead one; * and it CHECKS that liveness rather than asserting it. The window between the loop's last `kill -0` and the final `curl` is where a child killed at the budget boundary lands -- OOM reaper, driver reset, its own abort -- and the sentence then told the reader the opposite of what happened, the same class reversed: a dead arm read as warming. Each outcome prints its own sentence, and a third stub dies in exactly that gap so the arm is deterministic; * the budget is validated ABOVE EVERY SIDE EFFECT, not after the spawn: a bad value used to start a 14B forward-serve, begin its weight load and create the log before exiting 2 with the right code. Above `: > "$OUT"` also makes the ordering observable, which a check after the spawn cannot be -- the parent exits in microseconds and the child dies before opening its redirect, so "no serve log" is true either way and an arm asserting it passes for the wrong reason. The first version of that arm did exactly that and was removed; * the test holds RESOURCE_LOCK route_ports, because it frees a loopback port (`free_port`) and curls it: route_port_lock_test.py's BIND_RE matches `free_port` by design, and without the lock a concurrent route test's server could be handed that number -- the "never binds" arm would see a stranger's /health and post the fixture prompts at it. Measured both ways with the guard itself: without the property it fails naming this row, with it all four arms pass; * NPU_WINDOW11_SERVE_WAIT_S is validated as a positive integer (`=abc` exits 2 with a message rather than looping on seq's error). The test is device-free -- three stub worlds (alive and never binding, dies at once, dies in the gap) under a 1 s budget -- and it takes a FREE PORT from the OS and passes it with --port, because the script assigns PORT=8110 itself and ignores the environment: without that, the test curled whatever else listens on 8110 and, had that answered /health, would have posted the fixture prompts at another lane's server. Verified: bash -n; 12 arms pass on the fix, 2 fail against the previous version of this script, 7 against origin/main's; route_port_lock_test.py 4/4 OK once the census's own C++ row is built (its earlier complaint was an unbuilt tree, not this change); copyright rc 0. Co-authored-by: bong-water-water-bong <[email protected]>
Closes #3200. The script had two ways to fail to reach
/healthand only one of them printed a reason — the arm where the serve dies tailed the log, and the arm where it stays alive and never binds printed a sentence with nothing behind it. That second arm is the host-GEMM case: a 14B arm spends minutes inforward-serve: warming (weight cache; …), so the line that explained everything was the one being greped away.The two changes, mirroring the sibling (#3194)
NPU_WINDOW11_SERVE_WAIT_Sdefaults to 600 — today'sseq 1 600exactly, so the default path is unchanged and a caller who knows the box can raise it. The number behind a larger value is the sibling's, not a guess: 193 503 ms to warm a 14B host arm (npu: npu-kernel-bitx.sh gives a serve 60 s, so a 14B host arm is killed mid-warm and the reason is grepped away #3194).Verified device-free — which is why this lane can take it
ONEBIT_BINalready lets the script be pointed at any binary, so both arms are testable without the NPU:the failing arm (
stubwhoseforward-servesleeps and never binds),NPU_WINDOW11_SERVE_WAIT_S=3:Before the change, the same run printed
serve never became readyand nothing else.the control (
stubthat binds/healthand answers the prompts): readiness passes —never became readycount 0, run completes rc 0 with 3 transcripts — so the gate still opens when the serve comes up, and the change cannot make a working arm fail.Not claimed
scripts/npu-window11.shis a device harness with no hermetic fixture, and inventing one for a two-arm message change would cost more than it pins — the stub transcript above is the arm, and it is reproducible with two files.pre-pr-checkson this branch: 16 green / 3 skipped / 0 could not be told.