Repository navigation
app, serve: one round of any draft's windows verified together; Qwen3.8's lookup windows ride one pass, and whether a load verifies several slots' windows is the body's fact, not the draft's name - #1085
Conversation
….8's lookup windows ride one pass, and whether a load verifies several slots' windows is the body's fact, not the draft's name Session::verify_rounds owns a round of several slots' windows (passes cut at the body's SlotRows bounds, each row's id taken, the kept rows committed); the MTP round and the lookup round both call it, and the seats' round driver (rounds::pass_windows) runs any draft that implements RoundDrafts. bind::verifies_slots decides from the body whether a load verifies several slots' windows in one pass, and Pass::of_body is the one rule the Qwen3.8, qwen3, V4.1 and GLM opens read. 2026-11-01: gate_qwen38_serve's lookup cost clause checks the new shape. lookup_cost_slots_verify_together replaces lookup_cost_slots_take_turns, and lookup_cost_erase_prints_both_slots replaces lookup_cost_warm_up_ends_on_both_slots: under one pass a round, the round's chooser (runtime::width::Batch) reads the wall and a slot's own chooser only counts its rows, so the per-slot cost cells that clause read stay empty.
There was a problem hiding this comment.
Verdict: CLEAN: The changed paths have no proven behavior or quality defect that requires changes.
Non-blocking
⚠ Cover batch-cost observation wiring: crates/gpu-gates/src/bin/gate_qwen38_serve.rs:6305
Removing drafts.observe(...) leaves the new batching and erase assertions green while the batch chooser stays in warm-up. Add a deterministic integration check with forced proposals that detects missing observations. This protects the connection that the runtime's isolated chooser tests cannot cover.
⚠ Supply evidence for lookup batching: crates/gpu-gates/src/bin/shared/serve_seats/qwen38.rs:3595
At two busy slots, two target passes become one pass with up to four rows [derived]. This changes launch count and row geometry. The supplied A/B covers MTP and draft-off arms. Add the lookup A/B required for geometry changes and the identical PTX comparison for the shared-code move.
Optimization headroom
- G. Per-launch and per-sync fixed cost: crates/gpu-gates/src/bin/shared/serve_seats/rounds.rs:511 Pass the existing
doneslice toobserveand map its counts inside the implementations. This removes one allocation and 8 bytes per participating slot per cost-mode round [derived, 64-bit host].
Checked
Duplicates: 42 added declarations/signatures checked, including moved items; no duplicate knowledge found. Dryer reported zero pairs; gpu-gates was searched manually.
Complexity: lookup_cost_rounds (24) is a renamed gate with record filters and error checks. ds41::run (59→62) and qwen38::run (151→154) add exhaustive draft-selection arms; harmless growth.
Silent failure: five missing-slot defaults/skips followed; width validation rejects missing drafts before those consumers. No-proposal lookup windows intentionally verify one row.
Tests: static mutation checks only. Dropping SETTLES_PARTIAL_KEEP makes the Qwen3.6 assertion fail; changing >1 to >=1 makes the Qwen3.8 assertion fail. Restoring serial lookup rounds fails the batching clause; dropping round tallies fails the erase clause. Missing observation coverage is noted above.
Gates: two replaced clauses carry PIN(2026-11-01) and a reason; no tolerance moved.
Adversarial paths: context exhaustion is blocked by Gen::pump; partial keeps are checked before execution; slot positions and sampled histories remain separate across reordered passes.
Escape catalog: no C1–C4 pattern matched.
Notes
Static review only; builds and GPU gates were not run here. Dryer excluded gpu-gates as documented. The PR omits nvidia-smi output and cites A/B commits different from this review's base/head. GPU evidence is false under the required evidence format.
Card check: needs-gpu. This pull request changes crates/app/src/lib.rs, crates/app/src/mtp.rs, crates/gpu-gates/src/bin/gate_qwen38_serve.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 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. |
여러 슬롯의 draft window를 한 round로 함께 verify하는 일을 공용 owner 하나로 모았고, Qwen3.8 lookup
--parallel 2의 round가 슬롯마다 pass 하나에서 round마다 pass 하나로 바뀝니다.What and why
Verifying several slots' drafted windows in one round lived inside the MTP code, and each serve seat decided the round's shape with its own expression (Qwen3.8 by whether MTP is on, GLM by
slots_a_pass, qwen3 and DeepSeek V4.1 by draft name). This PR addsapp::Session::verify_rounds, which cuts a round into passes at the body'sSlotRowsbounds, verifies each pass, picks each row's id and commits the kept rows. The MTP round and the lookup round both call it. On the seat side,serve_seats::rounds::pass_windowsruns a round for any draft that implements the newRoundDraftstrait.Whether a load verifies several slots' windows in one pass is now decided from the body (
bind::verifies_slots, read throughPass::of_body), and the Qwen3.8, qwen3, DeepSeek V4.1 and GLM seats read that one decision. As a result, Qwen3.8's lookup draft under--parallel 2verifies both slots' windows in one pass per round instead of one pass per slot. Qwen3.6 and DeepSeek V4.1 lookup loads keep taking turns, because their bodies do not settle a partial keep.docs/serving.mdstates both.The PR makes no speed claim. The greedy output is equal between base and head on every arm below.
Release notes: Under the hood: one shared owner verifies several slots' drafted windows in a round, and Qwen3.8 lookup with two slots runs each round as one pass.
Code shape
app::mtp::pass_slotsmoved toSession::verify_rounds, and the per-seat round expressions now readbind::verifies_slots. The twoRoundDrafts::chooseimpls (MTP and lookup) both callruntime::width::Batch::choose, and the twoobserveimpls callBatch::observe.verify_rounds,verifies_slots,pass_windows) gained no per-model branch. A body statesSETTLES_PARTIAL_KEEPand itsSlotRowsbounds; seats read them.round_mut, the unusedwidthsbuffer, the per-seat draft-name expressions and the lookup cost clauses that checked the removed take-turns behavior are deleted.verify_roundsrefuses a round of windows that does not fit a pass by name.gate_qwen38_serve.rscarry aPIN(2026-11-01)line with the reason, andtools/defaults-twins.tsvfollows the renamed clause.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": the verify, pick and commit loop incrates/app/src/mtp.rsmoved intocrates/app/src/lib.rs(Session::verify_rounds), and the old lines are deleted. The twoRoundDraftsimpls incrates/gpu-gates/src/bin/shared/serve_seats/drafted.rs:1218to:1375are kept separate because each reads its own table (MTPSpecagainstLookupWindow), and the width choice and observation sit in one owner.What I ran
Cards: NVIDIA GB10 (driver 595.84, CUDA 13.3) for the gates and the A/B, and NVIDIA GeForce RTX 5090 (driver 595.99.02) for the qwen3 serve gate. The A/B compares base
28bc0af4b868adef1e0a29ec9cdaab7d1a316a64with head852aee2b44996e4a73e38dd61e5bab4e7629b514.Gates on the cards:
gate-gpu-qwen4exp-mtp:gate_qwen4exp_mtp ran 345 s (exit 0).gate-gpu-glm5next-mtp:gate_glm5next_mtp ran 23 s (exit 0).gate-gpu-qwen38-serveon the Qwen3.8 lookup arm,--parallel 2, real tier (Qwen3.8-Flash-Next UD-Q4_K_XL). The head printslookup cost: 56 of 56 rounds both slots' windows in one pass, 0 in twoandcheck lookup_cost_slots_verify_together: PASS,check lookup_cost_erase_prints_both_slots: PASS,check lookup_cost_0_ids_are_draft_off: PASS,check lookup_cost_1_ids_are_draft_off: PASS.gate_qwen38_serve.rslookup clause run against the code without this PR:lookup cost: 0 of 38 rounds both slots' windows in one pass, 38 in two,check lookup_cost_slots_verify_together: FAIL. The arm'slookup_logprobs_step_without_a_draftcheck also fails there and with this change; this PR does not touch it.gate-gpu-qwen3-serveon the RTX 5090 with Qwen3.8-27B Q4_K_M, without--images:gate_qwen3_serve ran 87 s (exit 0), 59 checks PASS.gate-serve-draft-rules:serve_seats::qwen38::tests::drafted_rounds_are_one_pass_by_what_body38_verifies ... ok,serve_seats::qwen3::tests::a_drafted_qwen36_round_takes_turns_by_what_its_body_keeps ... ok, and everytest resultline shows0 failed.Speed, base against head, on the GB10 with Qwen3.8 FP4-Local at TP=1, three rounds per side,
fp4l-offandfp4l-mtpat C=1 andfp4l-mtp-c2sat C=2. The greedy output is equal between base and head (24 requests, 3,072 tokens, no first difference). Decode tok/s, medians:The single-slot arms do not run the new round code: with one slot
Pass::of_bodyreturnsOnelikePass::of, sopass_slots,verify_roundsandpass_windowsdo not run.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.