Verdict: worth it with changes
The idea is right and the layer is right, but as submitted this PR flips a scheduling-relevant CUDA flag on for every exported serving graph in every recipe with no serving measurement, and two of its stated claims are false. Fix those and it is a small, welcome change; merge as-is and it is an unmeasured global behavior change.
Why the idea is right (and why it needed almost no code)
- The whole downstream path already supports the flag. Helios validates
graph.flags & !9 == 0and passes them tocuGraphInstantiateWithFlags(helios/src/runtime_core/format.rs:495,helios/src/runtime_core/mod.rs:1216-1219), re-applies captured node attribute id8(CU_LAUNCH_ATTRIBUTE_PRIORITY) —format.rs:574-582,mod.rs:984-1013— and Heliopause already reads attribute8(KERNEL_ATTRIBUTES,heliopause/src/export/capture.rs:462) and already prefers explicitinstantiate_flagsover executable-derived flags (capture.rs:791-794)._graphs()already emitsinstantiate_flagsonmain(ignition/preparation/runtime_core.py:282-287). So9already loads and instantiates in Helios; this PR only supplies a value the pipeline was already carrying. That is the smallest possible footprint — no Rust changes, no new captured-graph op family, no per-model branches. Good. - The flag is not decorative: node priorities are only reproduced at instantiation when
USE_NODE_PRIORITYis set (NVIDIA driver docs,cuGraphInstantiate: "causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream"). Flare's only source of non-default node priority is the overlap stream created at the range'sgreatestpriority for small TP collectives (ignition/preparation/scratch.py:83-105), documented indocs/core-design.md:852-863anddocs/performance-work.md:126-144. Today those captured priorities are inert on replay. So the change fixes a real (if probably modest) mismatch between what preparation captures and what serving executes — exactly Ignition-owns-decoration / Helios-serves-prepared-graphs. - The prod diff is +38/-1 in one function, preserves previously permitted bits (
prior | 8,1|8 = 9), and the tests cover0 / 1 / 8 / 9 / None / unsupported. Reviewervoipmonitor's live SM120 export run confirms{"decode": 9, "tune": 1}through realcuGraphExecGetFlagsFFI. The contributor handled the hard parts correctly.
What must change before merge
- Evidence for the actual serving path (blocking). The PR itself lists "live CUDA export, nondefault kernel-priority instantiation across target drivers, and signed-core
flare runreplay" as open on this revision. A change that alters GPU scheduling for every exported core needs before/afterflare runlatency on a real served workload (charter "Bring real evidence" / #210;docs/design-review.mdprinciple 12);pytestcounts are not that. At minimum: one exported TP core served throughflare runwith and without8, plus the reviewer's requested assertion that the Helios-instantiated executable reportscuGraphExecGetFlags == 9. - Make the switch explicit, not a library default.
instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITYatignition/preparation/runtime_core.py:213silently changes behavior for every recipe. The charter says "Be explicit and pin everything. No magic defaults," anddocs/prefix-cache-offload.md:855-862explicitly forbids leaning on stream priority without measurement. Even if the answer is "always on," the decision belongs at the single call site (ignition/preparation/capture.py:193) or in run configuration, with the reason written down — not in a helper's default argument. - Fix the error path, or fix the claim.
record_export_graphrunsretain_object(...)andinstantiate_graph(...)before validating executable-derived flags (runtime_core.py:236-242). The PR description's "rejecting unsupported bits on either source before mutating graph state" is therefore false forprior_flags, and on that raise the graph keeps retained owners with no_flare_instantiation_flagsset (capture.py:182-200has no cleanup). Validate what you can (both flag sets,_flare_graph_metadata, live template handle) before retaining, per reviewer Major #2. - Fix the other description claim. "Passing
instantiation_flags=Nonekeeps executable-derived flags for startup tuning graphs" is wrong: tuning graphs go throughcapture_graph+instantiate_graph(runtime_core.py:246-269,tests/preparation/test_recorded_export_graph_cuda.py:62-65) and never callrecord_export_graph.docs/design-review.mdprinciple 16 requires accurate evidence statements. - Nit. Reuse
PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGSin_graphs()(runtime_core.py:284hardcodes~9) and cache the_Cuda()handle instead of reopeninglibcuda.so.1per graph.
Who benefits, and the risk
Beneficiaries are users of TP/prefill cores whose recipes overlap small collective branches on the high-priority auxiliary stream — plausible latency wins when a small collective must preempt a main-stream GEMM; broad but likely small decode-only gains. Cost is low (one function, ~38 lines, no new contracts, backward compatible: existing cores still load, 9 is already within the accepted mask). The risk is that USE_NODE_PRIORITY is all-or-nothing per graph: every kernel captured on the auxiliary stream gets priority-based scheduling, including any recipe that puts heavy compute there, and nothing in the repo has measured whether that helps or hurts under contention. That risk is acceptable only once someone has actually run it, which is precisely what this PR does not do.
Bottom line: right problem, right layer, tiny footprint, no duplication of existing mechanisms — but it ships a global, unmeasured scheduling-policy change with a false evidence statement. Land it after (1)–(4), preferably as an explicit opt-in until a flare run measurement exists.