Repository navigation
placement: build one card machine per expert-tier node - #321
Conversation
Keep each census spec and unified pool on its own machine. Node 0 holds the returned batch rows; each remote holds its batch staging and scratch. The local and remote plans and Qwen tier use one tier-card builder. The load keeps the existing single-node path. 2026-10-16: keep the separate-machine census contract in plan_node_tiers_keeps_each_census_and_service_on_its_node, not in the loopback census gate, whose two nodes share the same device. Node plans accept no draft until a load needs one.
There was a problem hiding this comment.
Verdict: CLEAN: The shared builder preserves existing card plans, and the node planner keeps each census and service reserve on its own node.
Checked
Duplicates: 5 new functions checked by Grep; no duplicate owner found. The remaining card copies are independent test oracles. Dryer reported 0 pairs.
Complexity: crapper flagged no changed functions; no complex growth found.
Silent failure: 1 conversion chain followed. Failed conversion or host-row multiplication becomes TierBatchHost and propagates through both planners.
Tests: Static mutation checks at workstation.rs:503: reusing the stage census or dropping card/host reserves fails the new census test. At workstation.rs:554, wrapping multiplication fails the new overflow assertion. Existing full-machine and Qwen assertions catch missing tier reserves.
Boundaries: no remotes preserves plan_on; independent machines accept repeated device identities; invalid draft indices retain DraftOffPlan. Missing integrated-memory census readings retain a named panic.
Gates: no threshold, tolerance, lint level or gate clause moved. Fixture inputs now use the node planner.
Escape catalog: C1–C4 do not match this diff.
Notes
Tests were not executed in this review. The PR reports passing unit and fixture runs; real-model placement and node gates remain incomplete. The fixture GPU evidence omits the model-file path required by CONTRIBUTING.md.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
Filed outside this PR: #322
|
The review is done and the contribution check passed, so I'm merging this. |
Refs #127.
What and why
This is the placement half of the engine step in
docs/contrib/dgx-spark.md9.2 and answer 20 in its section 11, the next row of the plan in #127.workstation::plan_node_tiers(crate-internal and test-only until the engine load calls it) builds one independent card machine per node from the stage spec and the remote census specs, node 0 first. Until now a plan could describe a tier only as a card inside node 0's machine. A plan with several nodes had no entry point that gave each node its own card, its own pool and its own share of the batch reserves.Release notes: internal: placement gains the per-node card machine planner that the multi-node engine load will plan through; until the load calls it, it is crate-internal and test-only.
What changes:
routed_onlywith zero KV, as a card with the whole layer range and the one head stage thatStages::newrequires of every independent machine. A remote's routed-only model has no head tensors, so nothing is placed there.plan_node_tierstakes no draft. A host-row sum pastu64is refused asplan_tiersrefuses it, through one sharedtier_service.tier_cardreplaces the privatetieras the one owner of a tier card with its service reserves.plan_tiersand the Qwenmachine_bp_onboth build their tier card through it, so the card literal thatmachine_bp_oncarried is gone.nodes_scalecases andspark_nodesuseplan_node_tiers. Cases that need a heterogeneous small pool keep their own inputs.plan_node_tiers_keeps_each_census_and_service_on_its_node.gate_qwen38_nodesis unchanged.docs/contrib/dgx-spark.mddescribes the entry point in 9.2, and section 10 lists the engine load's use of it as work left.What this PR does not do
plan_tierspath. Nothing about a load, a kernel, a request or a token changes, so no timing is claimed.Code shape
tier_cardis the one builder of a tier card with its batch and draft reserves.plan_tiersand the Qwen machine constructor call it, and the draft and host-row checks ofcheck_tiersand the host-row check ofplan_node_tiersare one function,tier_service.machine_bp_onloses a card literal and keeps its stage scratch and MTP reserve. The common placement code gains no per-model branch.tierand theTIER_BATCH_RESERVEimport in the Qwen placement file are removed.u64is a named error, and a draft past the tier list stays a named error inplan_tiers. The independent machine's head stage is checked by the existingStages::new, which still refuses a machine with none or several.tools/unsafe-ratchet.txtis unchanged.cargo fmtandcargo clippyare clean on what I touched:cargo fmt --all -- --checkreturns 0, and the lint recipe's clippy returns 0 insidejust mac-static.Duplication found or removed (
path:line), or "none": the tier card literal inmachine_bp_on(crates/model/src/arch/qwen35moe/place.rs) and the privatetierinworkstation.rsare nowtier_card(crates/placement/src/placement/workstation.rs:183). The draft and host-row validation incheck_tiersis nowtier_service, andplan_node_tiersuses it for the host rows. The tests' own reference cards (base_bp,qwen38_cards) keep explicit expected reserves, since they are the oracles the production builder is compared with.What I ran
The head is
6135c48f, run on one DGX Spark unless a row says otherwise. Base logs that name another commit say which. The branch merges intoupstream/main(d66ef090) without conflicts, asgit merge-tree --write-treeshows.cargo fmt --all -- --checkcargo clippy --target x86_64-unknown-linux-gnu --workspace --all-targets --features gpu,...(the lint recipe's command, run byjust mac-staticon a Mac)^warning: 41 = the ratchet 41, so no new warningcargo test -p bloomery-placement -p bloomery-levers, thencargo test -p bloomery-model arch::qwen35moe::placetest result: ok. 40 passed; 0 failedfor levers,test result: ok. 133 passed; 0 failedfor placement, andtest result: ok. 22 passed; 0 failedfor the Qwen placement testsjust gate-placement6 passed; 5 failed. The base278b7f79ends the same way, with the same fivehw_placement_*tests failing on the missing DeepSeek-V4.1 first shard, so this gate is not shown to passBLOOMERY_BOX_LOCAL=1 BLOOMERY_TIER=fixture just gate-gpu-qwen38-nodesPASSED: gate_qwen38_nodes, 8 clauses ran, 0 left to the real tierjust affectedselects against278b7f79, with the base run beside itgates-affected: 162 gates, ok 24, same as base 137, differs 1, unproven 0. See the notes below the tablejust canon-check 278b7f79(BLOOMERY_ARCH=sm_86) onb3a7baf9, which has the sameplace.rsas the headcanon-check: 3 bins, 826 entries: 826 identical, 0 reordered-only, 0 differs, 0 only-on-one-side, so no PTX movedLC_ALL=C just contrib-check --tier t0DONE tier=t0 total=84 red=1 wall=294s red: check-recipes. The base shows the same single red step: its--v41-queueself-test finds notools/arch.shin its temporary box tree./tools/mac-static.shon a Mac, compared with a base logcheck-recipes, because theptx-compareself-test fails (33 cases, 1 failed). The base log is forfc47ee62, not for278b7f79; it readsFAIL cold runand the sameptx-compare: self-test FAIL (33 cases, 1 failed)The affected-gates line has three notes.
ok 24is the count of gates that passed.same as base 137counts gates where the head and the base ended alike, which is not a pass: 16 of them were refused with rc 64 on both sides because their models are not on the contributor machine, and I did not run them. They aregate-gpu-ds41-twocard,gate-gpu-ds41-callstream,gate-gpu-qwen38-twocard,gate-gpu-glm5next-twocard,gate-gpu-glm5next-serve,gate-gpu-serve-start-glm,gate-gpu-serve-start-ds41, sixgate-gpu-glm5next-*variants, and twogate-gpu-qwen35moe-e2evariants.gate-gpu-qwen38-nodesis the one that differs, and it is the gate this PR reaches. Its 5 unit tests pass on the head and on the base. Both then stop at the Qwen3.8 model shard, which is not on the machine, with rc 1. So the real-model part of this gate is not run. In the full run the base side also failed one process-cleanup unit test, and that test passed when I reran the gate on both sides.gate-gpu-qwen38-nodesrun in the table is a single-card loopback run. It is not a real-model run and not a two-machine run.FAIL-first mutations, each applied to the head's production code:
tieredno longer reserves the batch rows on node 0's host (thehost_rows != 0condition is removed)plan_node_tiers_keeps_each_census_and_service_on_its_nodeplan_node_tiers_keeps_each_census_and_service_on_its_nodeplan_node_tiers_keeps_each_census_and_service_on_its_nodeplan_tiersbuilds its local tier card from an empty default cardplan_tiers_is_plan_bp_a_and_gateplan_oncardarch::qwen35moe::place::tests::bp::the_machine_of_plan_bpWhat I ran into
None of this blocks the PR.
contrib-check --tier t0andjust gate-placementend the same way on the base, and the branch adds no red step to either.just mac-statichas one red step, and the base log I compared it with comes fromfc47ee62, so that comparison is weaker than the others.plan_node_tiersdoes not compare devices between nodes. Names and ordinals are local to a node, so two specs with the same card name, ordinal and UUID are accepted. On a loopback setup with one Spark, both machines would then sit on the same GB10 pool, and each would budget against it as if it were alone. Checking device identity across nodes belongs with the load that reads the census.canon-checkshows that no PTX moved. That the Qwen card is the same as before is shown by the model-card testarch::qwen35moe::place::tests::bp::the_machine_of_plan_bp, which is also one of the FAIL-first targets above.Hardware (if the change is for a machine)
The unit tests, gates, the t0 check and the FAIL-first runs ran on one DGX Spark (
NVIDIA GB10, 595.84, 12.1innvidia-smi).just mac-staticand clippy ran on a Mac. These are pass and fail results, not timings.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.