Repository navigation
serve: a sampled request drafts beside other busy slots, its window a row of the round's one pass with its sampler and history; Qwen3.8's unset MTP draft drafts on any slot count - #964
Conversation
… row of the round's one pass with its sampler and history; Qwen3.8's unset MTP draft drafts on any slot count
There was a problem hiding this comment.
Verdict: CLEAN: No merge-blocking behavior or quality defect was found.
Non-blocking
⚠ Measure the added greedy-round allocations: crates/gpu-gates/src/bin/shared/serve_seats/rounds.rs:336.
The new draws, given and drawing vectors add three allocations per nonempty drafted round, including all-greedy rounds [derived].
The supplied A/B covers sampled requests. Add a greedy A/B to measure this host cost; retaining round scratch would remove these allocations.
Optimization headroom
- G. Per-launch and per-sync fixed cost: crates/gpu-gates/src/bind.rs:2171, reuse the existing per-request
Gen::lenthistory storage for shared passes. This removes one fresh history allocation per sampled slot per round [derived], as the single-request path already does.
Checked
Duplicates: 32 new definitions checked, including test adapters and the local error tag; no actionable duplicates. Dryer reported zero pairs; GPU code was checked manually.
Complexity: crapper's Link::pass_slots (5→12), app::mtp::pass_slots (22→26), and rounds::pass_rows_one_pass (20→24) gained sampler dispatch and restoration branches; draft_slot_share (41→42) and slots_drafted_sampled (17→18) gained clause checks/calls.
Silent failure: three default/skip sites followed. A missing returned draw leaves a missing sampler and fails; the absent-draw history length is unused; defaulted test error text fails its assertion.
Tests, static mutation analysis: worker.rs:918 Sampled→Step fails concurrent-draft assertions; worker.rs:966 using advance_slots for one row fails the mixed-call test; bind.rs:2170 dropping the draw fails row-output/sampler-state assertions; bind.rs:2200 and engine.rs:687 dropping history checks fails refusal tests; genloop.rs:614 dropping the sampler check fails the named-error test; genloop.rs:404 allowing probability requests to draft fails the new step-record clause; mtp.rs:883 reading another window's row fails alone-id comparisons; restoring draft_for_slots fails the unset-load clause. These mutants were not executed.
Gates: no numeric band changed; dated reasons cover the retired slot restriction and step-only expectations.
Escape catalog: C1–C4 do not match this diff. Context limits, zero-width windows, mixed rounds, and nonzero first row offsets were traced.
Notes
Static review only; no build or hardware gate was run here. The PR lacks the owning just gate-gpu-qwen38-serve and just gate-gpu-glm5next-serve command output and FAIL-first output for the new clauses. Its measured hashes differ from this review's base/head, and the throughput runner commands/output are absent. GPU evidence is false under the requested evidence rule.
Card check: needs-gpu. This pull request changes crates/app/src/lib.rs, crates/app/src/mtp.rs, crates/gpu-gates/src/bin/bloomery_serve_qwen38.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. |
여러 요청이 함께 도는 라운드에서도 sampled 요청이 MTP draft를 계속 쓰도록 하고, Qwen3.8의 기본 draft를 slot 수와 상관없이 켜는 변경입니다.
What and why
Beside another busy slot, a sampled request (or one that bans token ids) did not draft: the worker turned the request's round into a plain step, and an unset MTP draft on Qwen3.8 stayed off under
--parallelabove 1. At two and four concurrent sampled requests the server decoded one token per slot per round.This PR makes a sampled request's window one row of the round's single verify call. The row carries the request's history and sampler, and each kept id is drawn from that row's verified logits with the same rule the single-request path uses (keep up to the first id that differs from the proposal's next id). A request with a given seed therefore takes the same ids alone and beside others. With sampled rows in place, the unset draft no longer needs the slot-count rule, so
draft_for_slotsandDraft38Off::Slotsare removed and the unset draft drafts on any slot count.Release notes: Changed: a Qwen3.8 server with the MTP draft drafts sampled and id-banning requests while other requests run, which raises their decode throughput at two and four concurrent requests on a DGX Spark; an unset draft is no longer turned off by
--parallelabove 1.Code shape
The review reads these first. A box left unticked needs one line of why.
copying it (
AGENTS.md"Common code first",docs/rust-quality.mdR14). Where I found an existing copy, Inamed it below.
(tensor shapes, the attention kind, the quant). A common owner gained no per-model branch, flag or trait method.
tools/check-comments.sh).PIN(YYYY-MM-DD):and its reason.
cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none":crates/app/src/lib.rs:692Session::slots_rowrepeated the NaN check ofrow_logits(:949); both now callSession::read_row(:444).What I ran
Throughput, base and head
One DGX Spark (GB10, sm_121a) in a CUDA 13.3.1 container, model
nvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6887e18c089fdea8509a33e63429a3300. Base is5e743ada8; the head measured is547ef405, this change on that base. Each arm startsbloomery-serve -m <folder> --parallel NwithBLOOMERY_DRAFTunset (N is 2 or 4 and equals the number of concurrent requests), then sends N concurrent sampled requests of a 4096-token prompt and 128 generated ids (temperature 0.7, seed 42 plus the request number), 8 windows with a warm-up first. Each cell is the median of 3 rounds, alternated between base and head. A difference counts only when it exceeds the same-revision repeat spread (never below 0.5%) and the ranges do not overlap.Prefill tok/s and TTFT p95 are inside that spread with overlapping ranges in every arm (for example 2 requests, code, prefill: 2338.8 to 2344.8 tok/s). The 4-request prose cells are inside the spread too, so I read them as no change.
Real binary on the card
bloomery-servebuilt with the shipped features,--parallel 2 --ctx-size 16896,BLOOMERY_DRAFTunset,BLOOMERY_RESIDENCY=off BLOOMERY_STEP_STATS=1 BLOOMERY_HOST_ROOM=96G, on the same model. Two sampled requests of 128 ids each run alone and then together; then one greedy and one sampled request run together.Unit tests on the card machine
cargo checkofgate_glm5next_serve,gate_qwen38_serveandbloomery-servefinished without errors.Hardware (if the change is for a machine)
The change is for the GB10 serve path. Measured on one DGX Spark:
NVIDIA GB10, 595.84(driver 595.84, CUDA 13.3), sm_121a, CUDA 13.3.1 container.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.