Explore report · NVIDIA/hyperflare-inference #659

Raw Markdown for agents: https://autobot.eidonix.com/p/7121f992-dde0-49bd-b1a6-9a1dd0cc6663.md

Case file — PR #659 perf(helios): alias null continuation row zero onto a single zeroed VMM granule

Repo: NVIDIA/hyperflare-inference · head 16e2247 (single commit) · base main (branched at a747a5a) · 3 files, +196 / −33 · opened and last updated 2026-12-01 · open, "ready for review" · CI passed on head · no reviews, no labels, no comments.

Key findings

  1. The change is real and consistent with its description, and its arithmetic checks out by hand. Row zero of a continuation-state model's state pool is now backed by one shared 2 MiB physical granule mapped at every full leading granule offset, with a separately backed partial tail: sentinel_saved_bytes at helios/src/runtime_core/cache_memory.rs:68-71, Layout::sentinel_granules at cache_memory.rs:259-267, the multi-address map_cache_chunk call at cache_memory.rs:1416-1437, and the reduced zeroing at cache_memory.rs:1467-1488. Virtual spans are deliberately untouched.
  2. The description omits the price of the saving: mapping handles. handle_charge now charges 1 + sentinel_granules * row_readers plus a handle for the tail (cache_memory.rs:81-102). For the DCP16 fixture (16 granules, 1 row reader per rank) that is 2 → 19 per rank, +17 × 16 = +272, which is exactly the 518,232 → 518,504 in the updated assertion (cache_memory.rs:818-834) and in docs/runtime-core-design.md:829-833. The cost scales with readers — a 16-reader row plane costs up to 39 × 16 = 624 extra mappings per rank — so this PR spends the headroom that #391 created and documented (headroom drops from 6,056 / 1.2% to 5,784 / 1.1%), and handle margin was a blocking review topic in #391.
  3. A GPU test's coverage is reduced, and it was not run. cuda_aliases_preserve_rows_while_unowned_pages_are_rewritten previously verified row zero had distinct backing; row 0 is now excluded from the distinct-pattern upload (.skip(1), cache_memory.rs:1226) and only asserted to stay zero (cache_memory.rs:1210-1211). It is one of the CUDA-device VMM tests the author explicitly did not run ("all local GPUs were occupied").
  4. The premise — "nothing writes row zero" — is enforced outside Helios. It is enforced in Ignition (ignition/components/state.py:76-80, 190-197, 229; ignition/components/state_transfer.py:78-80), documented (docs/core-design.md:1497-1500, docs/design-review.md:80), and reflected in allocation starting at row 1 (helios/src/scheduler.rs:946-948, 1753). Helios itself has no guard rejecting a write to row 0 — helios/src/offload/transfer.rs:156-163 only bounds-checks against row_capacity. The author states this as a limitation.
  5. Evidence is CPU-unit-test only; the memory-reclaim claim has no live measurement. Two new CPU tests pin the formula (cache_memory.rs:1366-1385) and the capacity gain (memory.rs:2030-2049); the author reports 191 passed, 0 failed, 11 ignored for --lib runtime_core:: on a747a5a5. No VRAM reading from a real model load is given.
  6. Good project fit on charter grounds, with precedent for the disclosure position. It is a memory issue fixed in shared planning code with no per-model branch (charter "Keep the runtime small and model-agnostic"), and it is runtime-only: no core/Protobuf/CLI/metric change, so exported cores still load — but planned cache capacities shift upward on the same hardware.

The change

Plain terms. For models whose continuation state lives in a state pool (sizing.capacity == 0), the pool's row zero is a permanent null row that is never handed to a request or a snapshot. Previously its whole padded span was backed by its own physical device memory (fixed_bytes = ceil(execution * row_bytes / alignment) * alignment, cache_memory.rs:157). On a 35 MiB or 82 MiB row that is tens of MiB of VRAM per rank holding zeros.

Now allocate_shared_cache creates one alignment-sized physical handle and cuMemMaps it at each of row zero's floor(row_bytes / alignment) leading granule offsets (cache_memory.rs:1417-1427); the remainder fixed_bytes - sentinel_bytes gets its own handle (cache_memory.rs:1428-1437), and only one granule plus that tail are zeroed (cache_memory.rs:1468-1482) instead of the full span. The fall-through paths for sentinel_granules <= 1 are the old single-handle behaviour (cache_memory.rs:1438-1447, 1483-1488). map_cache_chunk already supported mapping one handle at several addresses for snapshot↔KV aliasing, so this reuses an existing mechanism rather than adding one.

Planner side. row_backing_bytes(core, units) (memory.rs:383-414) computes the padded span minus sentinel_saved_bytes(s.unit_bytes, align) when units > 0, and replaces bytes(core, 0, execution) in the fixed-footprint check (memory.rs:486), the fits/minimum-footprint search (memory.rs:510, :523), the minimum cache footprint (memory.rs:1003) and gpu_bytes reporting (memory.rs:1249). Virtual-span arithmetic is deliberately left on full bytes(core, 0, ...) — mapped = bytes(core, 0, execution) + borrowed (per research notes, memory.rs:576-579).

Anything the description does not say. Only the handle cost (Key finding 2). Nothing in the description overclaims: the described tail handling, virtual-span preservation, zeroing change, handle arithmetic and the two test updates are all present in the diff. No format.rs, Protobuf, CLI or metric schema file is touched (file list: docs/runtime-core-design.md, helios/src/runtime_core/cache_memory.rs, helios/src/runtime_core/memory.rs), matching the compatibility claim.

The why

Recent activity

People

Community

Nothing found: pr_comments returned no comments; the orientation packet records no reviews and no labels. The only signal is CI passing on the head commit. Zero community interest recorded as of 2026-12-01 — expected for a same-day PR by the code's main author.

Project fit

Claims and evidence

Claim in the description What backs it Assessment
Reclaims (floor(row_bytes/alignment) − 1) * alignment bytes per rank sentinel_saved_bytes (cache_memory.rs:68-71), used in planning (memory.rs:405-409) and in allocation (cache_memory.rs:1416-1437); test asserts 38 granules saved for an 82,143,488 B row and 0 for one granule or a sub-granule row (cache_memory.rs:1366-1372) Verified in code and by CPU test
32 MiB/rank on a 35 MiB row, 76 MiB/rank on an 82 MiB row arithmetic from the formula (16 granules → 15 saved = 30 MiB nominal; 39 → 38 saved = 76 MiB); no runtime measurement Arithmetic plausible; the 32 MiB figure rests on the actual padded span, not shown in a test
158 MiB → 82 MiB for 2 rows and a KV-page gain under a 900 MiB budget memory.rs:2030-2049: bytes(core,0,2) = 158 MiB vs row_backing_bytes(core,2) = 82 MiB, page capacity within one page Verified as a CPU unit test
Handle accounting updated handle_charge (cache_memory.rs:81-102); assertion 494,576→494,848, 647,544→647,816, target 518,232→518,504 (cache_memory.rs:818-834); docs example docs/runtime-core-design.md:829-833 Verified; hand arithmetic reproduces +272 handles (2 → 19 per rank × 16)
191 passed, 0 failed, 11 ignored on a747a5a5 author's command line in the description Not independently reproducible here; no CI artifact cited
Existing cores load and serve without re-export no format/Protobuf/CLI/metric file in the diff Verified by file list
"Row zero stays zero / rows 1..7 distinct backing" GPU test cuda_aliases_preserve_rows_while_unowned_pages_are_rewritten (cache_memory.rs:1210-1280) Weakened: row 0 excluded from the distinct-pattern upload (.skip(1), :1226) and only asserted zero; not run in this PR
"Pure KV models and row_bytes < 2*alignment unaffected" both new branches fall through to the old single-handle path (cache_memory.rs:1438-1447, 1483-1488); row_backing_bytes subtracts 0 Verified

Not provided: any live VRAM reading, any served-workload or startup-time measurement, and any run of the CUDA VMM tests.

Reach

Process

Open questions and what could not be found

  1. Handle margin: with +272 handles for the DCP16 fixture and up to 39 × row_readers extra mappings per rank for peer-read rows, does any supported wide-DP layout move too close to RM_HANDLE_RANGE = 524,288? #391's reviewer treated margin as blocking; the description does not address it.
  2. Trait at the model boundary: the aliasing assumes a model never writes row zero. Ignition enforces it (ignition/components/state.py, state_transfer.py), but Helios has no runtime guard, and new recipes are written elsewhere (local-inference-lab/hyperflare-recipes). Is a runtime-side check or a documented contract change needed?
  3. No measured evidence: there is no live VRAM or capacity delta from serving a real GDN/Mamba core, so the headline 32 MiB/rank / 76 MiB/rank figures remain arithmetic.
  4. GPU test coverage: cuda_aliases_preserve_rows_while_unowned_pages_are_rewritten no longer proves row zero has distinct backing and was not run; is a follow-up run (or a replacement assertion that an aliased row-zero write is visible at all offsets and stays within its own granule) required before merge?
  5. Operator-visible capacity shift: should the description or release notes state that planned KV page counts rise on the same hardware?
  6. Not found: any linked issue, forum/Discord report, or roadmap item asking for this saving; any competing or stacked PR; any review, comment or reaction on this PR; and the commit's design-review sign-off trailer.