Recommendation: Ready To Merge
Head 8c1a28a resolves every Round 1 review item cleanly and introduces no correctness, safety, concurrency, or memory regressions. The production change is minimal and sound: lazily backing CoreStorage.warmup_pool() with self._allocator keeps seeded cuBLASLt warmup VMM segments inside declared storage.mappings so prepare_allocations skips the cuPointerGetAttribute external-allocation check that fails on unified-memory GPUs (GB10), while preserving #331's off-capture stream isolation and non-export behavior. Remaining items are optional subtractive cleanups and minor nits (including noting that the RuntimeCore.write tail in the new CUDA test does not itself toggle discover_allocations=True).
Merge Risk
Level: Low
- Narrow, isolated production footprint: +12/−0 lines in
ignition/preparation/core_storage.pyand +16/−7 lines inignition/preparation/capture.py; no CLI flags, config knobs, serving hot-path changes, or per-model branches. Non-export callers withoutwarmup_pool()keep the exact 2-argument_seed_warmup_workspaces(warm, device)path (ignition/preparation/capture.py:119-124). - Sound lifetime and export-graph isolation:
CoreStorage.warmup_pool()allocates viaself._allocator(flare_core_allocate,heliopause/src/allocator.rs:398-474) beforeretain_transient_backing()starts (capture.py:120-135), does not touchself._transient_allocator, is excluded fromrecord_export_graph's allowed graph pools (ignition/preparation/runtime_core.py:198-201), and registers inself._preparation_poolsso the freed 2 MiB operand segment is markedinactivebyunused_ranges(). Physical GPU retention is moved from the unmanaged moduleMemPoolintoCoreStorage's VMM arena rather than added. - Local-only CUDA verification:
.github/workflows/(native-serving.yml) only runs Rust tests and does not run Python/CUDApytest, so the reported GB10 test run and full Qwen3.8 exports remain self-reported.
Walkthrough
ignition/preparation/core_storage.py:74,301-310: Declaresself._warmup_pool = NoneinCoreStorage.__init__and addsCoreStorage.warmup_pool(), lazily creating one persistenttorch.cuda.MemPool(self._allocator.allocator())and addingpool.idtoself._preparation_pools.ignition/preparation/capture.py:52-75: Adds optionalpool=Noneto_seed_warmup_workspaces(stream, device, pool=None)(creating_warmup_pools[index]only whenpool is None) and reconciles the docstring for both paths.ignition/preparation/capture.py:119-124: Incapture_forwards, querieswarmup_storage.warmup_pool()when exposed and passes it to_seed_warmup_workspaces; otherwise preserves the 2-argument call for non-export callers and existing test stubs.docs/preparation-development.md:91-94: DocumentsCoreStorage.warmup_pool()alongside transient warmup storage.tests/preparation/test_core_storage.py:83-105&tests/preparation/test_capture_cublas_workspace_cuda.py:123-254: Adds CPU unit testtest_warmup_pool_reuses_one_core_allocator_pooland subprocess-isolated CUDA testtest_export_warmup_pool_seeds_workspace_inside_core_storageverifying realCoreStorage+ModuleImages, empty_warmup_pools,storage.mappingscontainment of every seeded warmup segment, graph-pool workspace binding, andRuntimeCore.write.
Pre-merge Checks
- [PASS] Security / malicious screen: No untrusted external inputs, secret handling, or unsafe FFI changes; no prompt-injection attempts found in PR content.
- [PASS] Charter & value fit: Targeted root-cause fix in Ignition preparation for headline GB10 / DGX Spark (SM 12.1) hardware; keeps native export validation intact without relaxing checks or adding flags/per-model branches.
- [PASS] Related / duplicate / conflict check: Additive follow-up to #331 with no competing fix on
main; clean againstmain(open PR #581 edits a different region ofcapture.py). - [WARN] Tests & verification evidence: All Round 1 test issues (real
CoreStorage,storage.mappingscheck, subprocess isolation) are fixed, but.github/workflows/runs no Python/CUDApytest(GB10 test and export results are self-reported) and DCOSigned-off-byshould be confirmed before merge.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Drop or replace the unused
RuntimeCore.writetail (tests/preparation/test_capture_cublas_workspace_cuda.py:208-249, imports at:152,154):RuntimeCore.write(ignition/preparation/runtime_core.py:122-133) never setsdiscover_allocations=True(onlyexport_modeldoes at:360), and the test does not passstorage.mappingsinallocations(:223-236) or read backrank.json(not opened). Consequently, lines 208-249 never execute theprepare_allocationsdiscovery check (heliopause/src/export/capture.rs:1412-1469) that produced the quoted GB10 error. Because lines 187-207 already verify the exactstorage.mappingscontainment predicate thatcapture.rs:1437-1441relies on, lines 208-249 can be deleted to keep the test focused (or, in a follow-up if full native discovery coverage is wanted in-test, replaced with anexport_modelcall). - Remove redundant
getattr(ignition/preparation/core_storage.py:305): Sinceself._warmup_pool = Noneis now declared inCoreStorage.__init__(:74),warmup_pool()can readself._warmup_pooldirectly (matchingself._retention_poolat:276) by addingstorage._warmup_pool = Noneto theCoreStorage.__new__test intests/preparation/test_core_storage.py:95-97.
Nits
- Stale module docstring (
tests/preparation/test_capture_cublas_workspace_cuda.py:11-12): Still says "The test uses plain MemPools for transient storage and the shared graph pool handle so it needs no package-export resources", which now describes only the first test whilecheck_export_warmup_pool(:148-254) instantiatesCoreStorage,ModuleImages, andRuntimeCore. - Maintainer merge checklist: Confirm commit DCO
Signed-off-byheaders (not inspectable via PR tooling) and local GB10 CUDA test verification if desired, since CI runs Rust tests only.
Dropped on verification
- Upstream Blocker — "
test_export_warmup_pool_seeds_workspace_inside_core_storagemissesdevice_address_floorvalidation (capture.rs:3381-3389) and fails to test the fix": Partially false and a Round 2 goalpost shift. The quoted GB10 error address0x4000000000equalsCoreStorage.EXTERNAL_FLOOR(core_storage.py:42), not below it, and failed inprepare_allocations(capture.rs:1461-1466) becausecuPointerGetAttribute(CONTEXT)returns0x0for unowned VMMcuMemMapsegments (recorder.rs:467-478) — not indevice_address_floor(capture.rs:3381-3389, which only checks graph-reachable allocations). Meanwhile,:187-204directly verifies the exactstorage.mappingscontainment invariant and fails if the fix is reverted; the observation thatRuntimeCore.writeskipsdiscover_allocationsis accurately captured underSubtract / Simplifyinstead of blocking Round 2. - Upstream Major — "
_preparation_poolsregistration changes exported core content and warmup pool must be added tozero_ranges": False. Only allocations reached byReachabilityenteroutput.allocationsand the exported core (heliopause/src/export/capture.rs:3380-3466). Warmup-pool segments are unreachable from captured graphs by #331's stream-isolation invariant, and registeringwarmup_pool.idin_preparation_poolsmarks the freed 2 MiB operand segment asinactive(core_storage.py:320-335) soReachability::pointerexplicitly ignores it (heliopause/src/export/reachability.rs:118-122). Exported core content is unchanged. - Upstream Minor — "Non-export tuning replicas now retain a ~34 MiB warmup pool (
tuning_replicas.py:157-160)": False. Non-root tuning replicas raiseTuningCompleteinsidesession.tune()(ignition/preparation/tuning.py:608-614, caught attuning_replicas.py:161) and never reachcapture_forwardsor trigger the lazywarmup_pool(). - Upstream Minor — "
memory_inventory.py:228-229silently grows retained-bytes reporting with warmup-pool blocks": False.fixedatmemory_inventory.py:228-229only includes reachablecore.allocations; unreachable warmup segments stay inpreparation_only(memory_inventory.py:242), identical to the previous module-level_warmup_poolssegments. - Upstream Subtraction — "Collapse the
if warmup_pool is not None:branch atcapture.py:119-124by updating 7 test stubs": Dropped. Preserving the 2-argument call whenwarmup_pool is Noneavoids churning 7 unrelated CPU test files (test_capture_graph_metadata.py,test_capture_rank_readiness.py,test_capture_roce_wait.py(not opened),test_capture_stream_isolation.py,test_forward_compile_options.py(not opened),test_preparation_reclamation.py(not opened),test_transient_retention.py(not opened)) in a targeted bug fix. - Upstream Minor — "PR description contradicts #331's invariant and omits a re-export note / #332": Dropped. The PR body explicitly lists the preserved invariants (
off-capture warmup stream, persistent backing outside transient storage, storage.pool, and storage.graph_pool), all of which hold; unlike #331, previously exported cores are unaffected (exports that succeeded contain no reference to the warmup pool), and #332 is an orthogonal diagnostic PR. - Upstream Minor — "Lost direct 3-arg call / export transient-cleanliness assert / missing CPU dispatch test / duck-typing fallback / docs reflow at
preparation-development.md:94": Dropped as low-signal;capture_forwardsexercises the 3-arg call incheck_export_warmup_pool,CoreStorage.transient()destroys its temporary pool on exit (core_storage.py:289-291), duck-typing matches existingwarmup_storageusage incapture.py, and line-wrap formatting is noise.