Final review report · NVIDIA/hyperflare-inference #658

Raw Markdown for agents: https://autobot.eidonix.com/p/7040968f-b848-4b5b-9a83-70ba243b1f22.md

Recommendation: Changes Requested

The production fixes across core_storage.py, capture.py, and sampling.py are small (+27/−3 production lines), technically sound, and address real unified-memory preparation and address-hygiene defects without touching Helios, core wire formats, or serving hot paths. Before merging, please fix two concrete defects in the new code/tests: a sys.modules test-isolation leak in the dead-in-CI flashinfer import stub (tests/preparation/test_core_storage.py:122-128), and an incorrect external address band (24 GiB [0x9_0000_0000, 0xf_0000_0000) instead of 36 GiB [0x9_0000_0000, 0x12_0000_0000)) in both ignition/preparation/core_storage.py:68-70 and the PR description; also consider dropping the redundant post-warmup() sync/reseal at ignition/preparation/capture.py:183-184.

Merge Risk

Level: Low

Walkthrough

Pre-merge Checks

Blockers

None.

Should Fix

  1. Fix the external address-band arithmetic in ignition/preparation/core_storage.py:68-70 (and PR description): The new comment claims external library allocations lie in "the 24 GiB [0x9_0000_0000, 0xf_0000_0000) range" below DEVICE_BASE (0x12_0000_0000). The actual constants (EXTERNAL_FLOOR = 0x900000000 = 36 GiB, DEVICE_BASE = 0x1200000000 = 72 GiB, RESERVATION_BYTES = 48 << 30 = 48 GiB) are internally consistent (72 + 48 = 120 GiB < 128 GiB), which leaves a 36 GiB band [0x9_0000_0000, 0x12_0000_0000) below DEVICE_BASE—not 24 GiB ending at 0xf_0000_0000 (60 GiB). Update the comment on core_storage.py:68-70 and the PR description to state 36 GiB [0x9_0000_0000, 0x12_0000_0000) (or adjust the constants if 60 GiB was actually intended).
  2. Remove the dead, sys.modules-leaking flashinfer stub in tests/preparation/test_core_storage.py:122-128: CI installs flashinfer-python[b12x] via uv sync --extra prepare --extra test (.github/workflows/python-cpu.yml:29 (not opened), pyproject.toml:25), and existing CPU tests already import DeviceRequestState directly at module scope (tests/components/test_state_transfer.py:13). Worse, when flashinfer is absent and the stub branch executes, monkeypatch.delitem(sys.modules, "ignition.components.sampling", raising=False) records nothing if sampling was not previously imported, so the subsequent from ignition.components.sampling import DeviceRequestState leaves a stub-poisoned ignition.components.sampling module (with filter_probabilities_out = None, probability_filter_workspace = None, sample_probabilities = None) cached in sys.modules after test teardown. Delete lines 122-128 and import DeviceRequestState directly (and optionally exercise a real tensor_metadata.NumericStorage() context instead of monkeypatching record_numeric_tensor, since NumericStorage works on CPU tensors).

Subtract / Simplify

  1. Drop redundant stream.synchronize() and warmup_storage.seal_low_window() after the probe with warmup(): block (ignition/preparation/capture.py:183-184): When warmup_storage is a CoreStorage, warmup is bound to warmup_storage.transient (capture.py:116), whose __exit__ (ignition/preparation/core_storage.py:290-296) already runs torch.cuda.synchronize(self.device) unconditionally and—because retain_transient_backing() closed at capture.py:144 (shared == False)—runs del pool, torch.cuda.empty_cache(), and self.seal_low_window(). Lines 183-184 therefore repeat a sync and a full low-window sweep immediately after transient().__exit__() on every integrated-GPU export (both GA10B and GB10). Delete capture.py:183-184 (and update test_capture_graph_metadata.py:559-568 by having the fake transient() invoke seal_low_window() on exit, matching CoreStorage.transient()), or document in the comment why a post-transient() sweep is still required (e.g., if an outer retain_transient_backing() caller is supported).
  2. Deduplicate the ExportGraph + torch.cuda monkeypatch setup in tests/preparation/test_capture_graph_metadata.py:527-544: Lines 527-544 repeat test_capture_forwards_export_sets_node_priority_instantiation_flag (:332-348) nearly verbatim. Extracting a small helper removes ~18 lines of boilerplate.

Nits

Dropped on verification