#1 [high] PR 581 mechanics: what the flag does and where flags flow
PR #581 (FujitsuPolycom), head 61f64f18, +137 -7, 3 files: ignition/preparation/runtime_core.py, tests/preparation/test_capture_graph_metadata.py, tests/preparation/test_recorded_export_graph_cuda.py.
Flow:
- ignition/preparation/runtime_core.py:192-243 adds constants 1|8, PERMITTED=9, _executable_instantiation_flags() (python ctypes cuGraphExecGetFlags via _Cuda, runtime_core.py:76-90), and record_export_graph(..., instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY) that sets graph._flare_instantiation_flags = prior_flags | instantiation_flags after retain_object + instantiate_graph.
- _graphs() (runtime_core.py:272-293, pre-existing on main) turns _flare_instantiation_flags into dict(name, graph=template, instantiate_flags=flags) and validates flags & ~9 (hardcoded 9 at :284, pre-existing).
- heliopause/src/export/capture.rs:788-794 already does match graph.instantiate_flags { Some(f)=>f, None=>executable_flags(...) }; record_graph rejects flags & !9 != 0 (capture.rs:582-593); request validation capture.rs:2820-2829. So the Rust side needs no change; PR only changes what Python sends.
- helios/src/runtime_core/mod.rs:1216-1219 instantiates with (driver.graph_instantiate)(&mut executable, handle, graph.flags); format.rs:495 allows flags & !9 == 0. Cores with 9 already load on main.
- Node-priority data path already exists: heliopause KERNEL_ATTRIBUTES (capture.rs:462) includes id 8 = CU_LAUNCH_ATTRIBUTE_PRIORITY; helios format.rs:574-582 accepts id 8 and mod.rs:984-1013 applies it via cuGraphKernelNodeSetAttribute. Recorded priority attributes are inert today only because USE_NODE_PRIORITY is unset.
- Source of non-default priorities: ignition/preparation/scratch.py:83-105 creates the overlap/auxiliary stream at cuCtxGetStreamPriorityRange's
greatest(highest) priority for small TP collective kernels; docs/core-design.md:852-863 describes the overlap. - record_export_graph is called only from ignition/preparation/capture.py:193 (serving capture path). Tuning graphs use capture_graph + instantiate_graph (see test_recorded_export_graph_cuda.py:62-65) and never call record_export_graph, so the PR's claim "None keeps executable-derived flags for startup tuning graphs" is wrong.
#2 [high] PR 581 assessment: verdict and gaps
Verdict: worth it with changes (small correct plumbing, but global default-on with zero serving evidence + false description claims).
Evidence for "right layer / already supported":
- helios/src/runtime_core/format.rs:495 accepts flags & !9 == 0; helios/src/runtime_core/mod.rs:1218 passes graph.flags to cuGraphInstantiateWithFlags; format.rs:574-582 accepts kernel-node attribute id 8 (CU_LAUNCH_ATTRIBUTE_PRIORITY) and mod.rs:984-1013 re-applies it. heliopause already reads attribute 8 (KERNEL_ATTRIBUTES, capture.rs:462) and already prefers instantiate_flags over executable flags (capture.rs:791-794). ignition's _graphs() already emits instantiate_flags (runtime_core.py:282-287 on main). So no Rust change is needed: the PR only supplies a value the pipeline already carries.
- Only non-default node priorities come from ignition/preparation/scratch.py:83-105 (auxiliary overlap stream at cuCtxGetStreamPriorityRange greatest); docs/core-design.md:852-863, docs/performance-work.md:126-144. Without flag 8 those priorities are inert.
- Sole call site: ignition/preparation/capture.py:193. Tuning graphs use capture_graph+instantiate_graph (runtime_core.py:246-269), never record_export_graph — so PR claim "None keeps executable-derived flags for startup tuning graphs" is false.
Defects / costs:
- Global default-on, hidden: instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY default in the library function (runtime_core.py:213) flips every exported serving graph, all recipes. Charter "Be explicit and pin everything. No magic defaults" + docs/prefix-cache-offload.md:855-862 (stream-priority separation must not be relied on without measurement).
- No serving evidence: PR admits live export/nondefault-priority/signed-core flare run are "open GPU qualification"; no before/after
flare runlatency. Principle 12 / charter "Bring real evidence" unmet. - Error path: retain_object+instantiate run before prior_flags validation (runtime_core.py:236-242), contradicting PR claim "before mutating graph state"; on raise the graph keeps retained owners and no _flare_instantiation_flags, and capture.py:182-200 has no cleanup.
- Needs a Helios-side assertion that a loaded core instantiates with flags 9 (reviewer voipmonitor's Major #1 still open).
- Nit: _graphs() hardcodes 9 at runtime_core.py:284 instead of PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS; _Cuda() re-opened per graph in _executable_instantiation_flags (runtime_core.py:200-205).
- Welcomed: no per-model branches, no new graph family, +38 lines prod, tests cover 0/1/8/9/None/unsupported, live SM120 export test passes per reviewer.