Case file: PR #581 — "ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs"
https://github.com/NVIDIA/hyperflare-inference/pull/581 · by FujitsuPolycom · branch perf/ignition-export-use-node-priority → main · head 61f64f18 · base 167f22c8 · +137 / −7 in 3 files · open, ready for review, no labels, no CI checks, one review (CHANGES_REQUESTED).
Key findings
- It is a one-line policy change dressed as a mechanism change. All downstream plumbing already exists on
main: theinstantiate_flagswire field (heliopause/src/export/mod.rs:114), Heliopause's use of it (heliopause/src/export/capture.rs:791), the& !9validations (capture.rs:2823,helios/src/runtime_core/format.rs:495), Helios'scuGraphInstantiateWithFlags(helios/src/runtime_core/mod.rs:1218), and even Ignition's_graphs()branch that emits the flags (ignition/preparation/runtime_core.py:282-287, already onmain). The only missing piece was a producer — nothing in Ignition ever set_flare_instantiation_flags. What this PR genuinely adds is a default-on policy of8 | priorfor every exported serving graph. - Two statements in the description are wrong, and the reviewer says so (finding 3, Minor but factual): (a) "rejecting unsupported bits on either source before mutating graph state" — the
prior_flagscheck runs afterretain_objectandinstantiate_graph(runtime_core.py:236-241); (b) "Passinginstantiation_flags=Nonekeeps executable-derived flags for startup tuning graphs" — tuning graphs never callrecord_export_graph(they usecapture_graph+instantiate_graph,ignition/preparation/capture.py:194-197), so that path has no in-tree user. The "Before" sentence is also half-false: onmainrecord_export_graphwrote no flags at all, so nothing was "replaced"; the executable-derived flags came from Heliopause at export time. - Default-on, global, with no knob.
record_export_graphhas exactly one production caller —ignition/preparation/capture.py:193— which passes noinstantiation_flags, so every serving graph of every model, TP layout and target gets8 | prior. There is no recipe declaration, config file or CLI flag to opt out; the default is hardcoded in the signature. The reviewer's [Major] notes bit 8 "globally activates CTA-level preemption for every kernel captured onScratchArena.auxiliary_stream… across all recipes", not only for small collectives. - No measurement, and the charter asks for one. The branch is named
perf/…and the claimed benefit is a scheduling mechanism, but there is no served-workload number anywhere. Charter: "Performance PRs need benchmarks showing an actual speedup overmainon a served workload (#210)";docs/design-review.mdPrinciple 12 (lines 106-115) requires "actual Helios service measurements" and equivalent baselines. The PR does disclose unrun checks, which is the one good part of the evidence story. - CHANGES_REQUESTED from a priority contributor, who is also the author of the mechanism being extended. voipmonitor (#245, #262 first introduced recorded instantiation flags) reviewed at 2026-11-28 22:13 with two Majors (live
flare runqualification; missingkeep_graph=False/_flare_graph_metadatavalidation) plus a Minor and a Nit. No maintainer (lukealonso,original-el8) has engaged. - The beneficiaries moved out of tree. Commit
4d957175(Luke Alonso, 2026-11-27) "Move recipe collective wrappers and PCIe factories out of core Ignition" moved theConcurrent*wrappers that useauxiliary_streamto the externalhyperflare-recipesrepo; in-tree,auxiliary_streamis now only defined (ignition/preparation/scratch.py:83-105) and tested. So the flag is being turned on globally for consumers the repository no longer contains.
The change
Size and shape. ignition/preparation/runtime_core.py +38/−1, tests/preparation/test_capture_graph_metadata.py +96/−3, tests/preparation/test_recorded_export_graph_cuda.py +3/−3. Per-file diff confirmed against the PR head.
What it does, plainly (ignition/preparation/runtime_core.py:192-243):
- Module constants
CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1,CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = 8,PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS = 9. _executable_instantiation_flags(graph)— ctypes call tocuGraphExecGetFlagsongraph.raw_cuda_graph_exec()through the existing_Cudahelper (runtime_core.py:76-90, loadslibcuda.so.1, ornvcuda.dllon Windows), so it opens the driver library per call.record_export_graph(graph, storage, *, owners=(), instantiation_flags=8): validates the requested value (exactint,>= 0, no bits outside9) before pools/retain/instantiate; then, afterinstantiate_graph(graph), readsprior_flagsfrom the live exec, rejects bits outside9, and setsgraph._flare_instantiation_flags = prior_flags | instantiation_flags.- Nothing else changes:
_graphs()(runtime_core.py:272-293) still carries the flag into the export record and still hardcodes~9in its own validation (line 284) — the reviewer's nit.
What the description does not say:
- The default applies to all exports, not only "serving graphs" as opposed to some narrower subset; there is one call site and no per-graph differentiation.
- A new failure mode: an executable carrying any bit other than 1|8 now raises
ValueErrorand aborts the export after the graph has been retained and instantiated (runtime_core.py:238-241), i.e. a late failure that leaves the graph mutated. - The mask
9is now spelled in five places across three languages:runtime_core.py:227,runtime_core.py:284(hardcoded),heliopause/src/export/capture.rs:2823,helios/src/runtime_core/format.rs:495, plus the new constant.
What the description promises that the change does not do: the None path is described as covering "startup tuning graphs", but tuning graphs do not go through record_export_graph; None is only reachable from a caller that does not exist today. The test_recorded_export_graph_cuda.py expectation {"decode": 9, "tune": 1} is itself the proof — tune never receives flags from this function.
The why
- The PR's own "Why" is one sentence: Helios should honour captured node priorities on instantiation without clobbering permitted flags already on the executable.
- Traced origin:
ScratchArena.auxiliary_stream(ignition/preparation/scratch.py:83-105) is created withcuStreamCreateWithPriority(..., greatest)and the comment "Highest stream priority lets small collective kernels preempt main-stream GEMMs". Stream priority does not survive graph replay unless the captured launch attribute is honoured at instantiation — which is exactly what bit 8 enables. So this is the export-side completion of the auxiliary-stream precedence design. - That design arrived with the author's own merged #499 "recipe-declared row-sharded prefill planning and PCIe DMA / RoCE row-shard collectives" (merged 2026-11-24), which added
ConcurrentReduceScatter/ConcurrentGatherShardsonScratchArena.auxiliary_stream. #499's combined-stack claim of +7.3% avg prefill 8K–128K was attributed to the whole stack incl. recipes#23, not to #499 alone. - The kernel-attribute half already round-trips: Heliopause captures attribute ids
[1,2,4,5,8,9,10,11,13,14](heliopause/src/export/capture.rs:462, id 8 =CU_LAUNCH_ATTRIBUTE_PRIORITY) and Helios re-applies them viacuGraphKernelNodeSetAttribute(helios/src/runtime_core/mod.rs:984-1013). Priorities were captured and re-applied but inert. - How long wanted / how widely: the mechanism has existed since 2026-11-09 (#245 → landed as Luke Alonso's
b455be5e/0f0b7626); the impulse is the author's #499 (2026-11-24). There is no issue, bug report or maintainer request in the tracker:search_itemsfor "node priority", "instantiation flags", "cuGraphExecGetFlags" returns only #581 itself. No user-facing symptom is documented, and no docs page mentions node priority (search_codeforinstantiate_flags|USE_NODE_PRIORITY|node priorityunderdocs/returns nothing).
Related work
- #245 (closed, voipmonitor) "Export CUDA graph templates without holding executable instances" — introduced recorded instantiation flags and the exclusive-flag-source rule, validated over flags 0/1/8/9; closed as "merged differently through another commit" (landed as
b455be5e/0f0b7626, 2026-11-09). This PR extends its design. - #262 (closed, voipmonitor) "Retain CUDA graph executables and resource owners during export" — origin of
record_export_graph's retain +instantiate_graph+ return shape; landed as3919c1db(2026-11-11). Overlaps #581 on all three files. Notable context: #262's serving-causality claim was withdrawn after A/B testing in its own comment thread (2026-11-11) — the same files have a history of claims outrunning measurements. - #499 (merged, same author) — the motivating consumer; its review thread was dense (Autobot: 2 blockers including ten unapproved
flare::ops, 8 should-fix), showing maintainers scrutinise this overlap path closely. - #585 (open, draft, same author, +3046/−206) — restructures Heliopause native capture/weight capture/publication, i.e. the code at
capture.rs:791/:2820-2824that consumesinstantiate_flags; it has a COMMENTED review with 3 blockers. If it lands first, this PR's exported flags must still pass its validation. #588 (open, same author) also touches Heliopause export transfer. - #314 (open, schopde-nvidia) "Add signed tensor execution for diffusion" — the only other open PR touching
ignition/preparation/runtime_core.py; unrelated region, no semantic conflict, would need rebasing around the new constants. - #331 (merged, mark-yong) "Isolate cuBLAS warmup workspaces from CUDA graph capture" — same test file, capture-integrity neighbour. #504/#492 (yatesdr) touch
runtime_core.pyin the KV-codec regions, no overlap. - Packet candidates #427/#268/#395/#310/#222/#266/#332 concern capture warm-up,
CUDAGraph.reset()workspace aliasing and export diagnostics — none touch instantiation flags or priority; not relevant beyond shared files. - No competing implementation of the same behaviour was found; no superseded or reverted work.
Recent activity in the touched areas
ignition/preparationrecent committers: Luke Alonso (155), Martin Vit (52), Eugene Rakhmatulin (36);tests/preparation: Luke Alonso (203), Martin Vit (34), jasonc (23).runtime_core.pyhistory is mostly Luke Alonso.- The most relevant recent change is
4d957175(2026-11-27, Luke Alonso) "Move recipe collective wrappers and PCIe factories out of core Ignition", which removed the in-tree users ofauxiliary_stream— the exact consumers whose priorities this flag activates. It builds on #499's design while relocating its beneficiaries. 3e2fcd27(2026-11-28, Martin Vit) GC-boundary work and7ea532b0,c9693765touch the same directories but not this logic.- No commits on
mainsince the branch point167f22ctouch the PR's files, so there is no drift or rebase pressure.
People
- FujitsuPolycom (CONTRIBUTOR; Discord "Dooner"; PR satisfies the Discord-line convention). 180-day record: 7 merged, 7 closed, 11 open. Merged work here includes #499 (row-shard collectives + auxiliary-stream overlap, +1546/−191) and #498 (flush PCIe D2H tails before export completion). Merged areas: docs (4), helios/src (4), ignition (3), ignition/cli (3), ignition/components (3).
- This PR is one of six opened the same evening (2026-11-28, 20:45–22:13, all on
main167f22c): #580, #582, #584, #585, #586, #587, #588, all with the same WSL2-verification template. #583 was already closed. Review capacity is spread across that batch; #585 alone carries three blockers. - voipmonitor — COLLABORATOR, named priority contributor in the charter (lines 15, 58) and
docs/design-review.md; original author of the instantiation-flag mechanism (#245, #262). Their review asks for changes rather than rejecting, and explicitly confirms the wiring is "forward- and backward-compatible with existing cores". - No engagement from lukealonso or original-el8; no reactions, no other comments.
Community
- Exactly one discussion: the CHANGES_REQUESTED review above.
pr_commentsreturns no additional conversation. Interest is effectively one expert reviewer plus the author's own batch. - The review content is substantive and hardware-backed (a live SM120 run), which is arguably the strongest signal in the PR's favour: the FFI was exercised on real hardware by someone other than the author.
Project fit
- Lines up: the change sits squarely in the charter's goal to "serve captured CUDA graphs from Rust on SM103, SM120, and SM121"; it introduces no per-model branch; it is model-agnostic glue at the export boundary; it comes with explicit validation and no wire-format change, respecting Principle 13 compatibility.
- Does not line up: (a) "Bring real evidence — Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)" is unmet: there is no served measurement of any kind, and the branch is on aperf/track. (b) Principle 10 "Use explicit configuration … explicit user values win over defaults" and the charter's "No magic defaults" sit awkwardly with a hardcoded, non-overridable default8in a function signature — there is no recipe declaration or CLI surface for it. (c)docs/design-review.mdPrinciple 12 requires actual Helios service measurements; the PR instead discloses the gap. (d) Principle 14 restricts Claude Opus 5.5 authorship of "stream overlap" optimizations — not asserted here, but this change is exactly the stream-overlap mechanism; the process question is whether it was observed, not something I can determine from the record. docs/runtime-core-design.md:622-623already says Helios instantiates each graph with its recorded flags, anddocs/core-format-design.md:220(not opened) already lists instantiation flags in the Graph record — so nothing in the docs documents that Ignition now sets 8 by default, or why. The PR touches no docs.
Claims and evidence
| Claim | Backing | Status |
|---|---|---|
22 passed on test_core_boundary.py (not opened) + test_design_review_hook.py (not opened) |
author's WSL2 run | claimed only; these are housekeeping suites, not about the change (#499 cited the same pair) |
| 46 passed, 15 skipped on the five preparation suites | author's WSL2 run | plausible but the CUDA file skips without FLARE_RUN_CUDA_TESTS=1, so the author's own run did not exercise the ctypes FFI |
| "Covers preserving bit 1 alongside bit 8, executable-derived flags, and rejecting unsupported bits on either source before mutating graph state" | code | false for the executable-derived source — retain_object/instantiate_graph already ran (runtime_core.py:236-241); reviewer finding 3 |
record_export_graph FFI and `1 |
8=9` work on real CUDA | reviewer, live SM120, 2026-11-28: FLARE_RUN_CUDA_TESTS=1 pytest -q tests/preparation/test_recorded_export_graph_cuda.py → 1 passed, 3.29s, flags_by_name == {"decode": 9, "tune": 1}, and CPU suite 12 passed |
| "Helios requests node priority … while preserving … existing signed-core compatibility" | design argument only | mechanism claim; no test loads an old core (flags 0/1) after the change, and no test asserts Helios instantiates with 9; compatibility rests on unchanged format.rs:495 accepting 0/1/8/9 |
| Implied performance benefit | none | no latency/throughput number, no baseline, no served run; the charter's bar for a perf/ PR |
Nondefault kernel priorities across target drivers, signed-core flare run replay |
none | explicitly disclosed as open in the description |
What the added tests actually pin (tests/preparation/test_capture_graph_metadata.py:110-113, :204-301): the fake CUDAGraph gains exec_flags and the recorder fixture monkeypatches runtime_core._executable_instantiation_flags, so the CPU suite never exercises the real cuGraphExecGetFlags call, argtypes/restype or handle; it pins only the union/validation policy (9, 8, preserve-1, None leaves the attribute absent, reject exec bit 2, reject requested bit 2 with instantiations == 0 and not bad._retained.objects), plus one capture_forwards end-to-end test (:258-301). The live test (tests/preparation/test_recorded_export_graph_cuda.py:82-92) replaces per-graph scalars with {"decode": 9, "tune": 1} and all(node_count > 0).
Gaps matching the reviewer's asks: no test for a keep_graph=False / _flare_graph_metadata graph reaching record_export_graph; no test that a rejected prior_flags leaves graph state clean; no test that a pre-existing _flare_instantiation_flags is cleared when passing None; no Helios-side assertion that a loaded core instantiates with 9.
Reach
- Users/operators: everyone who exports a core after this merges gets bit 8 on every serving graph. No configuration, no documentation, no way to opt out short of patching code.
- Compatibility: existing artifacts are unaffected — Helios accepts flags 0/1/8/9 today (
helios/src/runtime_core/format.rs:495unchanged) and the PR changes no format, proto field, or Rust code. The benefit only appears in cores exported after merge; old cores keep working but stay unaccelerated. - Failure modes introduced: export aborts on an executable carrying unexpected bits (previously it would have exported with those bits and Heliopause would have applied them), and aborts after retain/instantiate. The refusal is deliberate hardening, but it can turn a previously-exportable (if unusual) graph into a hard error on a driver that reports a new flag bit.
- Dependencies/deployment: Python-only; Heliopause is not rebuilt. The
_Cudapath loadsnvcuda.dllon Windows (runtime_core.py:78), but the live verification is Linux/SM120 only. - Signed cores: newly signed cores differ in this one field; nothing found in the export/sign path keys compatibility on flags, and the reviewer states the wiring is forward- and backward-compatible. Not independently verified here.
- Docs: no update required for correctness (
docs/core-format-design.md:220(not opened),docs/runtime-core-design.md:622-623already describe the field), but the new default and its rationale are documented nowhere.
Process
- Opened 2026-11-28 20:45, ready for review, not draft; under a day old at review time.
- No CI checks on the head commit although workflows exist (
.github/workflows/helios-lifecycle.yml(not opened),native-serving.yml(not opened),release.yml(not opened)). Verification rests entirely on the author's WSL2 runs and the reviewer's manual SM120 run — two people, two machines. - One review, CHANGES_REQUESTED, no activity since; no labels, no maintainer comment, no reactions, no linked issues.
- The PR description follows the four-part convention and has the Discord line, but two factual statements are wrong (reviewer finding 3), so it only partly meets the "PR descriptions" expectation in the charter.
- No rebase pressure: nothing on
mainsince167f22ctouches the changed files.
Open questions / what could not be found
- Does enabling bit 8 help or hurt any actually-served workload? Nothing in the repository measures it, and no benchmark, issue, or user report exists either way.
- Is the
8default intended to be permanent and global, or should it be a recipe/config declaration? The PR gives no rationale for hardcoding it, and the reviewer's [Major] 1 treats the global scope as a risk to be qualified rather than a design to be settled. - Do the
keep_graph=False/_flare_graph_metadatagraphs the reviewer flags actually reachrecord_export_graphin practice? The only production caller (capture.py:171) constructs a plainCUDAGraph(keep_graph=True)when exporting, so the reviewer's scenario looks like a latent API-contract hole rather than a live bug — not verifiable beyond that call site. - Whether nondefault kernel priorities behave identically on SM103/SM121 and on other drivers is explicitly untested; only SM120 was run.
- No roadmap item, maintainer request, or tracked issue corresponds to this change — the only justification chain in the record is #499 → this PR.
- No evidence of anyone else attempting this change, and no reaction from the maintainers who own the file.