Opened by a workflow run, Nov 29, 2026 11:28 AM EST. decide malicious: all_clear (100%): No malicious content found
explore
Author: avifenesh (FIRST_TIME_CONTRIBUTOR, 0 merged PRs; not a charter-named contributor; Discord avi7066)
Motivation: On unified-memory GPUs (GB10/DGX Spark), the 2 MiB operand segment and 32 MiB cuBLASLt warmup workspace were allocated in a module-level CUDA MemPool outside the preparation storage that the native exporter declares, and export validation then rejected the unowned segment. The author gives CoreStorage its own persistent warmup pool so the seed lands inside declared core mappings.
Scale: +101 / −5 lines in 4 files (23 lines of production code).
Proposal:
CoreStorage.warmup_pool(): lazily one persistenttorch.cuda.MemPool(self._allocator.allocator()), id added to_preparation_pools(core_storage.py:300-309)._seed_warmup_workspaces(stream, device, pool=None); the module-level_warmup_poolspath now only runs when no pool is passed (capture.py:52,67-70).capture_forwardspasseswarmup_storage.warmup_pool()when present, else keeps the exact 2-argument call (capture.py:118-122).- Rewrites the seed docstring to allow the seed to live in an export pool (
capture.py:53-63). - Adds one CPU unit test and one GPU-gated test. Touches:
ignition/preparation/core_storage.py(new persistent pool; changes exportinactive/zero_rangescontent)ignition/preparation/capture.py(warmup seed path used by export and bench)tests/preparation/(two new tests) Related items:- #331 Isolate cuBLAS warmup workspaces from CUDA graph capture (merged): introduced the code being changed; its stated invariant placed the seed outside
CoreStorage's pool — partially reversed here - #266 First captured graph keeps a transient cuBLAS split-K workspace (open, P1): the real GB10 defect in this area; not referenced or re-tested
- #332 Report unresolved kernel argument address candidates during export (open): the export-time detection for this class; not mentioned
- #581 ignition: add opt-in --use-node-priority flag (open): edits the same
capture.py - #395 CUDAGraph.reset() frees the shared stream workspace (open): co-located lifetime constraint, untouched
Link: https://github.com/NVIDIA/hyperflare-inference/pull/606
Autobot comments: The description's central claim — that both allocations "stay inside declared core mappings" — has no test behind it: the new GPU test uses a plain
torch.cuda.MemPooland aSimpleNamespaceinstead of a realCoreStorage, the same gap yatesdr blocked #331 over. No issue, log, error text or reproduction command is linked for the GB10 export failure. Registering the pool in_preparation_poolsalso changes exported byte content viaunused_ranges()→inactive/zero_ranges(runtime_core.py:300-301), which the description does not mention, and in the export path the old module pool is no longer created at all. The change also partially reverses #331's deliberate "outside any caller-owned pool" invariant without citing #331, leavesdocs/preparation-development.md:88-91stale, and says nothing about whether previously exported cores need a re-export (a note #331's reviewer required). Zero comments, zero reviews, no CI checks on the head commit.
Classify intake
Selected: triage:review, bug, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 75.9% -
triage:design-review: 19.2% -
triage:validation: 4.3% -
triage:investigate: 0.5% -
none: 0.1% -
triage:integration: 0.1% -
triage:partial: 0.0% -
triage:verify-for-closure: 0.0% -
triage:superseded: 0.0%
Priority
-
none: 97.3% -
priority:P1: 1.8% -
priority:P2: 1.0%
Type
- [✓]
bug: 67.9% -
performance: 62.2% -
community: 43.8% -
duplicate: 1.4% -
enhancement: 0.7% -
documentation: 0.0%
Area
- [✓]
area:preparation: 93.2% -
area:memory: 62.2% -
area:rocenante: 2.6% -
area:selene: 1.4% -
area:caching: 0.6% -
area:kernels: 0.5% -
area:engram: 0.5% -
area:scheduling: 0.4% -
area:orbit: 0.3% -
area:packaging: 0.3% -
area:api: 0.2%
Model
-
model:deepseek-v4: 1.6% -
model:deepseek-v4.1: 1.6% -
model:qwen3.8-flash-next: 1.1% -
model:kimi-k3.1: 0.2% -
model:qwen3.8-27b: 0.2% -
model:glm-5.3: 0.2% -
model:muse-glimmer: 0.2% -
model:nemotron-3.5-bolt: 0.1% -
model:inkling-small: 0.1% -
model:mimo-v2.6: 0.1% -
model:gemma4: 0.0%
Apply Labels (Intake)
Applied: +triage:review, +bug, +area:preparation
Value Proposition
Value Proposition — PR #606 (seed warmup workspaces inside export storage pool)
Charter alignment. In scope: GB10/DGX Spark (SM 12.1) is a charter-named target, and the fix keeps native export validation intact rather than relaxing it, adding no flag, default, or per-model branch — 23 production lines, consistent with "keep the runtime small and model-agnostic." It does not cross the recipes/runtime ownership line. Two frictions: it partially reverses the invariant merged one week earlier in #331 ("outside … caller-owned pools such as CoreStorage's") without citing it, and it silently shifts exported content, since registering the pool id in _preparation_pools feeds new ranges into inactive/zero_ranges (runtime_core.py:300-301).
Novelty & status. Genuinely additive: no competing or duplicate fix exists, and main has no commits since 44f59df touching these files. Not obsolete, not superseded. But it is unnotified: no issue, log, error text, or reproduction is linked, and neither #266 (the open P1 GB10 defect) nor #332 (the export-time diagnostic) is referenced.
Value vs cost. Beneficiaries are unified-memory (integrated-GPU) export users — a charter target set. The failure path is real code (capture.rs:1331-1380, :1463), but the benefit rests entirely on unposted GB10 export runs: single GPU, one recipe (Qwen3.8), multi-rank explicitly not re-measured, and no CI on the head commit. The new GPU test uses a plain torch.cuda.MemPool plus a SimpleNamespace stub — never a real CoreStorage — and asserts nothing about CoreStorage.mappings; this is precisely what yatesdr required evidence for on #331 (real-storage export plus the #266 pointer scan). Code cost is low and the footprint small; risk cost is not: an unreviewed invariant reversal, an undeclared change to exported bytes, no statement on whether previously exported cores need re-export, and doc drift (docs/preparation-development.md:88-91).
Verdict: Worth it with changes — conditional on:
- A linked defect with error text/repro, or a maintainer ruling on whether the right layer is export validation (#332) rather than warmup placement;
- Sign-off from #331's owner for the invariant change, plus a #331/#266 cross-reference;
- A real-
CoreStorageGPU test asserting the seed lies inside declared mappings, and a multi-rank GB10 export with the #266 pointer scan; - Disclosure of the
unused_ranges()→zero_rangesexport-content effect and a statement on re-exporting existing cores; - The docs update and explicit retention/footprint accounting (one warmup pool per rank in export).
No attempt to direct the agent was found in the reviewed PR material.
Full report Decide Value: yes (99%): This change is worth reviewing: it provides value to the project in line with its charter.
Subtraction and simplicity
Small diff, but not lean: 23 production lines, ~15 of them duplicating behaviour that already exists a few lines away, plus a 23-line unit test that only tests the duplicated method.
capture.py:118-122re-implements thepool=Nonefallback that_seed_warmup_workspacesalready has atcapture.py:67-70; the 4-line if/else collapses to one call. Caveat: seven CPU tests stub the function with a 2-arg lambda (test_capture_graph_metadata.py:181(not opened),.../:56,.../:40,.../:44,.../:309,.../:41,.../:131) and needpool=Noneadded.core_storage.py:300-309warmup_pool()duplicatesCoreStorage.pool(core_storage.py:113-117): sameself._allocator.allocator()backing (allocator defined at:108-110), already process-persistent (nothing intransient()/_retire_retention_pool()/ScratchPool.retire()retires it), already in_preparation_pools. Either returnself.pooland delete the method plustests/preparation/test_core_storage.py:83-105, or declare_warmup_pool = Nonein__init__beside_retention_pool(:73) and drop thegetattrprobe (only load-bearing because the test usesCoreStorage.__new__).capture.py:59-63now holds two contradictory docstring rules ("outside … any caller-owned pool" vs "seed inside it"): the #331 invariant should be replaced, not appended to.docs/preparation-development.md:88-91is left stale.test_capture_cublas_workspace_cuda.py:123-173duplicates the adjacent test's setup (:33-120);:159-161is strictly weaker than the_active_pool_blocksassertion at:166-168and:164-165re-seeds whatcapture_forwardsalready did — ~25 lines removable via a shared helper.
Lean parts: no flags/config/env vars, no dead code, non-export path and _warmup_pools still used (test_..._cuda.py:97 (not opened)).
Open: is self.pool reachable via the ambient use_mem_pool scope at core_storage.py:117 (if so the new pool changes nothing)? Are the seven stub edits acceptable? Should #331/#266 record the reversed invariant?
Correctness and contracts
Reviewed PR #606 (head 2535841) for correctness, contracts and system-level consequences, reading both changed files, the export/validation contract in heliopause, the callers, tests and docs. Seven findings.
- Major — the stated failure mechanism is not the code path named:
heliopause/src/export/capture.rs:1437-1466only validates recorded device allocations not already covered by a declared mapping, viacuPointerGetAttributekind/context, which passes in-process; unreferenced segments are omitted (:3472), not rejected. The only rule that could fire is the address floor (:3385). No error text or issue is given, so the fix cannot be tied to the defect. - Major — undeclared export-metadata change: registering the pool in
_preparation_pools(core_storage.py:308) makesunused_ranges()(:324-331) report its padding, which reaches bothinactiveandzero_ranges(runtime_core.py:300-301) and then splits declared mappings (capture.rs:1471-1490), boundslive_metadataand relabels inventory (memory_inventory.py:208-210). Payload is not inflated (norootsare passed,runtime_core.py:354-370), but the metadata delta is undocumented and untested. - Major — tests cannot prove the claim:
tests/preparation/test_capture_cublas_workspace_cuda.py:138-143uses a plainMemPoolbehind aSimpleNamespace(no realCoreStorage, no mapping assertion), and:159-161passes on the operand plusempty_likealone (capture.py:72-73). - Major (contract) — the docstring at
capture.py:57-63keeps #331's "outside … any caller-owned pool" while seeding inside one;AGENTS.md:201-207requires a maintainer decision, and #331/#266 are uncited. - Minor —
warmup_pool()is called with no device context (capture.py:118,core_storage.py:306), unlike the previous construction insidewith torch.cuda.device(device). - Minor — unsynchronized
getattrlazy init (core_storage.py:304-308), attribute not declared in__init__(contrast:73). - Minor —
docs/preparation-development.md:88-91still describes warmups as transient-only.
Found sound: non-export path unchanged (2-arg call, module pool, existing assertions), floor/alignment interactions, multi-rank independence.
Open: which native check fired; whether pre-change cores need re-export; whether reversing #331's invariant is approved; why lazy getattr rather than an __init__ field.
Final review
Recommendation: Changes Requested
The core production fix (ignition/preparation/core_storage.py:300-309 and ignition/preparation/capture.py:52-74, 118-122) is technically sound and addresses a real native-export failure path: prepare_allocations (heliopause/src/export/capture.rs:1426-1468, invoked at :2894 before reachability) rejects undeclared cuMemMap / VMM device segments whose cuPointerGetAttribute(CU_POINTER_ATTRIBUTE_CONTEXT) returns 0x0, and a dedicated CoreStorage.warmup_pool() keeps warmup segments inside CoreStorage.mappings while remaining disjoint from storage.pool and storage.graph_pool. However, the new CUDA test (tests/preparation/test_capture_cublas_workspace_cuda.py:123-173) introduces order-dependent global _warmup_streams[0] / cuBLASLt cache pollution with the existing test and uses a plain MemPool + SimpleNamespace stub that never tests CoreStorage or declared core mappings; fixing that test, reconciling the contradictory docstring in capture.py:59-63, and posting the failing native error string / #331 cross-references are needed before merge.
Merge Risk
Level: Low
- Narrow production footprint: 23 production lines across
ignition/preparation/core_storage.pyandignition/preparation/capture.py; no CLI flags, config defaults, serving hot-path changes, or per-model branches. Non-export capture preserves the exact 2-argument_seed_warmup_workspaces(warm, device)path (capture.py:122). - Safe isolation and retention behavior:
CoreStorage.warmup_pool()allocates disjoint VMM segments fromself._allocator(avoiding co-location with live tensors instorage.poolthat could bloat exported cores by 32 MiB/rank), registers in_preparation_poolsso the freed 2 MiB operand segment is marked inactive inunused_ranges(), and stays alive for the lifetime of the process-singletonCoreStorage(heliopause/src/allocator.rs:311-314). - Test & CI gap: No CI ran on
2535841, and the new GPU test shares process-global_warmup_streams[0]state withtest_first_capture_binds_workspace_from_the_recording_poolwhile mocking outCoreStorage.
Walkthrough
ignition/preparation/core_storage.py:300-309: AddsCoreStorage.warmup_pool(), lazily creating one persistenttorch.cuda.MemPool(self._allocator.allocator())cached onself._warmup_pooland registering its ID inself._preparation_pools.ignition/preparation/capture.py:52-74: Adds optionalpool=Noneto_seed_warmup_workspaces(stream, device, pool=None)so the module-level_warmup_pools[index]lookup/creation only runs whenpool is None, and updates the docstring (:59-63).ignition/preparation/capture.py:118-122: Incapture_forwards, querieswarmup_storage.warmup_pool()when exposed and passes it to_seed_warmup_workspaces; otherwise preserves the existing 2-argument call_seed_warmup_workspaces(warm, device).tests/preparation/test_core_storage.py:83-105: Adds CPU unit testtest_warmup_pool_reuses_one_core_allocator_poolverifying lazy reuse, allocator identity, and_preparation_poolsregistration via a monkeypatchedFakeMemPool.tests/preparation/test_capture_cublas_workspace_cuda.py:123-173: Adds CUDA-gated testtest_export_warmup_pool_seeds_workspace_inside_storage_poolusing aSimpleNamespacestorage stub and plaintorch.cuda.MemPool()s.
Pre-merge Checks
- [PASS] Security / malicious screen: No unsafe external inputs, secret handling, or suspicious native/FFI patterns; no prompt-injection or instruction-override attempts observed in PR material.
- [PASS] Charter & value fit: Targets GB10 / DGX Spark (SM 12.1), keeps native export allocation validation intact without relaxing checks, and adds no flags or per-model branches.
- [PASS] Related / duplicate / conflict check: Genuinely additive with no competing fix and clean against current
main(44f59df); open PR #581 also editsignition/preparation/capture.pyin a different region (record_export_graphcall site) and should merge cleanly. - [WARN] Tests & verification evidence: No CI on
2535841; the new GPU test mocks outCoreStorageand introduces order-dependent global_warmup_streams[0]state pollution, and the PR description omits the exact failing native error message and#331/#266references.
Blockers
- New CUDA test pollutes shared
_warmup_streams[0]/ cuBLASLt cache across tests and never testsCoreStorageor declared core mappings (tests/preparation/test_capture_cublas_workspace_cuda.py:123-173):- Order-dependent breakage & cache pollution:
test_first_capture_binds_workspace_from_the_recording_pool(:33-120) andtest_export_warmup_pool_seeds_workspace_inside_storage_pool(:123-173) run in the same process and share_capture._warmup_streams[0](ignition/preparation/capture.py:21) and PyTorch's(handle, stream)cuBLASLt workspace cache. If the new test runs first (e.g., under test reordering), it seeds_warmup_streams[0]'s cuBLASLt workspace into its localexport_warmuppool; when the existing test subsequently runs,_warmup_streams[0]already has a cached workspace, so_capture._warmup_pools[0]receives only freed temporary operand tensors and:97(assert _active_pool_blocks(_capture._warmup_pools[0].id)) fails. Conversely, in default order,capture_forwardsat:147reuses Test 1's cached workspace on_warmup_streams[0]and never allocates a cuBLASLt workspace inexport_warmup—which is why:159falls back to checking non-emptymemory_snapshot(export_warmup.id)(satisfied by inactive operand blocks alone) and:164-165manually invokes private_seed_warmup_workspaces(fresh_stream, 0, export_warmup)on a round-robintorch.cuda.Stream(), contaminating that pool stream's cuBLASLt cache with a test-local pool. - Missing
CoreStorage/ mapping verification::138-143uses a plaintorch.cuda.MemPool()inside aSimpleNamespacestub. It never instantiatesCoreStorage, never callsCoreStorage.warmup_pool(), never verifies that seeded segments fall insideCoreStorage.mappings, and never exercisesModuleImages/ native export (AGENTS.md:194-199). - Fix: Run the export warmup test in an isolated subprocess (matching
tests/preparation/test_recorded_export_graph_cuda.py:15-20, which avoids both the process-singletonCoreStoragearena conflict inheliopause/src/allocator.rs:312and_warmup_streams[0]cache contamination). Inside the subprocess, openModuleImages()and a realCoreStorage(), callcapture_forwards(..., warmup_storage=storage, pool=storage.graph_pool.id, retain_graphs=True, compile_decoder=False), and assert: (a)_active_pool_blocks(storage.warmup_pool().id)is non-empty directly fromcapture_forwards(dropping the private_seed_warmup_workspaces(fresh_stream, ...)workaround), (b) every segment instorage.warmup_pool().idis covered bystorage.mappings, and (c) no warmup allocation recorded byimagesfalls outsidestorage.mappings.
- Order-dependent breakage & cache pollution:
Should Fix
- Self-contradictory docstring in
_seed_warmup_workspaces(ignition/preparation/capture.py:59-63):- Lines 59–61 retain
#331's wording ("outside transient storage, any caller-owned pool, and the exported graph pool"), immediately followed by lines 61–63 ("When an export storage supplies a persistent warmup pool, seed inside it so the allocation stays within declared core mappings"). - Fix: Rewrite
:59-63into one coherent statement explaining that the seed lives in a dedicated persistent pool outside transient storage, caller-owned model storage (storage.pool), and the exported graph pool—using the export storage's dedicatedwarmup_pool()when supplied so its disjoint segments remain within declared core mappings and are omitted as unreachable at export time.
- Lines 59–61 retain
- Document the exact failing native error,
#331/#266references, and retention/re-export impact in the PR description:- The description asserts native export rejection on GB10 (
spark-b23d) without quoting the exact error string (e.g.,external allocation ... is not device memory in the serving context (...)fromheliopause/src/export/capture.rs:1463) or reproduction command (AGENTS.md:165-169). - It modifies the design introduced by
#331(Refs #266) without referencing either item, and omits both the memory-accounting shift (in export processes, the ~34 MiB warmup pool moves from module-level_warmup_poolsintoCoreStorage's fixed address window rather than allocating both) and the compatibility note (previously exported cores do not need re-export because affected exports failed prior to writing a core). - Fix: Add the failing GB10 error message and command, cite
#331/#266, and note the memory-ownership shift and existing-core status in the PR description.
- The description asserts native export rejection on GB10 (
Subtract / Simplify
- Collapse the caller-side
if/elseincapture_forwards(ignition/preparation/capture.py:118-122):_seed_warmup_workspaces(stream, device, pool=None)already handlespool is None(capture.py:67-70), so:118-122duplicates that fallback solely to keep the 2-argument call signature for seven CPU test stubs (tests/preparation/test_capture_graph_metadata.py:181(not opened),test_capture_rank_readiness.py:56(not opened),test_capture_roce_wait.py:40(not opened),test_capture_stream_isolation.py:44,test_forward_compile_options.py:309(not opened),test_preparation_reclamation.py:41(not opened),test_transient_retention.py:131(not opened)). Either collapse:118-122to_seed_warmup_workspaces(warm, device, warmup_storage.warmup_pool() if hasattr(warmup_storage, "warmup_pool") else None)and addpool=Noneto those seven lambdas, or add a brief inline comment if keeping the 2-argument form to avoid touching those test files is intentional.
- Remove duplicated setup and redundant assertions in
tests/preparation/test_capture_cublas_workspace_cuda.py:123-173:- Replacing the stubbed test with the isolated real-
CoreStoragesubprocess test (Blocker 1) removes both the duplicatedSimpleNamespace/tensor scaffold and the weakermemory_snapshot(...)+ private_seed_warmup_workspaces(fresh_stream, ...)pair (:159-168).
- Replacing the stubbed test with the isolated real-
Nits
- Declare
self._warmup_pool = NoneinCoreStorage.__init__(ignition/preparation/core_storage.py:72-73, 304): Place it besideself._retention_pool = Noneat:73for consistency with the class's other lazy pool fields (getattr(self, "_warmup_pool", None)can remain forCoreStorage.__new__-based unit tests, matching_persistent_arenaat:332). - Update
docs/preparation-development.md:88-91: Add one clause noting that cuBLAS warmup workspaces are seeded intoCoreStorage.warmup_pool()inside declared core mappings (AGENTS.md:226).
Dropped on verification
- Correctness F1 ("Claimed native-export rejection is not
capture.rs:1437-1466; in-processcuPointerGetAttributepasses trivially and unreferenced segments are omitted at:3472; only floor rule:3385could fire"): Dropped as false.prepare_allocations(heliopause/src/export/capture.rs:1426-1468) is called at:2894beforeReachability(:3182) and omission (:3472), so unreferenced external segments are validated—not omitted—before:1461. CUPTI recordscuMemMapsegments as"device"allocations (heliopause/src/export/recorder.rs:467-478), and CUDA VMM allocations returncontext = 0x0fromcuPointerGetAttribute(CU_POINTER_ATTRIBUTE_CONTEXT)even in-process (confirmed in#154), triggering:1461-1466whenever a VMM-backedMemPoolsegment lies outsidestorage.mappings. (Only the valid request to quote the exact failing error string is kept under Should Fix.) - Correctness F2 ("Registering
pool.idin_preparation_poolscauses undeclared exported core metadata shifts, extralive_piecessplits, and relabeled memory-inventory rows"): Dropped as false/overstated._warmup_poolowns disjoint VMM segments, sounused_ranges()never splitsstorage.poolorstorage.graph_poolallocations; unreferenced warmup segments are omitted fromoutput.allocations(capture.rs:3472);ignition/preparation/memory_inventory.py:198-210inspectstorch.cuda.memory_snapshotacross all device segments directly without consulting_preparation_pools; and addingpool.idto_preparation_poolsmatchesself.pool,transient,scratch_pool, andPackedWeightswhile preventing false-positive retention of the freed 2 MiB operand segment (heliopause/src/export/reachability.rs:119-122). - Subtraction S2(a) ("
CoreStorage.warmup_pool()duplicatesCoreStorage.pool(core_storage.py:113-117); delete it and reusewarmup_storage.pool"): Dropped as unsafe.storage.poolholds live model buffers/weights/metadata; placing the 32 MiBactive_allocatedcuBLASLt warmup workspace instorage.poolallows it to share a VMM segment with graph-reachable tensors, causing export reachability to retain and download 32 MiB of warmup workspace per rank (unused_ranges()only excludesinactiveblocks and padding, notactive_allocatedblocks). A separateMemPoolis necessary so warmup segments stay disjoint and omitted at export time. - Correctness F5 ("Pool construction at
capture.py:118/core_storage.py:306lefttorch.cuda.device(device)scope anduse_mem_poolomitsdevice="): Dropped as false.torch.cuda.MemPool(allocator)does not bind to a device at construction (matchingcore_storage.py:113, 114, 277, 281, 563andpacked_weights.py:30), andcapture.py:71enterstorch.cuda.device(index)left-to-right beforetorch.cuda.use_mem_pool(pool). - Correctness F6 ("Unsynchronized lazy init of
_warmup_poolcreates a concurrency race on concurrentcapture_forwardscalls"): Dropped as speculative. Same-device preparation is explicitly single-threaded per rank process (heliopause/src/allocator.rs:311-314,#331Limitations); all other lazyCoreStoragestate (_retention_pool,_persistent_arena,_device_cursor,_host_cursor) and module-level_warmup_streams/_warmup_poolsare likewise unsynchronized. (Only the__init__declaration consistency note is kept as a Nit.) - Correctness F4's framing as a blocking architectural invariant reversal of
#331: Narrowed to Should Fix.#331's safety invariants (off-capture warmup stream, persistent warmup workspace backing separate from transient storage,storage.pool, andstorage.graph_pool) remain intact; only the docstring contradiction incapture.py:59-63and missing#331/#266references need cleanup.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 99.9% -
triage:validation: 0.0% -
triage:design-review: 0.0% -
triage:integration: 0.0% -
triage:investigate: 0.0% -
none: 0.0% -
triage:verify-for-closure: 0.0% -
triage:partial: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes Decision to Test: no (99%): Testing will not add significant value as the code stands today. The code is either not yet ready to merge, or adequate testing has already been done to validate the contents of the code, or the available hardware is not suitable to test with. decide malicious: all_clear (100%): No malicious content found
explore
Author: avifenesh (FIRST_TIME_CONTRIBUTOR, 0 merged PRs; not a charter-named contributor; Discord avi7066)
Motivation: On unified-memory GPUs (GB10/DGX Spark) the cuBLAS warmup tensor was allocated from the default allocator, so the native exporter rejected it with "not device memory in the serving context". The fix makes export seeding use a pool owned by CoreStorage, so the allocation lands inside declared core mappings.
Scale: +191 / −8 lines in 5 files
Proposal:
- New
CoreStorage.warmup_pool(): one persistenttorch.cuda.MemPool(self._allocator.allocator()), id registered in_preparation_pools(core_storage.py:301-310). _seed_warmup_workspacesgainspool=None; the module-level_warmup_poolspath now only runs when no pool is passed (capture.py:52-71).capture_forwardsduck-typeswarmup_storage.warmup_pool()and passes it, keeping the 2-arg call otherwise (capture.py:117-124).- New subprocess GPU test against real
CoreStorage+ModuleImages, asserting no module pool, segment containment instorage.mappings, workspace bound instorage.graph_pool, then aRuntimeCore.writeexport (tests/preparation/test_capture_cublas_workspace_cuda.py:123-254). - CPU unit test for pool reuse/id registration; docs updated (docs/preparation-development.md:92-94). Touches:
- ignition/preparation/core_storage.py (pool ownership,
_preparation_pools→ exported content) - ignition/preparation/capture.py (warmup seeding branch; near #581)
- tests/preparation/test_capture_cublas_workspace_cuda.py (rewritten GPU test) Related items:
- #331 Isolate cuBLAS warmup workspaces from CUDA graph capture (merged): introduces the code and the "outside any caller-owned pool" invariant this PR reverses
- #266 (open, P1): first-capture cuBLAS workspace defect on 4× GB10; referenced, not tested
- #332 (open): export-time detection of unresolved pointers; would make this class self-detecting, unmentioned
- #581 (open): also edits capture.py — most likely textual conflict
- #605 (open): same author's other PR
Link: https://github.com/NVIDIA/hyperflare-inference/pull/606
Autobot comments: Amendments only (head 8c1a28a). Retracted: docstring contradiction, doc drift, "test mocks CoreStorage", undeclared
_warmup_pool, shared-state pollution, missing error text/#331/#266 — all fixed. Still a blocker: the new test exports throughRuntimeCore.write, which never setsdiscover_allocations(runtime_core.py:108-133; onlyexport_modelsets it at :360) and leavesdevice_address_floorat 0 (:98 vs :364), so neither export validation the fix targets actually runs; the export-path transient-cleanliness and direct third-argument asserts were also dropped. Undeclared in the description: registering the new pool id in_preparation_poolschanges exportedinactive/zero_ranges(core_storage.py:320-335 → runtime_core.py:298-301), untested; the warmup block is active and not marked content-free; the earlier "avoids 32 MiB/rank of bloat" claim is unproven. Still missing: a note on whether previously exported cores need a re-export (required on #331), and the claim that all of #331's invariants survive. CI structurally cannot run these tests (.github has no pytest job;FLARE_RUN_CUDA_TESTSabsent), so GB10 evidence is local-only. Zero human reviews; only the author's own reply.
Value Proposition
Value Proposition — PR #606 (fix(ignition): seed warmup workspaces inside export storage pool)
Charter alignment — good. The change is a targeted fix inside the Ignition preparation layer (ignition/preparation/core_storage.py, capture.py), not a per-model branch in Helios, so it respects "keep the runtime small and model-agnostic." It fixes a root cause rather than swallowing/retrying an error (#397), and it benefits exactly the charter's headline hardware: native runtime-core export on unified-memory GB10 / DGX Spark (SM121). No non-goals are touched (no new backends, aliases, or orchestration).
Novelty & status — additive, neither obsolete nor superseded. The dossier finds no merged fix on main, no competing open PR, and no linked issue. The failure is quoted verbatim, and the mechanistic reading corroborates it: 0x4000000000 is CoreStorage.EXTERNAL_FLOOR (core_storage.py:42), +2097152 is the 2 MiB pool segment (not the 1 MiB of requested tensor bytes), and context 0x0 means the pointer was not a valid allocation in the serving context — consistent with a default-allocator segment. The core-allocator replacement lands inside declared device-N mappings that discovery skips (capture.rs:1437-1442). This is a genuine follow-up to #331/#266, not duplication.
Value vs. maintenance cost — real benefit, modest cost, weak proof. Production delta is small: self._warmup_pool = None declared in __init__, a warmup_pool() mirroring existing scratch_pool(), and a duck-typed optional argument in capture_forwards; retention is moved, not added. The real cost is evidentiary:
- The rewritten GPU test exports through
RuntimeCore.write, which never setsdiscover_allocations, and leavesdevice_address_floorat0— so neither native validation the fix targets executes; the claim is asserted only at the Python level. - The new pool id in
_preparation_poolsflows throughunused_ranges()intoinactive/zero_rangesinexport_model, i.e. it can change exported content; untested and undeclared. The earlier "avoids 32 MiB/rank bloat" claim is not established. - No re-export note; the body claims #331's caller-owned-pool invariant is preserved when it reverses exactly that invariant.
.github/workflows/runs no pytest, so "36 passed, 1 skipped" remains self-reported.
Verdict: Worth it with changes. Route the test through export_model (or teach write the floor/flag) so the real validations run, restore the dropped transient/direct-branch asserts, declare and cheaply handle the new pool's export-content effect, and add the re-export note.
(No attempts to direct the reviewing agent were found in the PR text or dossier.)
Full report Decide Value: yes (100%): This change is worth reviewing: it provides value to the project in line with its charter.
Classify intake
Selected: triage:review, priority:P2, bug, area:preparation
Threshold: 65%
Triage
- [✓]
triage:review: 99.9% -
triage:design-review: 0.0% -
none: 0.0% -
triage:validation: 0.0% -
triage:investigate: 0.0% -
triage:integration: 0.0% -
triage:partial: 0.0% -
triage:superseded: 0.0% -
triage:verify-for-closure: 0.0%
Priority
- [✓]
priority:P2: 72.9% -
none: 18.4% -
priority:P1: 8.7%
Type
- [✓]
bug: 79.8% -
performance: 50.0% -
community: 16.5% -
duplicate: 8.5% -
enhancement: 0.5% -
documentation: 0.0%
Area
- [✓]
area:preparation: 95.8% -
area:memory: 46.9% -
area:packaging: 1.4% -
area:engram: 0.9% -
area:orbit: 0.2% -
area:selene: 0.2% -
area:api: 0.2% -
area:scheduling: 0.1% -
area:caching: 0.1% -
area:kernels: 0.1% -
area:rocenante: 0.0%
Model
-
model:qwen3.8-flash-next: 2.3% -
model:deepseek-v4.1: 0.5% -
model:nemotron-3.5-bolt: 0.3% -
model:inkling-small: 0.2% -
model:glm-5.3: 0.2% -
model:deepseek-v4: 0.1% -
model:mimo-v2.6: 0.1% -
model:qwen3.8-27b: 0.1% -
model:kimi-k3.1: 0.1% -
model:muse-glimmer: 0.1% -
model:gemma4: 0.1%
Apply Labels (Intake)
Applied: +priority:P2
Subtraction and simplicity
Subtraction/Simplicity/Conventions lens done on PR #606 (5 changed files read in full; repo helpers, AGENTS.md, and all _seed_warmup_workspaces / _preparation_pools call sites checked). Findings saved to scratchpad entry 1 with verbatim quotes and line citations.
The production diff is genuinely lean (+12/−0 in core_storage.py, +16/−7 in capture.py): no new flags, config knobs, or wrappers; warmup_pool() mirrors scratch_pool(); the module-pool fallback is still live for bench/gather callers. Most of the removable mass is in the 134-line new GPU test.
Five suggestions, ranked: (1) delete tests/preparation/test_capture_cublas_workspace_cuda.py:208-249 — 42 lines whose package/rank.json (not opened) output is never read and which duplicate test_recorded_export_graph_cuda.py:66-83; this also removes three imports and drops the file back to its narrow scope; if native coverage is truly wanted, replace the helper with one export_model(...) call instead. (2) Drop getattr(self, "_warmup_pool", None) at core_storage.py:305 — the PR declares the attribute two lines-set earlier at :74, and sibling pools read declared fields directly; add one storage._warmup_pool = None line to the CPU test instead. (3) Collapse the 6-line if warmup_pool is not None: ... else: ... branch at capture.py:119-124 into one call, since pool=None already means the module pool; the branch exists only for seven 2-arg lambda stream, device: None test stubs, so widen those instead. (4) The self._preparation_pools.add(pool.id) at core_storage.py:309 is the only line whose effect leaves the warmup path (unused_ranges() → inactive/zero_ranges → exported content); author should either drop it or add the missing unused_ranges() assertion. (5) Rewrite the stale test module docstring (:4-13) that still claims the file needs no package-export resources. Docs reflow at docs/preparation-development.md:94 noted as optional prose-only.
I did not re-raise the correctness blockers (the test's missing discover_allocations/device_address_floor coverage); per the lens rules I framed that as "delete rather than patch" where it applies.
Correctness and contracts
Verdict: Changes Requested — 1 Blocker, 1 Major, 3 Minor. The production diff is small and, where I could check it, behaviourally consistent; the problem is that its evidence does not exercise the code path it claims to fix, and it has one unasserted effect on exported core content.
Blocker: the new "export" CUDA test cannot reach either native validation the fix targets. It hand-builds RuntimeCore and calls write (tests/preparation/test_capture_cublas_workspace_cuda.py:237-249), but write's request never sets discover_allocations (runtime_core.py:122-133; only setter is export_model, runtime_core.py:360), so the discovery/context rejection is skipped (capture.rs:1412-1414, error text 1461-1466); and device_address_floor stays at the constructor default 0 (runtime_core.py:97-98) instead of storage.EXTERNAL_FLOOR if storage.integrated else 0 (runtime_core.py:364), so the below-floor rejection (capture.rs:3381-3389) can never fire. The Python-level asserts (:187-205) are real but are not the native check that produced the quoted error.
Major: registering the new pool id (core_storage.py:309) makes unused_ranges() (core_storage.py:320-335) feed inactive/zero_ranges (runtime_core.py:296-301 → capture.rs:1471-1490); graph-pool segments are declared content-free, the active warmup segment is not — untested, and probably harmless only because it is unreachable.
Minor: a persistent ~34 MiB core-window segment is now created for every CoreStorage capture including non-export tuning replicas (capture.py:117-124, tuning_replicas.py:157-160), with no memory_inventory line item (memory_inventory.py:198-210); the body claims #331's "outside any caller-owned pool" invariant is preserved while capture.py:59-64 says the opposite, and never says whether earlier cores need a re-export; the export-path transient-cleanliness assert was dropped and the test module docstring (:11-12) is now stale.
Open: does the test pass on an integrated host with a non-zero floor? Are warmup bytes actually exported? Do previously exported cores need re-export? Is relocation the right layer versus #332-style diagnostics?
Final review
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.
Full report Decision to Test: yes (75%): Testing will add considerable value with the code. It is ready to merge and the tests will validate and improve confidence on hardware we have available for testing.
Classify triage
Selected: triage:review
Threshold: 65%
Triage
- [✓]
triage:review: 94.7% -
triage:validation: 4.7% -
none: 0.4% -
triage:design-review: 0.1% -
triage:partial: 0.0% -
triage:investigate: 0.0% -
triage:verify-for-closure: 0.0% -
triage:integration: 0.0% -
triage:superseded: 0.0%
Apply labels
No label changes
Pre Test Report
Hardware Test Plan — PR #606 (fix(ignition): seed warmup workspaces inside export storage pool)
Bottom line first
Recommendation: yes to a hardware test, but a small, sharply-scoped one on cn7 only, and it must not start with the PR's own test.
- PR #606 is a correctness fix, not a performance change (+12/−0
ignition/preparation/core_storage.py, +16/−7ignition/preparation/capture.py). There is no speedup to measure; the only quantitative deltas are retained bytes. Do not budget anyignition bench/flare runbenchmarking time for this PR. - The defect path is unified-memory-only, so it exists on cn7 (GB10) and is structurally unreachable on cn5 (discrete RTX PRO 6000). cn5's only role is a 5-minute no-regression check.
- The PR's own new CUDA test cannot validate the fix.
tests/preparation/test_capture_cublas_workspace_cuda.py:244-249exports throughRuntimeCore.write, which never setsdiscover_allocations(ignition/preparation/runtime_core.py:122-133; the only setter isexport_modelat:360) and leavesdevice_address_floorat the constructor default0(:98vs:364). Thereforeheliopause/src/export/capture.rs:1407-1468(thecuPointerGetAttributeexternal-allocation rejection) and:3383-3389(the below-floor rejection) never execute in that test. It asserts only a Python-level condition (storage.mappingscontainment,:193-204) plus aRuntimeCore.writetail whose output is never read back. - Consequence for the test engineer: Step 0 is a reproduction attempt on
main. Ifmaindoes not fail the harness below on cn7, the PR cannot be validated on our hardware — stop and report INCONCLUSIVE rather than burning the rest of the plan.
Total GPU-time budget: ~25–35 minutes on cn7 (plus ~5 min on cn5), of which only ~5 minutes are after the reproduction gate passes. Everything else is CPU-only or skippable.
Why the defect only exists on cn7
| Fact | Citation |
|---|---|
storage.integrated = torch.cuda.get_device_properties(device).is_integrated; the low-window seal and the export floor are gated on it |
ignition/preparation/core_storage.py:65, :106-108, :127-141, :161-189 |
Export sets device_address_floor = storage.EXTERNAL_FLOOR if storage.integrated else 0 |
ignition/preparation/runtime_core.py:364 |
Failure is prepare_allocations: recorded memory == "device" segments not covered by a declared allocation are rejected when cuPointerGetAttribute(CONTEXT) returns 0 (VMM cuMemMap segments) |
heliopause/src/export/capture.rs:1407-1468 (reject at :1461-1466), heliopause/src/export/recorder.rs:467-478 |
Declared device-{i} mappings come from storage.mappings, which is why the fix's segments are skipped |
heliopause/src/export/capture.rs:1437-1441, ignition/preparation/runtime_core.py:308-310, ignition/preparation/core_storage.py:199-205 |
The fix's pool allocates from flare_core_allocate (VMM cuMemCreate/cuMemMap inside the reserved window) |
ignition/preparation/core_storage.py:301-310, heliopause/src/allocator.rs:415-489 |
On cn5 (is_integrated == False) the floor is 0 and seal_low_window() returns immediately (core_storage.py:167), so neither rejection can fire — cn5 can only prove "nothing regressed".
Scope limit forced by the hardware: cn7 has 1 GPU, 10 CPUs, 60 GiB RAM, 16 GiB scratch → single-rank exports only. Multi-rank GB10 export (the rank_group.py:44-113 / host_ranks.py:343-377 peer path that also passes warmup_storage) cannot be tested with the available machines. Say so in the sign-off; do not attempt --ranks.
Step 0 — Environment and build gate on cn7 (CPU, ~15–20 min, no GPU time wasted on failure)
cd <repo> # PR head 8c1a28a
uv sync --extra prepare --reinstall-package flare-heliopause
uv pip install --python .venv/bin/python --no-deps ./heliopause
uv pip install --python .venv/bin/python --no-deps -e .
.venv/bin/python -c "import torch, flare_heliopause; print(torch.__version__, torch.cuda.get_device_name(0), torch.cuda.get_device_properties(0).is_integrated)"
Per AGENTS.md:249-266 and heliopause/pyproject.toml (maturin, features = ["server","extension-module"]). Abort immediately if:
- the
flare-heliopauseor torch 2.14.1+cu132 aarch64 wheel/extension build fails on GB10 (cn7 is arm64), or - the printed
is_integratedis notTrue(then cn7 is not exercising the integrated path and the whole plan is void).
Also raise the locked-memory limit in the job shell — the integrated path mlocks host regions and fails with RLIMIT_MEMLOCK otherwise (core_storage.py:460-461; CI sets 64 MiB at .github/workflows/native-serving.yml:61-62 (not opened)):
sudo prlimit --pid $$ --memlock=67108864:67108864
Do not plan an end-to-end recipe export (ignition export qwen3.8-27b) unless a cached checkpoint is already present: the machine listing shows 0 GiB for every model, so it would mean a multi-GB download plus full tuning/compilation on 10 CPUs on a 16 GiB scratch volume. Recipes also live in the external local-inference-lab/hyperflare-recipes package (docs/model-preparation.md:310-330), not in this repo. The harness below needs no checkpoint.
Step 1 — CPU tier (any machine, ~2 min, no GPU)
.venv/bin/python -m pytest tests/preparation/test_core_storage.py -q
.venv/bin/python -m pytest tests/preparation/test_capture_stream_isolation.py (not opened) tests/preparation/test_transient_retention.py (not opened) \
tests/preparation/test_capture_graph_metadata.py (not opened) tests/preparation/test_capture_rank_readiness.py (not opened) \
tests/preparation/test_capture_roce_wait.py (not opened) tests/preparation/test_forward_compile_options.py (not opened) \
tests/preparation/test_preparation_reclamation.py (not opened) -q
First file contains the PR's new test_warmup_pool_reuses_one_core_allocator_pool (tests/preparation/test_core_storage.py:83-105). The second set are the seven CPU files that stub _seed_warmup_workspaces with 2-argument lambdas and are the only reason capture.py:119-124 keeps its if warmup_pool is not None: / else split — a regression here means the non-export path was broken. Both are free; run them first even though they cannot validate the fix.
Step 2 — GPU tier on cn7: the PR's tests as shipped (~3 min, mostly import/compile)
CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 \
.venv/bin/python -m pytest \
tests/preparation/test_capture_cublas_workspace_cuda.py \
tests/preparation/test_recorded_export_graph_cuda.py -q
- The file is skipped without
FLARE_RUN_CUDA_TESTS=1(tests/preparation/test_capture_cublas_workspace_cuda.py:22) — a skip is an unrun check, not a pass (AGENTS.md:302-307). - The new test re-executes in a subprocess with a 120 s timeout (
:133-145); the subprocess isolation is deliberate (process-singletonCoreStoragearena +_warmup_streams[0]/ cuBLASLt cache pollution). - Interpretation (critical): a pass here proves the seeding lands in
CoreStorage.warmup_pool()and insidestorage.mappings, and that the module-level_warmup_poolspath is not used for export (:187-204). It does not prove the native discovery/floor validation that produced the GB10 error. Run it in both orders to confirm no state pollution: default, then.venv/bin/python -m pytest tests/preparation/test_capture_cublas_workspace_cuda.py -q -p no:randomly --deselect ...::test_first_capture_binds_workspace_from_the_recording_poolfirst. - If it fails with the graph pool empty (
:205,:190), that is a real regression signal from baseline main — capture it before proceeding.
Step 3 — GPU tier on cn7: the decisive A/B harness (~5 min total, run on main and on the PR head)
This is the plan's core. It exercises the real native validations by going through export_model instead of RuntimeCore.write.
git worktree add ../flare-main origin/main # baseline, same .venv
Save as /tmp/warmup_export_repro.py (not opened) (run from repo root; works in either worktree):
import sys
from contextlib import nullcontext
from pathlib import Path
from types import SimpleNamespace
import torch
from ignition.preparation.capture import capture_forwards
from ignition.preparation.core_storage import CoreStorage
from ignition.preparation.execution import GraphSignature, PreparedExecution
from ignition.preparation.module_images import ModuleImages
from ignition.preparation.runtime_core import export_model
out = Path(sys.argv[1]); out.mkdir(parents=True, exist_ok=True)
with ModuleImages() as images:
torch.cuda.set_device(0)
prev = torch.backends.cuda.preferred_blas_library()
torch.backends.cuda.preferred_blas_library("cublaslt")
try:
storage = CoreStorage() # integrated=True on GB10 -> floor + low-window seal active
with storage:
src = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
w = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
o = torch.empty_like(src)
frame = torch.zeros(1, device="cuda", dtype=torch.int32)
seq = torch.zeros(1, device="cuda", dtype=torch.int64)
rec = torch.zeros((2, 1, 24), device="cuda", dtype=torch.int64)
def forward(): torch.mm(src, w, out=o)
stream = torch.cuda.Stream()
graphs, _ = capture_forwards({"decode": forward}, {"decode": GraphSignature("decode", 1, 1)},
session=SimpleNamespace(capture=nullcontext), device=0, stream=stream,
pool=storage.graph_pool.id, warmup_storage=storage,
retain_graphs=True, compile_decoder=False)
try:
prep = PreparedExecution(device=0, graphs=graphs,
buffers=dict(source=src, weight=w, output=o, frame_index=frame,
submission_sequence=seq, completion_records=rec),
max_active=1, signatures={"decode": GraphSignature("decode", 1, 1, ("source",))})
prep.server_config = {}
prep.core_data = None
core = export_model(prep, images, storage, out / "rank.json (not opened)",
options={}, bundle_only=True) # full discovery + floor
print("EXPORT_OK", flush=True)
print("allocations:", len(core.allocations), "external:", core.external, flush=True)
if hasattr(storage, "warmup_pool"):
warm = storage.warmup_pool()
declared = [(a.address, a.nbytes) for a in core.allocations]
for seg in torch.cuda.memory_snapshot(warm.id, include_traces=False):
inside = any(s <= seg["address"] and seg["address"] + seg["total_size"] <= s + n
for s, n in declared)
covered = any(s <= seg["address"] < s + n for s, n in declared)
print(f"warmup segment {seg['address']:#x}+{seg['total_size']} "
f"declared={inside} exported={covered}", flush=True)
finally:
for g in graphs.values(): g.reset()
finally:
torch.backends.cuda.preferred_blas_library(prev)
Run:
CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/main-out 2>&1 | tail -40 # from ../flare-main
CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/head-out 2>&1 | tail -40 # from PR head
Reproduction gate and acceptance criteria
| Outcome | Meaning | Action |
|---|---|---|
main raises RuntimeError: ... external allocation 0x... is not device memory in the serving context ... (text from capture.rs:1461-1466) and the head prints EXPORT_OK |
Defect reproduced and fixed on real GB10 validation | PASS — proceed to Step 4 |
main prints EXPORT_OK with external: [...] non-empty |
The warmup segment was accepted as an external allocation → the module pool happened to be cudaMalloc-backed on this host; the failure the PR describes does not reproduce here | INCONCLUSIVE — do not spend more GPU time; report that the fix is unverifiable on our hardware, attach both logs, and ask the author for the exact GB10 command/log (they claim spark-b23d) |
head raises the same error, or storage.warmup_pool() segments show declared=False |
The fix does not hold on this host | FAIL — capture full output + storage.mappings dump, block merge |
both fail before export (import/MemPool/mlock errors) |
Environment fault, not a PR signal | Fix env per Step 0; counts as no evidence |
On the head, also record (one line each, no extra runs): external must be empty, every warmup segment must print declared=True exported=False (the operand block is fed through unused_ranges() → inactive/zero_ranges at runtime_core.py:298-301 and core_storage.py:320-335, and is unreachable per reachability.rs:118-122), and len(core.allocations) must equal main's count plus nothing — i.e. no new exported allocation. If a warmup segment appears in core.allocations, the "retention moved, not added" claim is false and the PR needs rework.
Fallbacks if the bundle construction trips a contract check: copy helios/tests/fixed_core_fixture.py:159-172 verbatim (it is the maintained export_model + PreparedExecution pattern), or drop bundle_only=True and pass server_config from helios/tests/fixture_frontend.py (not opened). bundle_only only suppresses server metadata (runtime_core.py:332, :366); it does not skip prepare_allocations or reachability.
Step 4 — Memory accounting and native load (only if Step 3 passed; ~5 min, cn7)
- Retained bytes. In the same process as Step 3, before
export_model, printtorch.cuda.memory_allocatedandlen(torch.cuda.memory_snapshot(storage.warmup_pool().id))-derived sizes. Expected: one 2 MiB operand segment freed, and up to ~32 MiB cuBLASLt workspace held for process life. Assert the head does not retain more than main's module pool did (the change relocates ownership intoCoreStorage's VMM arena rather than adding memory). Record the numbers; there is no target to beat. - Native replay of the exported core — the real proof the metadata is still loadable:
cargo build --release --manifest-path flare-cli/Cargo.toml(not opened), then./flare-cli/target/release/flare inspect <out>/rank.json(not opened) (orflare runif the bundle carries enough metadata;inspectneeds no GPU work). Expected: verifies and lists thedecodegraph; failure means the warmup-pool registration corrupted exported content (core_storage.py:309) and merge must be blocked even though Step 3 passed.
Step 5 — cn5 (discrete, 4× RTX PRO 6000): no-regression only, ~5 min, 1 GPU
git worktree… # PR head
CUDA_VISIBLE_DEVICES=0 .venv/bin/python /tmp/warmup_export_repro.py (not opened) /tmp/cn5-out # expect EXPORT_OK, external: []
CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 .venv/bin/python -m pytest \
tests/preparation/test_capture_cublas_workspace_cuda.py tests/preparation/test_recorded_export_graph_cuda.py -q
Purpose: confirm non-integrated export is unchanged (floor 0, no low-window seal) and that warmup_pool() does not disturb the discrete path. One GPU only; do not occupy 4 GPUs — the other three buy nothing for this PR. If time is tight, this step is the first to cut: the code path is gated on is_integrated, and Step 1's CPU tier plus Step 3 on cn7 already cover correctness.
Explicitly out of scope (do not spend GPU time)
ignition bench, throughput/latency matrices,flare runserving benchmarks — PR #606 makes no performance claim; it is a fix for an export-time rejection.- Multi-rank / TP exports on GB10 — cn7 has one GPU; the TP peer path (
rank_group.py,host_ranks.py) cannot be exercised. Report as an unrun check. - End-to-end
ignition export qwen3.8-27b/ GLM recipes — needs an external recipe package plus a checkpoint that is not cached (all machines show 0 GiB); cost far exceeds the value of a 28-line fix. - cn5's 4-GPU capacity for anything else in this PR — nothing here needs more than one device.
Risks the test engineer should watch
- Reproduction may simply not happen (module pool may not be VMM-backed on
main) — the single largest risk; hence the Step 3 gate before any wider run. - cn7 build wheel availability for torch 2.14.1+cu132 /
flare-heliopauseon arm64 — gate in Step 0. RLIMIT_MEMLOCKon integrated hosts (core_storage.py:460-461).- 16 GiB scratch — keep exports under
/tmpor the job scratch and delete between arms; two arms total ≈ tens of MiB, so this is comfortable. - Order-dependent cuBLASLt cache state — always run the two CUDA test files together in one pytest invocation, and never interleave Step 3 arms in one interpreter (separate processes, as written).
- If Steps 3–4 pass, the remaining merge gate is procedural, not hardware: DCO
Signed-off-byand a maintainer decision that relocating the warmup pool intoCoreStorage(a partial reversal of #331's "outside any caller-owned pool" invariant, docstring now atcapture.py:59-64) is the intended layer rather than #332-style export diagnostics.
Discord Test Request
Discord post (ready to paste)
## Recommendation: Test
High confidence — but only as a small, sharply-scoped test on cn7, and it must
start by trying to reproduce the bug on main. If main doesn't fail, we can't
validate this PR on our hardware and we stop. (PR #606 — fix(ignition): seed
warmup workspaces inside export storage pool)
## Hardware Required
- cn7 (GB10) only — this defect only exists on unified-memory GPUs
- 1 GPU in use, single-rank export (cn7 has no second GPU, so no multi-rank test)
- cn5 (discrete) is a 5-minute "nothing broke" check only
## Justification
- Real production bug: on GB10, native export rejects the unowned 2 MiB cuBLASLt
warmup segment after full compilation and graph capture, so exports fail
- Cheap and low risk: a 28-line fix, no performance claim to measure — zero
benchmarking time budgeted
## Estimated Time to Complete
~25–35 min GPU time on cn7 (≈5 min after the reproduction gate) + ~5 min on cn5;
plus ~15–20 min CPU-only setup and unit tests. cn5 is the first step to cut.
Report: what I did and what I verified
I was asked to turn the pre-test summary report into a Discord post matching the template. Before writing it I checked the report's load-bearing claims against the actual repo rather than trusting them, because the post's confidence rating rests on them.
Verified as accurate:
-
The fix's shape matches the PR.
pr_diffconfirms the report's +12/−0 incore_storage.pyand +16/−7 incapture.py:CoreStorage.warmup_pool()(diff atignition/preparation/core_storage.py) lazily creates onetorch.cuda.MemPool(self._allocator.allocator()), caches it onself._warmup_pool, and registerspool.idin_preparation_pools;_seed_warmup_workspacesgainspool=None;capture_forwardspreferswarmup_storage.warmup_pool()and otherwise keeps the 2-argument call. Total is +191/−8 across 5 files, consistent with the "28-line fix" framing (production lines only). -
The defect path is genuinely unified-memory-only.
core_storage.py:65setsself.integrated = properties.is_integrated;:107-108seals the low window only when integrated;:167makesseal_low_window()return immediately otherwise;runtime_core.py:364setsdevice_address_floor = storage.EXTERNAL_FLOOR if storage.integrated else 0. So cn5 (discrete) structurally cannot hit either rejection — the report's "cn5 is no-regression only" conclusion holds. -
The report's central criticism of the PR's own test is correct.
RuntimeCore.write(runtime_core.py:122-133) does not passdiscover_allocations, andRuntimeCore.__init__defaultsdevice_address_floor=0(:98), while onlyexport_modelsets both (:360,:364). Sincecapture.rs:1407gates discovery onrequest.discover_allocationsand the floor rejection at:3381-3389needs a non-zero floor, the shipped test cannot execute either native check. This justifies the plan's Step 3 A/B harness going throughexport_modeland the Step 0 "reproduce on main first" gate — the most important thing in the post. -
The error-message text is verbatim from the code.
capture.rs:1461-1466produces exactly theexternal allocation 0x...+... is not device memory in the serving context (memory ..., context ..., recorded context ..., serving context ...)string quoted in the PR description, so the reproduction gate's expected failure is well-specified.
Points where I deliberately simplified for the Discord audience: the report's conditional branches (main prints EXPORT_OK → INCONCLUSIVE; head fails → FAIL; env failure → no evidence) are collapsed into one "if main doesn't fail, we stop" sentence, which preserves the decision the reader needs. The multi-rank gap, the RLIMIT_MEMLOCK setting, and the excluded benchmarks are folded into the hardware bullets and the "no perf claim" justification rather than dropped.
Caveats the post inherits honestly: confidence is stated as high for the recommendation (a small scoped test), not high that the PR is verifiably fixed — the report itself flags reproduction as the single largest risk, and the PR's evidence is self-reported on GB10 (spark-b23d) with no CI running Python/CUDA tests. The unsupported pieces are stated as hardware limits (single GPU on cn7, no cached checkpoints), not as things skipped for convenience.
No instruction-like content or prompt-injection attempts were found in the PR, its comments, or the review bots' posts.