Repository navigation
placement: plan each census card at its own figures and allocation granule - #1031
Conversation
…anule The census reads each device's allocation granule (cuMemGetAllocationGranularity) beside its memory, a tier node's census carries it (protocol version 7), and a card spec plans with it: the stage and tier cards' allocator, the pool budget's lowering step and the Qwen3 serve's cache bytes. Every census device now plans its own figures; the driver-name table that gave the A6000 and the 3090 their nvidia-smi totals is gone, as their usable bytes are the census rule's already. The workstation's cards, plan (b') by name and the census-free aliases are named reproductions of that workstation; the context, scratch and margin terms are the program's figures and say so.
There was a problem hiding this comment.
Verdict: CLEAN: No merge-blocking defect found in the changed paths.
Checked
Duplicates: 3 added or renamed functions and 1 static checked against existing owners; none duplicated. Dryer reported 0 pairs. GPU and gate code were also searched by hand.
Complexity: ctx_default rose 56→57 and NodeCensus::read rose 29→30. Both add a fallible granule read; neither adds a new placement policy. No split requested.
Silent failure: 4 sites followed through census conversion, wire encoding, wire decoding and the planner fallback. A zero CUDA reading returns a named error. Wire zero represents the supported absence of a backend reading; only that absence selects the documented fallback.
Tests, static mutation analysis: hardcoding the granule in spec_of_device:159 or card:216 contradicts the new 64 KiB assertions, including the gate placement and unplaced-card checks.
Tests, static mutation analysis: returning a raw plane sum at kv_bytes:760 makes the fine/coarse assertion fail. The PR also supplies FAIL-first output for the server cache clause at the changed context.
Tests, static mutation analysis: replacing pool:58 with either granule alone breaks the coarse-card or fine-card call-count assertion. Dropping the field at NodeCensus::read:224 breaks census round-trip equality.
Gates: no tolerance or acceptance band relaxed. The cache clause's context changes to keep raw sums distinguishable from rounded allocation totals.
Adversarial checks: empty census, zero CUDA granule, heterogeneous card selection and old protocol frames reach named refusals or preserve the selected card's granule. Changes affect census, planning and gate setup; no per-token work was added.
Escape catalog: C1–C4 have no matches in the changed code.
Notes
Tests and GPU gates were not run in this review. The supplied runs name head d459b0a7a773330d0639b83acb9a0bb875fedc67, not the reviewed head, and omit nvidia-smi output. GPU evidence is marked false.
Card check: needs-gpu. This pull request changes crates/gpu-gates/src/bin/gate_qwen3_serve.rs, crates/gpu-gates/src/bin/generate_glm5next.rs, crates/gpu-gates/src/bin/shared/qwen3moe_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. |
census가 읽은 카드의 allocation granule을 계획까지 전달하고 두 워크스테이션 카드용 driver 이름 표를 지워, 어떤 CUDA 카드든 자기 숫자로 계획하게 하는 PR입니다.
What and why
Placement planned a census card through
KNOWN, a table of two driver names (the A6000 and the 3090), and priced every card's allocations at one fixed granule constant. A card with another name or another allocation granule was planned at the workstation's figures, and the Qwen3 serve cache bytes did the same.This PR makes the census the source:
crates/device/src/lib.rs:DeviceInfo.granule_bytes: Option<NonZeroU64>,Nonefor a backend that cannot read it (Metal, mock).crates/gpu/src/lib.rs,crates/gpu/src/host/node.rs,node/wire.rs: the census reads the granule withcuMemGetAllocationGranularity, a granule of no byte is a named error, and the tier node census carries it (node protocol version 6 to 7).crates/placement/src/placement/devices.rs,workstation.rs:KNOWNis deleted,CardSpec.granule_bytesis new, andfn card()plans at the spec's granule. The workstation constants (A6000,RTX_3090,CARDS,machine_bp, and the census-less alias) are documented as the named reproduction of the maintainer's workstation.crates/placement/src/placement/pool.rs:plan_in_poollowers a round bycard.granule_bytes.max(workstation::GRANULE), so a card with a smaller granule still searches the fullPOOL_ROUNDSrange.crates/gpu-gates/src/bin/shared/qwen3moe_place.rs,gate_qwen3_serve.rs,crates/placement/src/placement/qwen38_cards.rs: Qwen3 serve cache bytes, the gate's five cache expectations and the Qwen3.8 stage and tier cards use the planned card's granule.DeviceInfoorCardSpecliteral.Release notes: Changed: placement plans each census card at its own allocation granule instead of a fixed constant and a two-card driver-name table.
Code shape
The review reads these first. A box left unticked needs one line of why.
machine_bpincrates/model/src/arch/qwen35moe/place.rs; no common owner gained a per-model branch.KNOWNand theGRANULEimports it left unused are removed.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none.What I ran
Base
d72572f1a5b687ca12b1cf01fdf2fb9d0fd44341, headd459b0a7a773330d0639b83acb9a0bb875fedc67.Census gate on a GB10 (
bloomery-servemodelnvidia/Qwen3.8-Flash-Next-FP4-Local) and on an RTX 5090, then the node census tests on the GB10:On the RTX 5090 the same gate prints
gate_gpu_device: device=NVIDIA GeForce RTX 5090 ordinal=0 backend=cuda fault_none=0xffffffffandgate_gpu_device: PASS. The library gate on the RTX 5090 (just gate-gpu-lib):The real server plans from the census, loads and answers one request (
bloomery-serve --plan, thenbloomery-serve --host 127.0.0.1 --port 18741 --ctx-size 8192and one/v1/completionsrequest, "The capital of France is", 16 tokens, temperature 0).On the GB10:
On the RTX 5090 with
Qwen3.6-35B-A3B-Q4_K_M.gguf:The Qwen3 serve gate compares the server's cache bytes with the planes rounded to the card's granule. Its
whole_fit_counts_the_planes_granulesclause, first withkv_bytessumming the raw planes, then with the granule:Hardware (if the change is for a machine)
NVIDIA GB10, driver 595.84, CUDA 13.3, one DGX Spark, Linux aarch64.
NVIDIA GeForce RTX 5090, driver 595.99.02, CUDA 13.3, Linux x86_64.
AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.