Repository navigation
placement: an unset context takes the largest step under the model's limit that the machine holds - #906
Conversation
There was a problem hiding this comment.
Verdict: MUST_FIX: the host_room_halves_the_default clause no longer pins the largest context, and its change carries no dated PIN.
Must fix
1. mimo2 host-room clause accepts any context from the half up to the default
crates/gpu-gates/src/bin/gate_mimo2_serve.rs:971 The old clause required ctx == below. The new one requires below <= c < ctx_max and need(c) <= between. Mutant: an off-by-one in largest_held that returns one step under the largest context that holds. The line still says rule=fitted, host-short, planned == fitted_to and need(c) <= between hold, so the clause stays green. The gate cannot tell "largest" from "some context that holds". The same happens for the reshaped default_load_is_its_whole_fit clause in gate_qwen3_serve.rs: it now has no dated reason. This is a moved gate without a PIN(YYYY-MM-DD): line.
Cost: a gate that passes on the bug is cheaper to fix now than after the next search change.
Fix: add // PIN(2026-10-28): the default is fitted, not halved; the clause pins the largest context the room holds, not one context. above let fitted_to, and replace the need_fitted and fitted lines with:
let need_fitted = fitted_to
.map(|c| default_plan_need(file, levers, (c, cards)))
.transpose()?;
let need_above = fitted_to
.map(|c| default_plan_need(file, levers, (c + STEP, cards)))
.transpose()?;
let fitted = status.is_some_and(|s| s.success())
&& fitted_to.is_some()
&& planned == fitted_to
&& need_fitted.is_some_and(|n| n <= between)
&& need_above.is_some_and(|n| n > between);Non-blocking
⚠ Memo test misses its key's card-tensor term: crates/gpu/src/parts.rs:1055. Mutant: key (card, room) without OnCard. Both plans (4096, 8192) hold the same tensors, so the test stays green, and a plan that moves a tensor off the card gets the stale host_bytes. Add a case where the second plan changes the card's tensors and the count rises.
⚠ Library expect on a caller contract: crates/model/src/arch/qwen35moe/place.rs:1352. R10 allows expect in a library only where the type cannot allow the failure. A plan closure that returns Ok without calling on panics here. The panic is named, so it is not silent. Direction: refuse with a PlaceError or state the contract in the type.
⚠ also 2 minor: stale PIN(2026-10-14): the default is the seats' ladder at gate_qwen38_serve.rs:3591 (now misleading); old names kept (host_room_halves_the_default, ctx_default_is_the_highest_rung_held).
Checked
- Duplicates: 9 new items checked (
Below,fit_of,Rule::word,reading,machine_read,Plans::read,fits,floor_of,step_above), none duplicated. dryer pairlevers/src/tests.rs:1583-1624~1630-1660: two tests over different reserves, shape only, not a finding. - Complexity:
largest_held5 → 18 is a new function complex on its own (the steering state in the closure);fit_ofis already split out, left.choose16 → 17 is even growth.servedandhost_room_halves_the_defaultare gate bodies, read for correctness only. - Silent failure: 6 sites followed (poisoned memo lock is a named refusal; out-of-range hint falls to the midpoint, and the
seenassert cannot fire because an open-range hint is never a probed point;RungCost::ofwithwith == 0yields;Below::Nothingfor a limit under the floor givesFloorShort;widen_card_routeread follows the returned machine;rule=fittedstring match inglm.rsagrees withRule::word). - Search: I checked the bisection invariants (largest held
k, step above is short or isctx, floor planned only when all above are short); theaboveshort plan isshorts[0]. - Tests: the
ctx_askandlargest_rowsmutants turn red; the memo test misses the key mutant above. - Gates: moved without PIN: mimo2 host-room, qwen3 whole-fit (item 1). Renamed tests carry PINs.
- Escape catalog: none matched (no shell changes).
- Performance: load and plan path, not a hot path. No headroom items.
Notes
gpu.jsonevidence is false: no commit hashes, the gate runs were before the rebase, and the sixgate_*_servegates andparts::tests did not run. The PR body says so; a maintainer needs to run them on a card.- The PR body says
cargo clippywas not run.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_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)
3cec665 to
4cc2ff3
Compare
There was a problem hiding this comment.
Verdict: CLEAN: the earlier must-fix is fixed for mimo2, and the qwen3 clause still pins the largest context, so only non-blocking items remain.
Since the last review:
- Must-fix 1 (mimo2
host_room_halves_the_default): fixed. gate_mimo2_serve.rs:971 has the dated PIN, andneed_above > betweenat line 990 turns an off-by-one low mutant oflargest_heldred. - qwen3
default_load_is_its_whole_fit: no PIN, now a ⚠. Mutant: the search loads one step low. The clause fails when the step above fits and was probed. - The other ⚠ items are still open, unchanged.
Non-blocking
⚠ Reshaped clause has no dated reason: gate_qwen3_serve.rs:3152. The old clause required the last verdict at the loaded context; the new one drops that order. Add above check(: // PIN(2026-10-28): the default is fitted, not halved; the clause pins that no larger probed context fits.
⚠ Memo test misses its key's card-tensor term: parts.rs:1055. Mutant: key (card, room) without OnCard. Both test plans hold the same tensors, so it stays green. Add a case where the second plan moves a tensor off the card.
⚠ Library expect on a caller contract: place.rs:1352. A plan closure that returns Ok without calling on panics (R10). Direction: return a PlaceError.
⚠ also 2 minor: stale PIN(2026-10-14): the default is the seats' ladder in gate_qwen38_serve.rs; old names kept (host_room_halves_the_default, ctx_default_is_the_highest_rung_held).
Checked
- Duplicates:
need_aboveis the only new item in this round, one use. - Complexity:
largest_held5 → 18 andchoose16 → 17 unchanged;host_room_halves_the_default30 → 34 is a gate body, read for correctness only. - Silent failure:
need_abovewithc + STEPpastctx_max: the need only grows, so> betweenholds. - Gates: mimo2 PIN present; qwen3 PIN missing (⚠). Escape catalog: none matched.
Notes
gpu.jsonevidence is false: no commit hashes, and the sixgate_*_servegates andparts::tests did not run. A maintainer needs to run them on a card.- The PR body says
cargo clippywas not run.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_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)
…limit that the machine holds
… rule turned the draft off
…the same card tensors
4cc2ff3 to
3d08b1d
Compare
There was a problem hiding this comment.
Verdict: CLEAN: the rebase edits are three mechanical changes with no behavior change, and the earlier items are all non-blocking.
Since the last review: the four non-blocking items below are still open, none answered by the author.
Non-blocking
⚠ Reshaped qwen3 clause has no dated reason: gate_qwen3_serve.rs:3152, the default_load_is_its_whole_fit clause. The old clause required the last verdict at the loaded context; the new one drops that order. No PIN(2026-10-28) is in the file. Add above check(: // PIN(2026-10-28): the default is fitted, not halved; the clause pins that no larger probed context fits.
⚠ Memo test misses its key's card-tensor term: parts.rs:108. Mutant: key (card, room) without OnCard. Both test plans hold the same tensors, so it stays green. Add a case where the second plan moves a tensor off the card.
⚠ Library expect on a caller contract: place.rs:1352. A plan closure that returns Ok without calling on panics (R10). Direction: return a PlaceError.
⚠ also 2 minor: stale PIN(2026-10-14): the default is the seats' ladder at gate_qwen38_serve.rs:3591; old names kept (host_room_halves_the_default, ctx_default_is_the_highest_rung_held).
Checked
- Interdiff:
ctx.is_multiple_of(STEP)at ctx_ladder.rs:35 equalsctx % STEP == 0on an unsigned type, and the method is already used across the tree. TheMemoKeyalias at parts.rs:108 names the same tuple. The removed test importtensor_placeshas no use left in the test module. TheNamealias in the ctx_ask test is test-only. - Duplicates: 1 new item (
MemoKey), one owner. Complexity:largest_heldandchooseunchanged. Silent failure: no new site. Gates: no pin moved in this round. Escape catalog: none matched.
Notes
gpu.jsonevidence is false: no commit hashes, and the sixgate_*_servegates andparts::tests did not run. A maintainer needs to run them on a card.- The PR body says
cargo clippywas not run.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/bloomery_serve_qwen38.rs, crates/gpu-gates/src/bin/gate_ds41_serve.rs, crates/gpu-gates/src/bin/gate_glm5next_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. |
--ctx-size를 주지 않으면 모델이 학습한 context에서 시작해, 머신이 담는 가장 큰 1,024 단위 context를 고르도록 바꾸고, 서버 시작 때 plan을 덜 반복하게 합니다.What and why
Without
--ctx-size, a slot is planned at the model's limit. When that plan does not fit, the old default halved the context until a plan held, so a machine that could hold 116,736 tokens a slot got 65,536. Now an unset context takes the largest multiple of 1,024, down to a 4,096 floor, whose plan holds. A set--ctx-sizeis unchanged: it holds, or it is refused with the largest share that holds.The search keeps one bisection owner (
placement::ctx::largest) and asks fewer plans by trying the step under the first short plan next. The MTP draft is turned off for the context only when the plain load holds at least twice the drafted context, so a few 1,024 steps do not cost the draft. The setup line names the rule that set the context (set,targetorfitted) and why a rule turned the draft off. Two start-time costs are removed: a checkpoint folder's least part reads are planned once for plans that hold the same card tensors, and a context probe reads the plan of the machine it already made instead of planning it again. The docs that described the halving default (docs/serving.md,docs/BUILD.md,docs/contrib/dgx-spark.md,docs/contrib/qwen35-dense-validation.md) and the gate comments now describe the new default.Release notes: Changed: with no
--ctx-size, the server picks the largest context the machine holds instead of halving from the model's limit, and the setup line names the rule that chose it.Code shape
ctx::largest; the line's fit is computed in one place (fit_of); the least-reads memo lives inPlacedSource::host_bytes; plan reuse lives inwiden_card_route.DEFAULT_TARGETand the halving rule are removed, and the tests and docs that named them are updated.PINlines.PIN(2026-10-27)orPIN(2026-10-28)with the reason.dense_shortage_fits_the_default_contextprobes[16384, 10240, 9216, 8192]and chooses the same 8,192 context as before.cargo fmtis clean on what I touched. I did not runcargo clippyon this branch.Duplication found or removed (
path:line), or "none": none.What I ran
Start time, measured with
bloomery-serve -m <Qwen3.8 FP4-Local folder> --parallel N --plan, N = 1, 2, 4. The model isnvidia/Qwen3.8-Flash-Next-FP4-Localat revisionb9ce18a6. Both arms ran in one sitting in the order base, head, head, base, twice, so each arm has four wall-clock runs per N. The base arm is the upstream commit this change builds on.At 4 slots the head prints
ctx rule=fitted ctx=116736 slots=4 total=466944and the base printsctx rule=halved ctx=65536 slots=4 total=262144. At 1 and 2 slots both arms keepctx rule=target ctx=262144, so the change there is only the plan reuse.Checks on the code of this branch, before its last rebase onto upstream
efa54f26a. The rebase changed only context lines in two test files that upstream had moved, and the lines this PR adds are the same.cargo fmt -p bloomery-placement --check: exit 0.cargo test -p bloomery-placement: 209 passed, 0 failed.a_short_card_fits_only_the_default,a_steered_search_ends_on_the_largest_step_whatever_the_shortfalls): exit 101 each.just check: exit 0.cargo fmt --all --check: exit 0.the_card_route_runs_the_whole_ubatch_where_nothing_moves_for_it: 1 passed. A mutant that returns the widened machine with the first plan's read fails it, exit 101.just gate-qwen3-plan: exit 0, 7 passed, 0 failed, includingdense_shortage_fits_the_default_context.Not run:
gate_qwen3_serve,gate_qwen38_serve,gate_mimo2_serve,gate_glm5next_serve,gate_ds41_serveandgate_nemotron_serve, whose models were not available, and thebloomery-gpupart-load tests (parts::). Their sources compile injust check. The gate runs on the rebased head did not finish, so the checks above are not repeated on it. The change touchescrates/gpu, so a maintainer needs to run those gates on a card.Hardware
just check,just gate-qwen3-plan, widen testnvidia-smi on each machine:
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.