Skip to content

placement: charge node 0 for row-table fills from NVMe - #333

Merged
juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-p5-nvme-fill
Oct 16, 2026
Merged

juliankang4 merged 1 commit into
midagedev:mainfrom
juliankang4:dgx-spark-p5-nvme-fill

Conversation

@juliankang4

Copy link
Copy Markdown
Collaborator

Refs #127.

What and why

This is the NVMe fill term of the node planner in docs/contrib/dgx-spark.md (9.7, and Terms in 9.9), the open item that section 10 listed after #330 derived each node's budget from the census. A node plan can now take a row table that the tier plan left on the NVMe tier, such as V4.1's engram tables, and it charges node 0 for filling the rows a token gathers from it. Before, Terms::of refused such a plan by name, so the node planner could not plan the V4.1 file at all.

Release notes: internal: the node plans accept row tables left on the NVMe tier and charge node 0 a serial fill for the rows a token gathers; they take the fill rate as an input.

What changes:

  • Terms::of counts the gathered file bytes of a row on the NVMe tier twice: once in the pool read, as for a host row, and once in a new serial_nvme sum. It reuses Row::read_bytes, so no tensor size is computed a second time. A row table on the host, an unread table, and a row that is not an NVMe file segment add nothing to serial_nvme. An NVMe segment in any other format is refused as a tensor error.
  • Workload::nvme_read is node 0's fill rate in file bytes a second. NodePlan::step_ps adds serial_nvme / nvme_read to the serial part of the step, once. It does not add it per routed window or per remote node.
  • The rate is required only when it is needed. nvme_read == 0 with serial_nvme != 0 is a named NodesError::Undefined. With no NVMe rows the rate may be 0.
  • Every gathered row is counted as a miss. The model has no table-cache hits, page-read amplification, per-read latency, or overlap between the fill and the pool reads, and docs/contrib/dgx-spark.md says so. The rate is the caller's, so the code carries no drive speed of its own. This is the default I chose; the maintainer may prefer a cache or overlap model, and it would replace this one term.
  • The routed experts' arena misses keep their own term, Workload::fills. NodeBudget, HostNeed, the unified pool, the arena floor and routed_held are unchanged.
  • docs/contrib/dgx-spark.md describes the term in the NVMe line of 9.7 and in 9.9 Terms and clause 1. The open item in section 10 moves to Closed with the limit above.

What this PR does not do

  • It does not read the V4.1 file. The V4.1 case in n1_is_today is a synthetic shape with an NVMe row table, so a plan of the real file is not shown to succeed.
  • It predicts no time. The rates in the tests are given inputs, not measurements, and no NVMe read is timed here.
  • It changes no engine load, kernel, request or token, so no timing is claimed.
  • It moves no NVMe sizing out of the workstation placement code. The workstation code and the node plans each keep the computation they had.

Code shape

  • No second copy. The fill reuses Row::read_bytes and the existing pool_read. There is no new function, type, constant or public helper; serial_nvme is pub(super).
  • Model code holds only architecture facts. No model file is touched, and the common planner gains no per-model branch.
  • Dead code is gone. The refusal of NVMe rows and its test expectations are replaced, and the open item in section 10 is moved to Closed. Workload::nvme_read is read by checked_id_bytes and NodePlan::step_ps.
  • No silent failure. A rate of 0 with NVMe rows, an NVMe segment in a wrong format, and a byte sum past u64 are named errors.
  • Comments state what is true now.
  • No relaxed gate. No band, tolerance or lint moved. The test that asserted the refusal now asserts the fill.
  • cargo fmt and cargo clippy are clean on what I touched. cargo fmt --all -- --check returns 0 below, and the lint count matches main's.

Duplication found or removed (path:line), or "none": none.

What I ran

The head is fcd966fd. It merges into upstream/main (98a513fc) without conflicts, as git merge-tree --write-tree shows. The checks ran on a Mac with no GPU. I did not rebase onto 98a513fc because its commit does not touch these files.

Check Result
FAIL-first: the n1_is_today test changed to expect success for V4.1 with an NVMe row table, run on the base 8dc9ccc0 rc 101: V4.1's terms with a row table on the NVMe tier: Model(Tensor { name: "engram 0", detail: "rows read a token from the NVMe tier, which the node plans take no fill term for" })
cargo fmt --all -- --check && cargo test -p bloomery-placement placement::nodes_scale rc 0; test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 123 filtered out
just affected 8dc9ccc0 --no-box rc 0. It lists gate-placement and gate-gpu-qwen38-nodes among the gates this change reaches. The list is a static walk and ran no gate
cargo fmt --all -- --check && bash tools/check-arch.sh && cargo test --release -p bloomery-placement on a DGX Spark (aarch64 Linux, GB10) rc 0; test result: ok. 134 passed; 0 failed
just mac-static (lint) 59 warnings, above the ratchet's 41, from the same files as main's 59 at a688accb; check-recipes is red on both the same way
just gate-placement Not run. It needs the DeepSeek-V4.1 first shard and the DSpark header, which are not on this machine
just gate-gpu-qwen38-nodes Not run. It needs a CUDA build and the Qwen3.8 file
contrib-check Not run

n1_is_today is the test that holds the term. On a synthetic V4.1 shape with an NVMe row table it asserts that serial_nvme is the table's gathered bytes, that doubling nvme_read shortens the step by half of that fill, and that the host-resident table has no fill and a step shorter by the same amount. It also reads the Qwen3.8 tensor table to assert that an unread NVMe table adds no fill and that an NVMe segment in a host format is a tensor error. named_refusals asserts that a rate of 0 is accepted with no NVMe rows, refused with them, and that a rate of 1 is accepted.

Each of these mutations of the production code is covered by an assertion in those two tests, which I checked by reading the code and the assertions; I did not run the mutants: dropping the fill from step_ps, ignoring the rate, charging an unread or host-resident table, accepting a wrong NVMe format, and dropping or widening the rate-0 refusal.

What I ran into

None of this blocks the PR.

just affected against the default build host timed out on its SSH lookup of dependency information, so I ran it with --no-box. Its gate list comes from a static walk of the files, and docs/contrib/dgx-spark.md is listed as unmapped to any gate.

Hardware (if the change is for a machine)

A Mac with no GPU. The tests build and run only the bloomery-placement crate, so they are pass and fail results, not timings. The whole-crate run was on a DGX Spark (aarch64 Linux, GB10), still CPU only. No GPU gate ran.

AI help

AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.

Count an NVMe table's gathered file bytes as both a pool read and a serial fill. The workload supplies the fill rate; a zero rate is refused only when a table needs it. Routed expert misses retain their own fill term.
@github-actions github-actions Bot added dgx-spark The DGX Spark (aarch64, GB10) port documentation Improvements or additions to documentation placement Placement planning: crates/placement labels Oct 16, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: CLEAN: The fill term is validated and added once per token outside the routed windows.

Non-blocking

⚠ Pin the fill charge with multiple active nodes: crates/placement/src/placement/nodes_scale.rs:983.
All fill-duration assertions use one node. By inspection, multiplying the fill in step_ps by used.len() leaves them green; the two-node refusal test asserts no duration.
Extend an existing multi-node clause with a stable split and assert one fill delta and unchanged per-node windows. This prevents a later per-node charge from passing the gate.

Checked

Duplicates: 0 new functions, types or constants; both new fields checked, with no duplicate owner. Dryer reported 0 pairs.
Complexity: checked_id_bytes rose 14 → 16 through one conditional rate-validation branch at the existing validation owner.
Silent failure: 3 sites followed to their consumers: unread rows add no fill, a required zero rate returns Undefined, and a wrong NVMe format returns a tensor error.
Tests, mutation inspection: dropping the fill at crates/placement/src/placement/nodes.rs:1285 fails n1_is_today; dropping the zero-rate refusal at crates/placement/src/placement/nodes.rs:713 fails named_refusals; changing > to >= at crates/placement/src/placement/nodes.rs:1156 fails nic_not_max at its exact-half boundary. The multi-node fill mutant survives the duration assertions.
Gates: no threshold, tolerance or lint pin moved. The PR includes FAIL-first output for accepting the NVMe table.
Escape catalog: no matching patterns.
Performance: planning code only; no decode, prefill or kernel work changed.

Notes

Tests were inspected, not executed here. The PR reports 134 passing placement tests, but no runs of just gate-placement or just gate-gpu-qwen38-nodes. It carries no qualifying GPU evidence.

🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)

@juliankang4

Copy link
Copy Markdown
Collaborator Author

The review is done and the contribution check passed, so I'm merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dgx-spark The DGX Spark (aarch64, GB10) port documentation Improvements or additions to documentation placement Placement planning: crates/placement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant