Repository navigation
gates, placement: --parallel auto counts the slots in one shared fit on every seat of resident slots - #1123
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: MiniMax auto sizing can choose slots that its final streaming plan cannot hold.
Must fix
1. Include default stream staging in the slot probe
crates/gpu-gates/src/bin/shared/serve_seats/tiered.rs:702 checks the staged plan only when BLOOMERY_XSTREAM is set. MiniMax also streams with that lever unset on --place a.
With --parallel auto --slot-ctx S, a non-off residency and host room that holds the plain N-slot plan but not its staging, auto selects N. Final planning tries both ring and ringless plans on the staged machine; both refuse, and crates/gpu-gates/src/bin/shared/serve_seats/tiered.rs:733 returns the refusal. A smaller fixed count can hold.
Reuse the existing selection owners now, before more seats depend on this probe.
Replace the Some(auto) arm with:
Some(auto) => auto.count::<PlaceError, _>(
false,
|set| {
let one = (&machine, &plan_levers, NonZeroUsize::MIN, place);
let chosen = plan_at(&split, (set, 1), &inputs, one)?;
Ok((usize::try_from(chosen.slot_ctx)?, chosen.rule, ()))
},
|(), n, ctx| {
let n = NonZeroUsize::new(n)
.ok_or("--parallel 0: the server serves no slot")?;
let ctx = u64::try_from(ctx)?;
let plain = inputs.plan_with_slots(&machine, ctx, &plan_levers, n)?;
let (Some(r), Some(staged)) = (&ring_inputs, &staged) else {
return Ok(true);
};
let attempt = ringed(
set,
workstation::plan_streams(&plain),
|| Ok(r.plan_with_slots(staged, ctx, &plan_levers, n)?),
|| Ok(inputs.plan_with_slots(staged, ctx, &plan_levers, n)?),
);
picked(
attempt,
set,
plain,
|p| S::residency(&levers, &flags, place, p),
|pick| pick.word == "off",
)
.map(|_| true)
},
)?,Add a fixed-context case where plain N holds, staged N refuses and a smaller staged count holds. Restoring if set must fail that assertion.
Checked
Duplicates: 12 new or renamed items checked, including one test; no duplicate owner found. Dryer reported zero pairs in placement; gpu-gates was excluded and searched manually.
Complexity: crapper flagged new qwen3::auto_slots (16, architecture/probe dispatch), and startup auto branches in tiered::run (57→73), ds41::run (62→71), glm::run (61→64), qwen3::run (85→87).
Silent failure: three fallback/error-discard sites followed through their final context/load checks.
Tests: reviewed mutations, not executed. bind.rs:289 multiplying by 1 fails the new count assertion; dropping auto at :370 fails slot_flags_ask_rows; accepting auto at :610 fails its refusal assertion. Refusing auto during seat parsing fails the changed startup test. Flipping ctx_ask.rs:48 fails the changed bisection test. None covers default stream staging.
Gates: no bands, tolerances or lint levels moved; old auto-refusal expectations became acceptance and one-sequence refusal checks.
Escape catalog: no C1–C4 patterns matched.
Performance: startup planning only; no per-token work added.
Notes
Static review. Builds and GPU gates were not run locally. The GPU runs in the PR body name earlier commit hashes.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/shared/ds41_place.rs, crates/gpu-gates/src/bin/shared/glm5next_place.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)
721cfde to
1b32067
Compare
There was a problem hiding this comment.
Since the last review: must-fix 1 is fixed at crates/gpu-gates/src/bin/shared/serve_seats/tiered.rs:725. Auto sizing and final planning now share the staging selector.
Verdict: MUST_FIX: Auto sizing publishes residency records for plans the server does not load.
Must fix
1. Emit the load's residency only after slot selection
crates/gpu-gates/src/bin/shared/serve_seats/tiered.rs:729 calls S::residency for each staged sizing probe. Its common resolver prints RESIDENCY_LEVER at line 395, before final selection prints another.
On MiniMax with --place a --parallel auto --slot-ctx C, unset residency and stream levers, host experts and enough host headroom for the churn pool, a one-slot plan with at least two card experts per layer resolves to mid-p0-s1; a larger fitting count that leaves one in a card layer resolves to off. This follows the plan rule at crates/levers/src/lib.rs:2082. The log's first record describes the discarded one-slot plan, while the selected load has no churn-pool record. First-record readers, including crates/gpu-gates/src/serve_client.rs:589, select that stale record; its check at line 605 rejects such a log.
Move reporting now, while the selector has two callers; later probes otherwise inherit this output defect.
Replace residency_pick with:
pub fn residency_pick(
levers: &Levers,
place: Place,
plan: &Plan<'_>,
prefill_steps: bool,
carry: UnhostedPool,
) -> Result<ResidencyPick, GateError> {
let pick = levers.residency_at(ResidencyAt {
serving_place: place != Place::Gate,
check_finite: false,
route_trace: false,
prefill_steps,
});
check_residency_feed(levers, prefill_steps, carry)?;
residency::at_plan(carry, plan, 0, pick)
}Immediately after the final streamed(...)? at line 767, insert:
if let Some(pick) = pick {
record::require(record::groups::tiered::LEVER, "tiered::run");
record::residency_lever(pick).eprint();
if let Some(detail) = pick.why.detail() {
eprintln!("{detail}");
}
}Update the resolver and trait comments to place reporting in run. Add an auto-sizing assertion that exactly one residency record describes the selected load; the current mock pick emits no records and misses this defect.
Checked
Duplicates: 2 new definitions checked; no duplicate owner. Dryer found zero placement pairs; gpu-gates was excluded and searched manually.
Complexity: tiered::run 57→68 adds startup sizing branches and extracts selection. The other flagged functions (qwen3::auto_slots 16, ds41::run 62→71, glm::run 61→64, qwen3::run 85→87) are unchanged since the prior review.
Silent failure: 3 paths followed: absent staging accepts the plain plan, successful selection accepts its plan, memory refusals lower the count; other errors propagate.
Tests: static mutation check. Making staging conditional on set at tiered.rs:549 changes the new test's expected six slots to eight and fails its assertion at :905. Record emission is not asserted.
Gates: no bands, tolerances, lint levels or existing tests changed in the interdiff.
Escape catalog: no C1–C4 patterns matched.
Performance: startup planning only; no per-token work changed.
Notes
Static re-review; no local builds or GPU runs. The PR reports the new selector tests in an extracted crate because the server binary did not link on that machine.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/shared/ds41_place.rs, crates/gpu-gates/src/bin/shared/glm5next_place.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)
…on every seat of resident slots AutoSlots::count takes a seat's one-slot ask and its plan of n slots and returns the most slots, up to ctx_ask::AUTO_MOST, whose plan holds one request's context, with the --ctx-size total it asks. The qwen38 count moves onto it, and the ds41, glm, qwen3 and tiered (mimo2, minimaxm3, flint) seats now take --parallel auto and count through it once their placement and draft are chosen at one slot. A load that serves one sequence (a route trace, the DSpark draft, the qwen3 in-file MTP draft, a mimo2 tier card) serves one slot, and a seat of one sequence refuses auto by name.
1b32067 to
f06b7b6
Compare
There was a problem hiding this comment.
Since the last review: must-fix 1 is fixed at crates/gpu-gates/src/bin/shared/serve_seats/tiered.rs:762. Probes resolve residency without printing. The selected load emits its record before the plan.
Verdict: CLEAN: The interdiff fixes the prior residency-record defect and introduces no proven defect.
Checked
Duplicates: 2 new definitions checked; no duplicate owner. Dryer found zero placement pairs; gpu-gates was searched manually.
Complexity: tiered::run 57→70 adds startup selection and reporting; this interdiff adds two reporting branches. The other flagged functions, qwen3::auto_slots (16), ds41::run (71), glm::run (64), and qwen3::run (87), are unchanged in the interdiff.
Silent failure: 2 paths followed. Resolver errors propagate. An absent pick emits no residency record and settles to Off explicitly.
Tests: static mutation check of residency_pick at tiered.rs:393. Restoring its record emission adds probe records and fails the new assertion at :1017. The PR reports FAIL-first with seven records instead of one.
Gates: no bands, tolerances, lint levels, existing tests or cases removed or relaxed.
Escape catalog: no C1–C4 patterns matched.
Adversarial checks: discarded probe picks cannot reach the record reader; resolver failures stop selection; the final pick still reaches settlement. The test stores captured lines per thread.
Performance: startup planning and reporting only; no per-token work changed.
Notes
Static re-review; no local builds or GPU runs. The PR reports the selector tests in an extracted crate because the server binary did not link on that machine. Dryer excluded gpu-gates from its scan.
Card check: gpu-evidence. This pull request changes crates/gpu-gates/src/bin/bloomery_serve.rs, crates/gpu-gates/src/bin/shared/ds41_place.rs, crates/gpu-gates/src/bin/shared/glm5next_place.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. |
--parallel auto를 Qwen3.8 전용 코드에서 공용 owner로 옮겨 슬롯을 가진 모든 seat가 쓰게 했고, 슬롯이 하나뿐인 seat는 이름을 대며 거절합니다.What and why
--parallel autopicked the slot count from memory on the Qwen3.8 seat only. Every other seat refused it, so the count, its bisection bound and its refusal rules lived inqwen38.rs(auto38). This PR moves them into one owner,bind::AutoSlots::count, which a seat calls with two closures: its one-slot ask and its plan ofnslots. DeepSeek V4.1, GLM-5.3-Flash, the Qwen3 seat (Qwen3, Qwen3.5/3.6, dense Qwen3.8) and the tiered seats (MiMo-V2.6, MiniMax-M3.1, Flint) now take--parallel auto; Solar-Open2, Nemotron, Raon-1 and Muse Spark hold one sequence and refuse it by name, as they refuse--parallel 2. A new seat of resident slots writes its two closures and no count logic.AutoSlots::countreturns the largestn(up to 8) whose plan holds one request's context at--slot-ctx, or at the one-slot default. A default fitted under the model limit, a one-slot ask short at its floor, or a drafted default that holds no context serves one slot. A--slot-ctxone slot cannot hold is refused by name. The total is checked againstusize.parallel auto slots=1: <why>and serves one slot instead of refusing.--parallel Nmakes holds, whole or placed, and the served draft must run on that load (BLOOMERY_DRAFT=lookupneeds a whole-card load, so the count stops before a placed one).streamed, so the count includes the host staging a default stream makes (the ring, or the plan without it) and--parallel autoequals the fixed count that start would plan. A set stream needs its ring, and residency off needs no staging. Theresidency leverrecord is printed once, for the selected load, not for each count candidate.nslots are split out ofserve_ctxandctx_choiceand reached throughctx_ask::probe_of.ctx_ask::most_slotstakes aboolclosure; its bisection is unchanged.Docs:
docs/serving.md(seat table, "Concurrent requests"),README.mdand each seat's usage string ([--parallel N|auto]).Release notes: Changed:
--parallel autocounts the slots on every seat that serves several slots, not only Qwen3.8; seats of one sequence refuse it by name.Code shape
--slot-ctxrules, the short-refusal reading and the total live inbind::AutoSlots::count; every seat hands in its own closures. The GLM and V4.1 probes sharectx_ask::probe_of, the tiered count and plan sharestreamed, and the Qwen3 draft rule is one function,serves_on, which the startup guard and the count both call.nslots.bindgained no per-model branch.HostShort,q38place::probe), the auto-onlycheck_mtp_ctxand itsa.ctxcopy, and the by-name refusals of--parallel autoare removed.--slot-ctxno slot holds, a one-sequence seat asked forauto, and a count the load cannot place are named errors.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": Qwen3.8's own count and refusal mapping incrates/gpu-gates/src/bin/shared/serve_seats/qwen38.rs(removed in favour ofAutoSlots::count); the GLM and V4.1 probe bodies inglm5next_place.rsandds41_place.rs(nowctx_ask::probe_of).What I ran
Upstream base
d76d5fbe38459a295aa4093aac5a094258ee7388, PR headf06b7b655ed0111196093a61d4a4200e58a688d8. The commands in the two card sections ran on a DGX Spark (GB10) or an RTX 5090 machine.$Sis./target/release/bloomery-serve, built withF=glm5next,clef,vision,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf,checkpointandcargo oxide build --arch "$(bash tools/arch.sh)" -- -p bloomery-gpu-gates --features "$F" --release --bin bloomery-serve.--planloads nothing; it prints the lines a start would use. "Fixed count" below means the same command with--parallel Nat the same--slot-ctx(it plans) and--parallel N+1(it is refused withno-fit, rc 80), unless N is 8, the most.DGX Spark (GB10,
sm_121a)Model:
nvidia/Qwen3.8-Flash-Next-FP4-Local, revisionb9ce18a6887e18c089fdea8509a33e63429a3300(checksums below).Unit tests and FAIL-first:
With the count's total left at one slot's context (
s.checked_mul(n)changed tos.checked_mul(1)), and with--parallel autorefused at the parse as before, each test stops with a panic:Gate and real binary:
The first
--planline has the MTP draft on (3 slots); withBLOOMERY_DRAFT=offit isslots=4 total=1048576. At--slot-ctx 16384auto is 8 with the draft on or off, and--parallel 8holds with it off. The served start answered two concurrent/completionrequests on slots 0 and 1, and/propsreports the same 8 slots as theparallelline.RTX 5090 machine (
sm_120a)Models:
Qwen3.6-35B-A3B-Q4_K_M.gguf4ac6a06bce551257267f49ad2226f8671a22519ccc1a4dde9d5b433d1f2a410dQwen3-30B-A3B-Instruct-2507-Q4_K_M.gguf6c997b8af17debdfb01d890214400ccbab00db6acc0ba8da5de1cc906c4774d0Qwen3.8-27B-Q4_K_M.ggufQwen3.6-35B-A3B-UD-Q4_K_M.ggufThe Qwen3 seat gate on
$Q3(Qwen3-30B-A3B),$Q36(Qwen3.6-35B-A3B) and$Q38D(Qwen3.8-27B), then--planon the seat's files, each--parallel autocount against the fixed count (the table rows come from the same--plancommand at each--slot-ctx):--slot-ctx)--parallel auto)slots=5 slot_ctx=262144--parallel 8holds--parallel 8holdsslots=1 slot_ctx=262144--parallel 8holds--parallel 4holds,--parallel 5refused (rc 80)parallel auto slots=1: the default context is fitted below the model limit (ctx=225280)--parallel 8holds--parallel 3holds,--parallel 4refused (rc 80)parallel auto slots=1: the in-file MTP draft serves one sequenceBLOOMERY_DRAFT=off--parallel 8holdsServed start, Qwen3.6 Q4_K_M
--parallel auto --slot-ctx 16384:The Qwen3.6 lookup draft (
BLOOMERY_DRAFT=lookup, which needs a whole-card load):With the draft rule removed from the count (
serves_on(Draft::Off, placed)), the same auto command picks 8 slots and exits 1 with the same refusal; the rule restored, auto equals the fixed count (5).GLM-5.3-Flash and DeepSeek V4.1 fixture plans (
--planat each fixture's card budget,BLOOMERY_DRAFT=offfor GLM at--slot-ctx 4096): GLM auto isslots=8 slot_ctx=16384by default and 8 at 4096 (--parallel 8holds); V4.1 auto isslots=1 slot_ctx=1048576by default and 8 at 4096 (--parallel 8holds).Tiered seats (host staging in the count)
cargo fmt --all -- --check cargo test --lib cargo clippy --target x86_64-unknown-linux-gnu -p bloomery-gpu-gates --bin bloomery-serve --features glm5next,clef,mimo2,solar2,minimaxm3,flint,gemma-embedding2,hf --testscargo test --libruns in a small crate built from the selection functions intiered.rsand the new testsauto_slots_hold_default_stream_stagingandauto_slots_report_only_the_selected_residency, because the server binary does not link on this machine.cargo fmtprinted nothing (rc 0) andcargo clippyfinished (rc 0).With the staging check made conditional on a set stream again, the new test stops:
With the residency report moved back into the resolver the count calls for each candidate, the second new test stops:
SHA-256 of the FP4-Local files
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.