Repository navigation
placement, gpu-gates: a tier card on another host plans in its own node's pool - #503
Conversation
…de's pool A two-node load put node 1's tier card in node 0's unified pool (Place::machine always built plan_tiers' one-node machine), so node 0's NVMe floor lowered the one card budget for both cards and left the experts neither card took on node 0's host. Place::on_nodes marks the placement when every tier node is off this host, and Place::machine_with then adds a node per tier card (workstation::node_of) to the machine a layout makes; Machine::on_this_node keeps a remote tier's bytes out of the pool sums. Place::machine and Qwen3.8's plan (b′) machine (machine_bp38 in the shared Qwen3.8 placement file, used by the CLI, the serve seat, the unset-rule probe, the routed-leg gate and the node gate's placed plans) both lay out through it. nodes::loaded_routed seeds an explicit node ownership on node 0 alone. Loopback nodes keep sharing the pool.
|
ARM CPU인 스파크에서는 실사용이 불가능한 작업을 계속하는 것 같아 계획 자체를 바꾸었습니다. 그래서 앞으로 스파크 작업은 전부 TP 구조로 가려고 합니다. 물론 Bloomery의 철학을 존중하고 있기 때문에 많은 구조 변경은 없습니다. 최대한 짜놓으신 아키텍쳐 안에서 진행하겠습니다. PP 쪽 구조적 한계는 더 다듬지 않고, 이 PR은 결함 수정으로만 봐 주시면 될 것 같습니다! (AI 코딩 에이전트가 작성한 코멘트이며, 내용은 제가 확인했습니다.) |
There was a problem hiding this comment.
Verdict: CLEAN: No reachable behavior defect or proven quality defect remains in the changed paths.
Checked
Duplicates: 8 new functions checked, including the new test; no duplicate owner found. Dryer reported 0 pairs. Its skipped gpu-gates additions were checked with Grep.
Complexity: plan_rule rises 35 → 37 through node-count validation and locality filtering; totals rises 21 → 22 through the locality condition. Both changes belong to existing memory accounting.
Silent failure: 0 new suppression/default sites. Census and layout errors propagate; invalid node counts return PlacementError::Nodes.
Tests: Static mutation review only. Removing locality filters at crates/placement/src/placement.rs:366 and lines 2571, 3826 and 4135 breaks the new pool assertions. Restoring the old node-count rejection at crates/placement/src/placement.rs:2450 breaks the remote-tier test; accepting two nodes without tiers breaks nodes_scale::named_refusals.
Tests: Dropping the node-0 projection at crates/placement/src/placement/nodes.rs:58 breaks the extended explicit-ownership test. Dropping remote-node construction at crates/gpu-gates/src/generate.rs:773 breaks the extended topology test. The adjusted zero-node fixture still checks error propagation at crates/placement/src/placement.rs:3704.
Gates: No pin moved and no gate clause was removed. The body supplies FAIL-first results for the new assertions.
Adversarial checks: Missing/mismatched nodes are refused. Remote cards retain their census free-memory caps and floor checks. Repeated device UUIDs are refused. Explicit ownership seeds only node 0.
Performance: Load-time planning only; no decode or prefill work was added.
Escape catalog: No C1–C4 pattern matched.
Notes
No build or gate was run during this review. GPU evidence is incomplete: the body includes unit-test output, builds and timings, but no just gate-* run with output. Supply the exact model filename and complete commands/output for the performance tables.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen38_nodes.rs, crates/gpu-gates/src/bin/generate_qwen3moe.rs, crates/gpu-gates/src/bin/shared/qwen38_place.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. |
두 개의 노드로 GLM을 올릴 때 각 노드가 자기 메모리만 보고 배치하도록 고쳐서, host로 밀려나던 expert를 6,767개에서 864개로 줄이는 결함 수정입니다.
What and why
On an expert-tier load across two DGX Sparks (
--place 0+1withBLOOMERY_TIER_NODESnaming node 1), the planner charged node 1's card to node 0's unified pool.Place::machinebuilt a one-node machine throughworkstation::plan_tiers, and the pool sums in placement (pool_bytes, the pool cards intotals,pool_needand the beside reserve) counted every tier card against node 0.plan_in_poolthen lowered the common card budget to fit node 0 alone, so on GLM-5.3-Flash node 0 left 87.6 GB of experts to NVMe paging and ran about 6,800 experts on its CPU while node 1's card had room for them.With this PR, a tier card on another host plans in its own node's pool. Node 0's pool holds the stage card and the host, and node 1's card is bounded by node 1's own census reading. On the same GLM load, node 0's host experts fall from 6,809 to 864 and nothing is paged. The 864 left are the experts the GLM placement keeps on the host for layers whose down stacks are Q6_K (see What I ran into).
What changed:
crates/placement/src/placement.rs:Machine::on_this_nodesays which cards take their bytes from node 0.pool_bytes,totals,pool_needand the beside reserve count only those cards.plan_ruletakes one node, or one node plus one per tier card, and refuses any other count by name (PlacementError::Nodes { nodes, tiers }).crates/placement/src/placement/workstation.rs:node_ofis the node a card's spec plans on (its host and unified pool);plan_onand Qwen3.8'smachine_for_expertsbuild their node with it.crates/placement/src/placement/nodes.rs:loaded_routedseeds an explicit node ownership on node 0 alone, so a machine with a node per tier card plans throughplan_nodestoo.crates/gpu-gates/src/generate.rs:Place::on_nodesmarks the placement when every tier node is off this host (off_host: not a loopback address, and a device that is not in this process's census).Place::machine_withtakes a layout of the placement's cards and adds one node per tier card, tierton nodet + 1, when the placement is marked.Place::machinelays out the common plan through it. A loopback tier node still shares node 0's pool.Place::machineis common to every family, so the DeepSeek V4.1 and GLM loads with off-host tier nodes take the same path.crates/gpu-gates/src/bin/shared/qwen38_place.rs:machine_bp38lays out Qwen3.8's plan (b′) (machine_bp_on's cards and reserves) throughPlace::machine_with. The Qwen3.8 CLI, the serve seat, the unset-rule probe (tier_experts, which now takes the placement), the routed-leg gate and the node gate's placed plans all build it there.crates/placement/src/placement/nodes_scale.rs: one assert follows the new error shape.docs/contrib/dgx-spark.md: the two places that said the load charges remote cards to node 0's pool now describe the per-node pools.Release notes: Fixed: on an expert-tier load across several hosts, each tier card plans in its own node's memory pool, so node 0 no longer pages experts to NVMe or runs them on its CPU for lack of room that node 1 has.
Code shape
The review reads these first. A box left unticked needs one line of why.
Machine::on_this_node), and all four pool sums read it. One function adds the tier nodes (Place::machine_with), and both machines over a placement (Place::machine,machine_bp38) are laid out through it.workstation::node_ofbuilds every card's node.machine_for_expertsonly takes its node fromnode_of.Place::machineis removed with the bound, andtier_expertsno longer takes card specs its callers unpacked.cargo fmtandcargo clippy: fmt runs in t0 (What I ran); the results below include no separate clippy run on this head.Duplication found or removed (
path:line), or "none": none.What I ran
Head
e6f1da842e192b16891254476668f51cb16127da, one commit on mainb36f8e916360005ce070b35e6e2308fef83fc18d. The two GPU runs below usedd7b0620b, the same commit on the previous main450db142: both have the same patch, and none of the main commits between them touch this PR's files.Tests (FAIL-first: each new assertion fails with the fix undone and passes with it; on the head they pass in t0 and in the GPU run below):
placement::tests::a_tier_on_its_own_node_takes_nothing_of_this_nodes_pool: with main's node check it fails onplans: Nodes { nodes: 2, tiers: 1 }; with every card still summed into node 0's pool it fails onleft: 0, right: 2304; with every card's census context in node 0's pool it fails onleft: Some(1099511627777), right: Some(1099511627776); with the beside reserve charged for every card it fails onleft: 2, right: 1.placement::tests::a_node_host_projection_keeps_non_routed_rows_on_node_zero: withloaded_routedseeding both nodes it fails ona machine of 2 nodes for 0 tier cards.generate::tests::loopback_census_is_required_without_adding_a_pool(bash tools/gate.sh --oxide -p bloomery-gpu-gates --features gpu --release --lib -- generate::tests) resolves a tier at a loopback and at another host's address without overriding the placement, then lays out the common plan and a family's own layout over it: withown_poolsstarting false it fails onleft: [], right: [Node { .. }]; without the added nodes it fails on the node list; with node 0's host reserves dropped it fails on node 0. On an RTX 5090 machine (nvidia-smi:NVIDIA GeForce RTX 5090, 595.99.02, 12.0):test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 136 filtered out; finished in 0.01snvidia-smi:NVIDIA GB10, 595.84, 12.1) in the CUDA 13.3.1 container,RUSTFLAGS='-C target-cpu=native' cargo check --workspace --all-targets --features bloomery-gpu-gates/clef,bloomery-gpu-gates/deepseek41,bloomery-gpu-gates/gemma-embedding2,bloomery-gpu-gates/gemma4a,bloomery-gpu-gates/glm5next,bloomery-gpu-gates/mimo2,bloomery-gpu-gates/vision,gpu:Finished `dev` profile [unoptimized + debuginfo] target(s) in 29.99sLC_ALL=C just contrib-check --tier t0on the head:DONE tier=t0 total=94 red=0 wall=479sOn two DGX Sparks, the GLM-5.3-Flash load with
generate_glm5next --tokens-from <prose-en ids>:50000:4096 -n 24 --ctx 4224 --place 0+1 --prefill steps, one run of main and one of the head, each from a fresh load with a freshtier_serverof the same build on node 1. Both GLM tables in this section come from47699763, this change on main7de31349. Ate6f1da84the GLM load plans the same machine; the later edits touch the Qwen3.8 paths, the explicit node-ownership seed (which this load does not use) and tests. These runs are untimed (one observation each), so the timing rows are a single sample:7de3134947699763--planrun[16013, 11, 293, 8311, ...]The 24 greedy ids of the head are main's, id for id: the experts that moved from node 0's CPU to the cards give the same tokens.
Served, one request per fresh server on the same two nodes:
bloomery-serve --place 0+1 --prefill steps --ctx-size 4224withBLOOMERY_DRAFT=off, a 4,096-id prompt at offset 50,000 of a code or English prose corpus, 128 tokens decoded, main and head alternating in one lease. Each arm ran once, so these numbers carry no noise floor. Load + prompt isload_splus the server'sprompt_ms, the time from start to the end of the first prompt.Head against main, from the table above:
The head's load is longer, and it makes more bytes resident: node 0 took 103.8 GB during the load against main's 45.2 GB, and node 1 took 76.2 GB against 45.0 GB. Main leaves those experts to NVMe paging and reads them during the prompt instead.
What I ran into
None of this blocks the PR. After the fix, node 0's CPU still computes 864 experts on this load.
card_down_runs(crates/placement/src/kernels.rs:595) has no Q6_K arm, soglm5next/place.rskeeps every expert of a layer with a Q6_K down stack on the host. Moving them to the card needs a Q6_K down arm in the card leg, which this PR does not add.Hardware (if the change is for a machine)
Two DGX Sparks (GB10, driver 595.84) joined by their direct link,
BLOOMERY_TIER_LINK=rdma, with GLM-5.3-FlashUD-Q4_K_XL(unsloth GGUF). Node 1 runstier_server --listen <node 1 address>:<port> -m <model>, and node 0 runs the stage withBLOOMERY_TIER_NODES=<node 1 address>:<port>. Main and the head were built the same way in the CUDA 13.3.1 container.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.