Repository navigation
serve: the engine's last call prints each slot's last mtp width record before the tier nodes close - #891
Conversation
…d before the tier nodes close
There was a problem hiding this comment.
Verdict: CLEAN: the stop path prints each slot's last mtp width record on every seat that holds a deferred record, and I found no failure path I could not refute.
Non-blocking
⚠ Only Lookups::close has a unit test: drafted.rs:1352. Mutant: delete l.close() in SlotDrafts::close (drafted.rs:917), or the dspark/lookup arms of ServedDraft::close (served.rs:539). No test in this diff turns red; only the card gates would. This is acceptable for now. Name the card gate that covers each in the PR body.
Checked
- Duplicates: 8 new items checked (
closeonLookups,SlotDrafts,ServedDraft,ServedSpark,Driven,Seatimpls,Served38::wait_exit).print_widthsstays the one owner.wait_exitremoves two copies of the poll loop. No dryer pair (crates/serve: 0 pairs; crates/gpu-gates was not searched by dryer). - Complexity:
width_cost21 → 23. This is the added exit check in a gate clause, even growth. - Silent failure: 4 sites followed.
print_widthsis idempotent:take_tallyempties the tally and an empty tally prints nothing, so a slot closed at its next call does not print again at the stop. An error fromSeat::closestill reaches stderr inworker.rs. The record prints before the node close, so a node failure keeps it. - Coverage of seats: every seat that holds
SlotDrafts,ServedDraftorServedSpark(Q38, GLM, DS41, Q3, Q35Mtp, Raon1) now overridesclose.Hybridholds no draft. Noclose_nodesname is left on theEngineorSeattraits. - Tests: the new unit test protects
Lookups::close. Mutant "drop thefor_each" leavesunprinted(true)at[1, 1]and turns the assert red.width_cost_record_is_the_choosersturns red when the stop prints nothing, since the record is absent. - Gates: one clause replaced (
width_cost_flush_ok→width_cost_stop_ok) and stricter (needs 200 and a clean exit); it has aPIN. A server that does not exit withinPOLLSis killed byServed38::drop. - Hot path: none touched (runs after the engine loop ends, host side only).
- Escape catalog: no pattern matched.
Notes
- The PR body says
just gate-gpu-qwen38-servewas not run, so the changedwidth_costclause has not run in full. The clause is checked by reading only. The DS41, GLM and Raon1 seats were not stopped on hardware. - The evidence runs are on earlier revisions, not on head
d799fb8, as the body states.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/gate_qwen38_serve.rs, crates/gpu-gates/src/bin/shared/serve_seats/drafted.rs, crates/gpu-gates/src/bin/shared/serve_seats/ds41.rs … and carries a gate run on the author's card, which counts as verified.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
서버를 멈출 때 각 slot의 마지막 요청에 대한
mtp width기록이 사라지던 문제를 고칩니다.What and why
The MTP width chooser's
mtp widthrecord is printed at a slot's next prompt call, step, reset or turn-off. When the server stops, none of those happens for a slot's last request, and the engine is left to the process exit without running its Drop, so the record is never printed. Anyone who reads the width chooser's aggregate from a server log loses the last request of every slot.Engine::close_nodes, the server's last call once the engine thread leaves its loop, is nowEngine::close. It prints the records the engine still holds, then ends the load on the tier nodes as before. The record is printed first, so a failure while closing the nodes keeps it. The change reaches every owner of a deferred width record (the MTP and lookup drafts inSlotDrafts, the DSpark and lookup drafts inServedDraft, andServedSpark) and every seat that uses one (Qwen3.8, GLM, both Qwen3 seats, DS4.1 and Raon1).Seat::close_nodesandCmd::CloseNodesincrates/gpu-gates/src/bind.rsare renamed to match.The change runs after the server loop ends, on counts the chooser has already tallied, so decoding is untouched.
The width_cost clause of
gate_qwen38_servenow stops the server withPOST /shutdownand reads the record afterwards, instead of sending a one-id request that made the record print. The clausewidth_cost_flush_okbecomeswidth_cost_stop_ok. The record clausewidth_cost_record_is_the_chooserstherefore depends on the stop path.The
MTP_WIDTHdoc incrates/gpu-gates/src/record.rsand the two checked-in schema files (tools/bloomery/schema/bloomery-serve-qwen38.jsonlandbloomery-serve-ds41.jsonl) carry the same sentence about when the record prints.Release notes: Fixed: The server prints each slot's last
mtp widthrecord when it stops.Code shape
print_widthsstays the one owner of the record; each newclosecalls it.close; no common owner gained a per-model branch or a new trait method (an existing one is renamed).close_nodesnames are gone, andwidth_cost_flush_okis replaced.width_cost_flush_okis replaced bywidth_cost_stop_ok; the replacement carries aPIN(2026-10-28):with its reason.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up. I rancargo clippy -p bloomery-gpu-gates -p bloomery-serve --all-targets -- -D warningson an earlier revision of this change and it was clean. I did not rerun it on the pushed head.Duplication found or removed (
path:line), or "none": none removed. The threeSeat::closeimpls (crates/gpu-gates/src/bin/shared/serve_seats/ds41.rs:1409,glm.rs:1713andqwen38.rs:2883) each act on their own draft field and session.What I ran
The head is
e70c5af3bb76ffa173ab99e5f8850b87638ed2e2on main2f27e83c17b04ba8f0fdf99d8baba396fb9cf0b6. The runs below measured earlier revisions of the same change, and I did not repeat them on the pushed head. The later revisions only rebased onto newer mains, added the gate binary'sServed38::wait_exithelper and changed a comment. The end-to-end run measured3c91724f2069275a6fd278bdb7d9d2f9d4337b4eagainst08047d8b5422432dccb31f9b77f8e00d3892981c. The RTX 5090 gate run is ond615b6e0c473c19e0c76bfd4f8b58054a1eb76cb, which sat on maine009acd4f93e930ae906572acbdcc0c92345d666.FAIL-first on a DGX Spark, base against head: one server per arm, FP4-Local checkpoint,
BLOOMERY_DRAFT=mtpandBLOOMERY_MTP_WIDTH=cost, 16384 context per slot, onen_predict96 greedy request per slot, thenPOST /shutdown. The base prints nomtp widthrecord. The head prints one per slot, all after the stop request:The one-slot arm drafts 74 ids on both sides. The two-slot draft counts differ because the chooser picks widths from measured wall time in concurrent rounds.
On a Linux CPU machine:
On an RTX 5090 machine, with the draft rules and the Q38 serve rules gates, which include the new test
the_stop_prints_every_slots_last_request:I did not run
just gate-gpu-qwen38-serve, so the changedwidth_costclause has not run in full. The DS4.1, GLM and Raon1 seats were not stopped on hardware. They share theServedDraft::closeandSlotDrafts::closeowners that the run above exercised, and they compile in a workspace check with every feature (cargo check --workspace --all-targets) on the RTX 5090 machine, which printed no error. I did not runjust contrib-checkor the repository'stools/check-*.shscripts.Hardware
The end-to-end run used one DGX Spark with the
nvidia-smiquery line below (name, driver, compute capability):The checkpoint is
nvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6887e18c089fdea8509a33e63429a3300. The device path does not change, so there is no PTX or timing comparison.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.