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
- Scoped entirely to Ignition preparation: No Rust/Helios, Protobuf, CLI, config, or serving-path changes; existing exported cores retain their recorded
device_address_floor(ignition/preparation/runtime_core.py:428,heliopause/src/export/capture.rs:3417-3425) and load unchanged. - Broadest runtime reach is integrated-GPU export (GA10B and GB10/DGX Spark): While the
EXTERNAL_FLOORraise is scoped strictly to(8, 7)integrated GPUs withdevice_window is None(ignition/preparation/core_storage.py:66-73), the probe capture and per-exported-graphseal_low_window()calls (ignition/preparation/capture.py:173-184,226-227) run on all integrated GPUs including GB10/SM121.seal_low_window()skips held spans inself.low_reservationswith zero driver calls (core_storage.py:175-179), so per-graph re-sealing only probes occupied context granules and introduces no cross-rank coordination hazard. - Minor rebase overlap with open PR #606: #606 (also open, ready to merge) modifies
_seed_warmup_workspacesinignition/preparation/capture.pyand appends tests attests/preparation/test_core_storage.py:83+, so whichever PR lands second will need a small manual rebase.
Walkthrough
ignition/preparation/core_storage.py:66-73: Raises integrated GA10B ((8, 7),device_window is None)EXTERNAL_FLOORfrom0x300000000(12 GiB) to0x900000000(36 GiB), keepingDEVICE_BASE = 0x1200000000(72 GiB) andRESERVATION_BYTES = 48 << 30(48 GiB; total 120 GiB inside the 128 GiB GA10B VMM window).ignition/preparation/capture.py:69-74: Extends_seed_warmup_workspacesto runtorch.addmm(bias, operand, operand, out=out)with a 1Dbf16bias alongsidetorch.mmon the dedicated warmup stream and pool.ignition/preparation/capture.py:173-184,226-227: Whengetattr(warmup_storage, "integrated", False)is true, runs a minimal 1-byteprobe_buf.zero_()CUDA graph capture insidewarmup()(CoreStorage.transient), synchronizes and callswarmup_storage.seal_low_window()before the serving capture loop, and callswarmup_storage.seal_low_window()again after eachrecord_export_graph(...).ignition/components/sampling.py:125-131: RegistersDeviceRequestState.vocab_idsviarecord_numeric_tensor(ids)so export pointer scanning treats the persistentint64index table as numeric data.tests/preparation/test_core_storage.py:83-139&tests/preparation/test_capture_graph_metadata.py:477-568: Adds four CPU unit tests covering the GA10B window layout,vocab_idsnumeric registration,mm+addmmwarmup seeding, and integrated-GPU probe/reseal call ordering.
Pre-merge Checks
- [PASS] Security / malicious screen: No untrusted inputs, secret handling, suspicious FFI/native changes, or prompt-injection attempts in PR content.
- [PASS] Charter & value fit: Keeps fixes in Ignition's preparation layer with zero runtime/Helios bloat or per-model branches; priority contributor (
@lukealonso) addressing concrete GA10B/unified-memory preparation hygiene defects. - [WARN] Related / duplicate / conflict check: No competing fix on
main; open PR #606 edits_seed_warmup_workspaces(capture.py:52-74) and appends totests/preparation/test_core_storage.py:83+, so expect a small textual rebase when the second PR lands. - [WARN] Tests & verification evidence: CPU CI passes and all four new CPU tests fail on
mainand pass onf4851b3, buttest_device_request_state_vocab_ids_records_numeric_tensorhas asys.modulesisolation leak in its dead-in-CI fallback stub; CUDA-device tests and a post-rebase SM87/SM121 GPU export onf4851b3were not run (explicitly disclosed in the PR description, though the description still citesa747a5a5).
Blockers
None.
Should Fix
- 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"belowDEVICE_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)belowDEVICE_BASE—not 24 GiB ending at0xf_0000_0000(60 GiB). Update the comment oncore_storage.py:68-70and the PR description to state36 GiB [0x9_0000_0000, 0x12_0000_0000)(or adjust the constants if 60 GiB was actually intended). - Remove the dead,
sys.modules-leakingflashinferstub intests/preparation/test_core_storage.py:122-128: CI installsflashinfer-python[b12x]viauv sync --extra prepare --extra test(.github/workflows/python-cpu.yml:29(not opened),pyproject.toml:25), and existing CPU tests already importDeviceRequestStatedirectly at module scope (tests/components/test_state_transfer.py:13). Worse, whenflashinferis absent and the stub branch executes,monkeypatch.delitem(sys.modules, "ignition.components.sampling", raising=False)records nothing ifsamplingwas not previously imported, so the subsequentfrom ignition.components.sampling import DeviceRequestStateleaves a stub-poisonedignition.components.samplingmodule (withfilter_probabilities_out = None,probability_filter_workspace = None,sample_probabilities = None) cached insys.modulesafter test teardown. Delete lines 122-128 and importDeviceRequestStatedirectly (and optionally exercise a realtensor_metadata.NumericStorage()context instead of monkeypatchingrecord_numeric_tensor, sinceNumericStorageworks on CPU tensors).
Subtract / Simplify
- Drop redundant
stream.synchronize()andwarmup_storage.seal_low_window()after the probewith warmup():block (ignition/preparation/capture.py:183-184): Whenwarmup_storageis aCoreStorage,warmupis bound towarmup_storage.transient(capture.py:116), whose__exit__(ignition/preparation/core_storage.py:290-296) already runstorch.cuda.synchronize(self.device)unconditionally and—becauseretain_transient_backing()closed atcapture.py:144(shared == False)—runsdel pool,torch.cuda.empty_cache(), andself.seal_low_window(). Lines183-184therefore repeat a sync and a full low-window sweep immediately aftertransient().__exit__()on every integrated-GPU export (both GA10B and GB10). Deletecapture.py:183-184(and updatetest_capture_graph_metadata.py:559-568by having the faketransient()invokeseal_low_window()on exit, matchingCoreStorage.transient()), or document in the comment why a post-transient()sweep is still required (e.g., if an outerretain_transient_backing()caller is supported). - Deduplicate the
ExportGraph+torch.cudamonkeypatch setup intests/preparation/test_capture_graph_metadata.py:527-544: Lines527-544repeattest_capture_forwards_export_sets_node_priority_instantiation_flag(:332-348) nearly verbatim. Extracting a small helper removes ~18 lines of boilerplate.
Nits
ignition/components/sampling.py:127:record_numeric_tensorcan be imported at module scope alongsideignition.preparation.persistentandignition.preparation.scratch(sampling.py:25-26);tensor_metadatahas no import cycle withignition.components.ignition/preparation/capture.py:173: On Windows integrated GPUs (os.name == "nt"),CoreStorage.seal_low_window()returns immediately (core_storage.py:170-171), so gating the probe capture onos.name != "nt"(or a small helper onCoreStorage) avoids an unnecessary probe graph on WDDM.tests/preparation/test_core_storage.py:111-113:assert 0x303000000 < owner.EXTERNAL_FLOOR < owner.DEVICE_BASEis redundant right after pinning both values to literals on:108-109.docs/runtime-core-design.md:113-116: Still says Linux integrated GPUs reserve and reject below 256 GiB without noting the GA10B exception (pre-existing sincec9935887, now 36 GiB).- PR description: Update the test-run commit reference from
a747a5a5to the actual headf4851b3(and if handy, include the observed cuRAND address-collision error/log from the Jetson Orin export for future readers).
Dropped on verification
- Correctness F1 ("Reseal is one graph too late, and
elif retain_graphs:never reseals"): Verified false on both counts. First, the probe capture and seal (capture.py:177-184) close the pre-init low slab before the first serving graph captures, and sealing afterrecord_export_graph(capture.py:225-227) runs afterinstantiate_graph(graph)(runtime_core.py:254,290), resealing any spans reopened by capture or instantiation before the next graph's materialization/capture; moving the seal beforerecord_export_graphwould still run afterfunction()and would miss instantiation-triggered frees. Second,exporting = retain_graphs and warmup_storage is not None(capture.py:202), soelif retain_graphs:(capture.py:228) is only reachable whenwarmup_storage is None—callingwarmup_storage.seal_low_window()there would crash withAttributeError. - Correctness F3 & Dossier #8 ("Sweep cost grew 4× and
test_low_window.pyonly tests a 12 GiB floor"): Verified false.seal_low_window()(core_storage.py:175-189) skips held spans inself.low_reservationsin Python with zero driver calls and halves contiguous free spans, so raisingEXTERNAL_FLOORfrom 12 GiB to 36 GiB adds O(1) driver calls on pass 1 and zero extra driver calls on subsequent sweeps. Moreover,tests/preparation/test_low_window.py:53,73already testsCoreStorage.EXTERNAL_FLOOR = 0x4000000000(256 GiB, not 12 GiB) and bounds re-seal calls strictly by occupied context size (2 * (context[1] // GRANULE) + 50). Hoisting the reseal outside the capture loop (as F3 suggested) would also defeat the fix by leaving reopened spans open during subsequent graph captures. - Subtraction S3 ("Remove
if getattr(warmup_storage, 'integrated', False):atcapture.py:226and dropgetattrat:173"): Verified breaking. Existing test fixtures (tests/preparation/test_capture_graph_metadata.py:325-330,tests/preparation/test_capture_rank_readiness.py:70(not opened),tests/preparation/test_capture_cublas_workspace_cuda.py:60-61) passSimpleNamespacestorage stubs withoutintegratedorseal_low_window(andwarmup_storagecan beNoneat:173), so replacing:226-227with barewarmup_storage.seal_low_window()or:173withwarmup_storage.integratedwould break CI withAttributeError. - Correctness F8 ("
addmmseeding does not pinpreferred_blas_library()"): Verified false._seed_warmup_workspaces's own docstring (capture.py:55-57) explicitly documents that seeding intentionally runs under the ambient BLAS backend because that is the backend warmups use. (F8's side note also misreadtorch.addmm(bias, operand, operand, out=out)as readingout, whereasbiasis the addend.) - Dossier #5 & Value Prop ("
vocab_idshas no in-tree consumer, justify or drop"): Dropped as low-signal/misplaced. PerAGENTS.md:9-13,ignitionis the recipe-free library whose publicignition.componentsAPIs (includingDeviceRequestState.vocab_ids) are consumed by external model recipes inlocal-inference-lab/hyperflare-recipes; registering a persistentint64tensor viarecord_numeric_tensormatchestensor_metadata.live_metadata's contract (tensor_metadata.py:155-156,204-205). - Dossier #7 & Correctness F7 ("
docs/windows.md:226is now contradicted"): Verified false.docs/windows.md:224-228specifically documents explicitCoreStorage(device_window=(base, extent)), which checksbase < self.EXTERNAL_FLOORagainst the unchanged 256 GiB class default (core_storage.py:42,58-63) and skips the(8, 7)branch (device_window is None). - Value Prop / Dossier #6 / F6 ("New tests would pass on unfixed
main"): Verified false. All four new CPU unit tests fail againstmain(whereEXTERNAL_FLOORis0x300000000,vocab_idsdoes not callrecord_numeric_tensor,_seed_warmup_workspacesomitsaddmm, andcapture_forwardsneither probes nor reseals); the real limitation (already disclosed) is simply that CPU unit tests cannot substitute for CUDA-device hardware regression runs. - Upstream hex explanation ("
0xf_0000_0000isDEVICE_BASE - RESERVATION_BYTES"): Corrected.RESERVATION_BYTES = 48 << 30 = 0xc_0000_0000(not0x3_0000_0000), soDEVICE_BASE - RESERVATION_BYTESis0x6_0000_0000(24 GiB), not0xf_0000_0000(60 GiB); the actual band[EXTERNAL_FLOOR, DEVICE_BASE)is[0x9_0000_0000, 0x12_0000_0000)= 36 GiB.