Recommendation: Ready To Merge
Head 4270e90 resolves the sole Round 2 blocker (live multi-GPU flare run served-workload A/B qualification) via @voipmonitor's paired 4× SM120 TP4 DeepSeek-V4.1-Flash ABAB (0 errors/faults/hangs, 100% accuracy pass, flat prefill, and -1.2% to -1.7% decode latency gains across C=1/C=4/C=32 with -2.5% to -5.4% on W=8 speculative buckets), while keeping the minimal 8-file production footprint without adding a speculative CLI/config switch. All Round 1 Python/Rust correctness, template-retention validation, stale-flag clearing, and Helios CUPTI load+replay items remain intact and re-verified on 4270e90, with no new correctness, safety, or compatibility regressions. Note for maintainers before clicking merge: @voipmonitor's earlier APPROVED review covered opt-in revision 7fc5993b prior to dropping the opt-in plumbing at 4270e90, and recipes other than DeepSeek-V4.1-Flash plus SM103/SM121 remain outside the measured serving A/B scope.
Merge Risk
Level: Medium
- Global GPU scheduling policy activation for
auxiliary_streamgraphs: Every newly exported serving graph viacapture_forwards->record_export_graph(ignition/preparation/capture.py:193,ignition/preparation/runtime_core.py:213-266) now recordsflags = 9(AUTO_FREE_ON_LAUNCH | USE_NODE_PRIORITY), causing Helios (helios/src/runtime_core/mod.rs:1220-1224) to honor capturedCU_LAUNCH_ATTRIBUTE_PRIORITY(id = 8) attributes onScratchArena.auxiliary_streamkernels. While paired 4× SM120 TP4 ABAB passed cleanly onDeepSeek-V4.1-Flash(91/135graphs,43,290priority = -5kernels), other recipes and SM103/SM121 were not measured in that ABAB, and there is no separate flag to disable bit8independently of--no-stream-overlap. - Approval-to-head delta:
@voipmonitor's 16:57APPROVEDreview was given on7fc5993b(opt-in--use-node-priority);4270e90reverts the opt-in plumbing to restore the always-on18312bdbehavior on top ofmain9a054b49. - Low format, compatibility, and serving-path stability risk: Existing signed cores keep
flags = 1and continue to load unchanged; startup tuning graphs keepflags = 1; Heliopause (heliopause/src/export/capture.rs:791-794, 2840-2841) and Helios (helios/src/runtime_core/format.rs:495,mod.rs:989-1018, 1223) already supportflags & !9 == 0and kernel priority attributeid = 8; no serving hot-path locks, queues, buffering, or allocations are added.
Walkthrough
ignition/preparation/runtime_core.py:93-95, 197-266: AddsCUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH(1),CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY(8),PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS(9), lazily cached_cuda_driver()+_executable_instantiation_flags(), and updatesrecord_export_graphto defaultinstantiation_flagsto8. Validates requested flags, absence of_flare_graph_metadata, live non-zeroraw_cuda_graph(), and pool ownership beforeretain_object/instantiate_graph; clears pre-existing_flare_instantiation_flagsafter instantiation; queriescuGraphExecGetFlags, rejects unsupported executable bits, and recordsprior_flags | instantiation_flags.ignition/preparation/runtime_core.py:306-312: ReusesPERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGSin_graphs()and rejects a zeroraw_cuda_graph()handle whenever_flare_instantiation_flagsis set.helios/src/runtime_core/format.rs:868-879: Adds unit testgraph_instantiation_flags_accept_auto_free_and_node_priority_onlypinning0/1/8/9accepted and2/4/16/u64::MAXrejected.helios/src/runtime_core/mod.rs:26-27,helios/src/runtime_core/node_priority_tests.rs,helios/tests/node_priority_core_fixture.py: Adds a signed single-rank export fixture (decodewith main +ScratchArena.auxiliary_streambranches andtunestartup tuning graph) and an#[ignore]d Rust test verifying serialized flags (9/1),CU_LAUNCH_ATTRIBUTE_PRIORITY(< 0and0), CUPTI-observedcuGraphInstantiateWithFlagsflags (9/1),cuGraphExecGetFlags == 1readback, and0-ULPbit-exactReplayWorkerreplay.tests/preparation/test_capture_graph_metadata.py,tests/preparation/test_runtime_core.py,tests/preparation/test_recorded_export_graph_cuda.py: Adds CPU tests for template-retention guards, pre-mutation rejection, stale-flag clearing,_cuda_driver()caching, zero-template rejection in_graphs(), and SM120 end-to-end fixture + Helios CUPTI replay wiring.
Pre-merge Checks
- [PASS] Security / malicious screen: No unsafe external inputs, secret handling, or suspicious native/FFI patterns; CUPTI callback/FFI and
libloadingusage innode_priority_tests.rsare test-only and properly unsubscribed on drop. No prompt-injection or instruction-override attempts found in PR material. - [PASS] Charter & value fit: Fixes an incomplete CUDA graph instantiation contract in Ignition (
ScratchArena.auxiliary_streamatignition/preparation/scratch.py:91-97already creates highest-priority streams and Heliopause/Helios already supportflags & !9 == 0and priority attributeid = 8), avoids adding a speculative CLI/config switch (AGENTS.md:188-190), preserves core compatibility, and discloses all four required PR description sections and scope limits honestly. - [PASS] Related / duplicate / conflict check: Genuinely additive and clean against
main9a054b49; does not touchignition/preparation/capture.py, so there is no conflict with open PR #606. - [WARN] Tests & verification evidence: CPU pytest (
python-cpu.yml), Rust unit tests, and single-GPU SM120 CUDA/CUPTI replay tests all pass directly on4270e90, and paired 4× SM120 TP4flare runABAB passed on the equivalentflags = 9manifest at7fc5993b; however, CUDA-gated /#[ignore]d tests do not run in CI, non-DeepSeek recipes and SM103/SM121 were outside the ABAB scope, and@voipmonitor's earlierAPPROVEDreview was on opt-in revision7fc5993b.
Blockers
None.
Should Fix
None.
Subtract / Simplify
- Optional: remove dead type/sign checks on
prior_flags(ignition/preparation/runtime_core.py:259-263):_executable_instantiation_flags(graph)(:205-210) always returnsint(C.c_uint64(...).value), which is guaranteed to be a non-negativeint. Checkingif prior_flags & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS:suffices withouttype(prior_flags) is not int or prior_flags < 0. - Optional: drop the unused
instantiation_flagsparameter andNoneclearing mode (ignition/preparation/runtime_core.py:213-219, 224-246, 255-257): The sole production caller (ignition/preparation/capture.py:193) never passesinstantiation_flags. If no out-of-tree caller relies on passinginstantiation_flags=Noneor0, unconditionally validating template retention and applyingCUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITYremoves the parameter-validation branch, theNone-mode docstring, and theNone/0/2unit-test branches with identical behavior at the shipped call site.
Nits
tests/preparation/test_capture_graph_metadata.py:237-244callsrecord_export_graphtwice on the same fakeGraphinstance (plain); pre-settingplain._flare_instantiation_flags = expected_combinedon a freshGraph(as done forrecorded_metaat:253-254) avoids normalizing re-instantiation of an already-instantiated graph (docs/core-design.md:1048-1051).ignition/preparation/runtime_core.py:96-98leaves three blank lines between_cuda_driverandclass RuntimeCoreinstead of two.
Dropped on verification
- Upstream Correctness F1 / Value Proposition ("BLOCKER: always-on global default violates Principle 10; reinstate opt-in from
7fc5993b"): Dropped as a blocker. Principle 10 (docs/design-review.md:89-99) governs user-facing configuration and prohibits env-var switches/magic sampling defaults; it does not require turning an internal CUDA graph instantiation bit into a CLI switch.AGENTS.md:188-190and the charter explicitly discourage speculative configuration switches.ScratchArena.auxiliary_stream(ignition/preparation/scratch.py:91-97) already creates highest-priority streams unconditionally (with--no-stream-overlapto serialize branches), Heliopause/Helios already serialize and restore priority attributes and acceptflags & !9 == 0, and the sole Round 2 gate on the always-on18312bddiff — live multi-GPUflare runABAB qualification — has now been satisfied by@voipmonitor's 4× SM120 TP4 results. The approval-to-head delta (7fc5993bvs4270e90) and unmeasured recipe/arch scope are retained transparently in Merge Risk and Pre-merge Checks. - Upstream Correctness F2 ("MAJOR:
capture_graph()output is rejected byrecord_export_graph's default"): False. Heliopause (heliopause/src/export/capture.rs:2840-2841) requires a live CUDA graph template (graph != 0) wheneverinstantiate_flagsis set,capture.py:171constructstorch.cuda.CUDAGraph(keep_graph=True)for export (capture_graph(retain_graphs=True)is used only for non-export/tuning paths), and@voipmonitorexplicitly requested this pre-mutation rejection in Round 1 and confirmed it in Round 2. - Upstream Correctness F3 ("MAJOR: late
prior_flagsvalidation afterretain_object+instantiate_graphleaks owners; mask unsupported bits instead"): False and unsafe fix proposal.cuGraphExecGetFlagscannot be called beforeinstantiate_graph(graph)creates theCUgraphExec;retain_objectmust precedeinstantiate_graphand releases on GC when the exception unwinds out ofcapture_forwards(capture.py:171, 198-200, no leak until process exit); silently masking unsupported bits would conceal unsupported flags in violation of Principle 15 (docs/design-review.md:143-145). - Upstream Correctness F5 ("MINOR:
node_priority_tests.rspanics on missing env var instead of skipping"): False / contradicts repo convention. All four sibling#[ignore]d CUDA fixture tests inhelios/src/runtime_core/(cooperative_tests.rs:41-45,programmatic_edge_tests.rs:10-14,shared_memory_tests.rs:10-14,event_tests.rs:14-17) usestd::env::var_os(...).unwrap()so a misconfigured--ignoredinvocation fails loudly rather than falsely passing. - Upstream Correctness F6 ("MINOR: export newly hard-depends on hardcoded
libcuda.so.1/nvcuda.dll"): False.CoreStorage.__init__(ignition/preparation/core_storage.py:76) already instantiates_Cuda()unconditionally on every export. - Upstream Correctness Test Coverage Note ("ctypes signature untested in CPU suite"): Dropped as low-signal;
test_executable_instantiation_flags_reuses_cached_cuda_driver(tests/preparation/test_capture_graph_metadata.py:292-320) exercises_executable_instantiation_flags'sC.c_void_p/C.byref(C.c_uint64)call shape, and live SM120 CUDA tests verified the realcuGraphExecGetFlagsFFI call. - Upstream Subtraction F2 partial claim ("
:233-238cannot fire and drivestest_runtime_core.py:31-37"): Dropped inaccurate half.record_export_graph:233-238checks caller-suppliedinstantiation_flags(which can be non-int/negative if the parameter is kept), andtests/preparation/test_runtime_core.py:31-37tests_graphs()(:307), notrecord_export_graph. Only theprior_flagsdisjuncts (:259-263) are dead and retained above. - Upstream Subtraction F3 ("
_graphs()template check at:309-311is unreachable dead weight"): Dropped._graphs()is an independent serialization boundary (unit-tested directly intest_runtime_core.py:18-45) and checkingif not template:also guards against a graph reset betweenrecord_export_graph()andexport_model(). - Upstream Subtraction F4 ("Delete
@lru_cache_cuda_driver()or replace with module-level_CUDA = _Cuda()"): Dropped. Lazy_Cuda()caching was explicitly requested by@voipmonitorin Round 1 and approved in Round 2, and eager module-level_CUDA = _Cuda()would crash CPU-only imports inpython-cpu.ymlwherelibcuda.so.1is absent. - Upstream Subtraction F5 ("Extract shared CUPTI helper across
node_priority_tests.rsandhelios/tests/tools/allocation_watch.rs"): Dropped as out-of-scope churn for Round 3; the two watches subscribe to different callback sites/structs and consolidating them would expand diff scope into unrelated integration test tooling. - Upstream Subtraction F6(a) ("Replace
AUTO_FREE | USE_NODE_PRIORITYin tests withPERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS"): False. If a third permitted flag were ever added toPERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS, the expected value forAUTO_FREE | USE_NODE_PRIORITYmust remain9, not silently track the wider mask.