Pre-Test Report — PR #581 "ignition: set USE_NODE_PRIORITY flag on exported CUDA graphs"
Author: FujitsuPolycom (CONTRIBUTOR, Discord "Dooner") · head 61f64f18, base main 167f22c · +137/−7 in 3 files · open, CHANGES_REQUESTED from voipmonitor (priority reviewer), no CI on head.
RECOMMENDATION: DO NOT REFER TO HARDWARE TESTING (HOLD)
Do not send this to a test engineer yet. Three independent reasons:
- A blocking architectural problem is unresolved and will change the code under test. The PR turns node-priority instantiation on by default for every exported serving graph of every recipe, with no served-workload evidence — the charter's explicit bar for this class of change. The likely fix (make it explicit at the call site, derive it from prepared data, or drop the default) rewrites the very lines a test would validate.
- The only behaviour that is currently testable has already been validated on the same GPU class. voipmonitor ran the PR's own live CUDA export test on SM120 and it passed (
flags_by_name == {"decode": 9, "tune": 1}, 3.29 s). Re-running it on cn5 (also Blackwell/SM120) buys no new information. - The claimed benefit cannot be measured from this repository. The node-priority mechanism only exists in recipe-owned overlap branches, and recipes live in the external
local-inference-lab/hyperflare-recipesrepo (AGENTS.md:12 (not opened), 391-393; boundary enforced bytests/preparation/test_core_boundary.py:39-45(not opened)). No in-repo artifact produces a priority-bearing graph, so an A/B throughput test is not constructible here without importing external recipe code and model weights onto shared hardware.
Expected value if testing were performed now: low (~1–2 h of cn5 GPU time for near-zero decision value). The export-side assertion is already proven; the value-bearing measurements (served latency, SM121 replay) require a merged-or-reshaped design and an external recipe. Testing now would mostly confirm an unmeasured global scheduling change is live, not that it is good.
Why this is not ready: the blocking findings
B1. The flag is a magic default, applied to every graph, unmeasured — the charter's core objection to this PR
ignition/preparation/runtime_core.py:213 makes USE_NODE_PRIORITY (8) the default of instantiation_flags. The sole production caller, ignition/preparation/capture.py:193, passes no argument, and is reached whenever exporting = retain_graphs and warmup_storage is not None (capture.py:170) — i.e. every serving graph, every recipe, TP and TP1 alike.
- Charter: "Be explicit and pin everything. No magic defaults" and "Performance PRs need benchmarks showing an actual speedup over
mainon a served workload (#210)". Alsodocs/design-review.md:106-115(principle 12). The PR itself concedes: "Live CUDA export, nondefault kernel-priority instantiation across target drivers, and signed-coreflare runreplay remain open GPU qualification on this revision." - The decision is not even expressed as prepared data, though it could be: heliopause already serializes kernel-node attribute id 8 (
heliopause/src/export/capture.rs:462, 544-569) and Helios already replays it (helios/src/runtime_core/mod.rs:984-1013).
Correction to the reviews (important for scope judgement): the architecture lens stated the priority stream is "TP scratch … TP-overlap-only". That is wrong. docs/core-design.md:852-863 and docs/performance-work.md:126-144 describe a single-rank auxiliary stream overlapping GDN projections, shared/routed experts, and QSA selection; it is created lazily by ScratchArena.auxiliary_stream (ignition/preparation/scratch.py:83-105) whenever overlap=True (the default, scratch.py:59). The blast radius is therefore broader than "TP" — it is whichever recipes use overlap, which no in-repo file determines.
B2. The PR's benefit premise is unverified, and it is the cheapest thing to falsify
USE_NODE_PRIORITY only changes scheduling for nodes that carry a non-zero priority attribute. Heliopause exports an attribute only when it is non-zero (heliopause/src/export/capture.rs:561-569, KERNEL_ATTRIBUTES includes 8 at :462), and Helios applies only recorded attributes (mod.rs:984-1013). Whether a kernel captured on ScratchArena.auxiliary_stream (created at greatest priority, scratch.py:93-99) is exported with a non-zero attribute 8 is a CUDA capture semantic that no test in this PR or the repo exercises. If the driver leaves it zero, the flag is inert on replay and the change ships a scheduling-mode flip for no benefit. This premise should be settled before any throughput work is commissioned. (It needs one GPU and no recipe — see the deferred plan.)
B3. _flare_instantiation_flags has no invalidation path (correctness, should-fix)
Set at runtime_core.py:242, consumed at :282-287, and never cleared. instantiation_flags=None skips rather than clears, so a re-record keeps a stale word; and nothing drops it on reset()/destroy, unlike _RecordedGraphMetadata.release (:153-158) and RecordedExportGraph.reset (:185-189). _graphs() prefers the stale attribute over the live executable, publishing a flag word derived from a dead executable in a wire shape that heliopause/src/export/capture.rs:2822 structurally cannot detect. Not reachable from today's sole caller (a fresh CUDAGraph per capture), which is why it is should-fix, not blocking.
B4. Rejection happens after mutation, contradicting the PR's own claim (should-fix, affects test design)
The requested-flags check runs before mutation (:224-229), but the executable-derived check runs after retain_object (:236) and instantiate_graph (:237) at :239-241. The description's "rejecting unsupported bits on either source before mutating graph state" is false for that source, and the failure leaves a graph instantiated with owners retained and no _flare_instantiation_flags. The new test (tests/preparation/test_capture_graph_metadata.py:244-248) asserts only the raise, while its neighbour at :250-255 asserts no partial mutation — so the asymmetry is documented rather than caught.
Correction to the reviews: the correctness lens claimed this creates a new export regression on targets that set e.g. bit 2 (DEVICE_LAUNCH). It does not. On main, heliopause already derived flags from the live executable (capture.rs:788-794) and already rejected flags & !9 != 0 at capture.rs:589 during the same export operation. The PR moves an existing rejection earlier into Python (and leaves the graph half-mutated). This is an error-path and lifetime defect, not a new compatibility failure.
B5. instantiation_flags is a speculative extension point; the description is wrong twice (should-fix)
The None and 0 modes exist only in tests (test_capture_graph_metadata.py:234, 240). The description's "Passing instantiation_flags=None keeps executable-derived flags for startup tuning graphs" describes a path that does not exist — tuning graphs use capture_graph + instantiate_graph (runtime_core.py:246-269, capture.py:171, 194-197) and never reach record_export_graph (AGENTS.md:188-193 (not opened) rejects switches without a concrete requirement). Additionally the description's "Before:" clause invents prior behaviour (main wrote no flags at all), and "Candidate 61f64f1… on main" mislabels the PR's own head commit. All seven lenses flagged at least one description inaccuracy; voipmonitor raised the same two.
Open item no lens checked: voipmonitor's Major #2 — record_export_graph does not validate keep_graph=False/_flare_graph_metadata graphs before setting the flag, so such a caller would succeed and fail later with graph=0 in _graphs/Heliopause. Unverified by me; worth confirming in re-review, since it is a second, independent precondition gap.
Nits (ignorable, not gating)
_Cuda() re-dlopens libcuda.so.1 per exported graph (:200-205, while capture.py:43-47 and scratch.py:88-101 use the pinned cuda.bindings.driver); _graphs keeps the hardcoded ~9 and duplicate error string (:284-285) beside the new PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS (:194-197); the new capture_forwards test clones the existing harness; the added docstring paragraph restates the OR. The subtractive lens estimates ~104 of the 144 added lines are removable, with the production change reducible to 1–2 lines.
What is genuinely fine (so it is not retested)
- Flag arithmetic and vocabulary are correct.
1|8 = 9matches CUDACUgraphInstantiate_flags, and every consumer accepts it:helios/src/runtime_core/format.rs:495,heliopause/src/export/capture.rs:589and:2823. Helios instantiates withgraph.flags(helios/src/runtime_core/mod.rs:1215-1219), so bit 8 reaches instantiation. - Backward compatibility holds. Old cores with
flags=1still load everywhere; bit 8 was already permitted in the signed format, andtests/preparation/test_runtime_core.py:18-37already parametrizes0,1,8,9on_graphs. No Rust, wire, or docs change is needed. - Layer placement and model-agnosticism are right. No per-model branch, no new captured-graph op family, no Helios change.
- The wire-shape flip is low risk. Every exported graph now emits
{graph, instantiate_flags}instead of{graph, executable}, but both branches converge on the sameRecordedGraphin heliopause (capture.rs:762-794), and Helios always rebuilds from nodes and re-instantiates (mod.rs:1215-1219). - Security screen: all clear. No injection in the diff, description, or comments; I found no attempt to direct an agent (only a normal technical review from voipmonitor addressed to the human author). Peripheral unverifiable items: the "Discord: Dooner" line and a commit link to the author's fork.
Deferred minimal test plan (to run only after the blocking design question is settled)
Use cn5 (4 × RTX PRO 6000 Blackwell, SM120, amd64 — matches the charter's target and the SM120 box voipmonitor used). Do not use cn7 for anything but the single optional SM121 item. Budget: ~45–60 min of cn5 GPU time total; do not run the A/B throughput leg until an explicit measurement decision exists.
T0 — premise check (the highest-value test; ~10 min, 1 GPU). Run this first regardless of the design outcome.
Build a ScratchArena("cuda:0") (pattern already in tests/preparation/test_scratch_cuda.py:18-32), launch a few kernels on arena.auxiliary_stream and a few on the main stream, capture them into one graph, export via record_export_graph, then decode the exported nodes (decode pattern in tests/preparation/test_runtime_core.py:130-154) and print attribute id 8 per kernel node.
- Pass: auxiliary-stream nodes carry a non-zero attribute 8 and main-stream nodes carry 0/absent → the PR's premise holds; proceed.
- Fail: all zero → the flag is inert at replay; the PR must be reworked (set the attribute explicitly) and no further testing is warranted.
T1 — export correctness (only if T0 passes; ~5 min, 1 GPU).
FLARE_RUN_CUDA_TESTS=1 pytest -q tests/preparation/test_recorded_export_graph_cuda.py with CUDA_VISIBLE_DEVICES set. Expect {"decode": 9, "tune": 1}. This duplicates voipmonitor's SM120 run; run it once as the regression baseline for the revised revision, not per-commit.
T2 — Helios load + replay of a flags=9 core (only after the revision; ~15 min, 1 GPU).
This is the one genuinely untested area: no in-repo fixture has ever exported a non-zero instantiate_flags (helios/tests/runtime_core_fixture.py:146-158 uses record_template(..., 1)/RecordedExportGraph; the other fixtures instantiate with 0 or 1). Extend runtime_core_fixture.py so one graph carries instantiate_flags=9, flare run it, and assert (a) the node values are bit-identical to the pre-PR core (no numerical regression), and (b) cuGraphExecGetFlags on the Helios-instantiated executable reports 9. This satisfies voipmonitor's Major #1 second half and principle 13 ("validate previous cores through loading and serving").
- Regression leg (cheap, include here): load a pre-PR core (
flags=1) through the same binary and confirm identical output — one run, no extra hardware time.
T3 — served A/B throughput (defer; ~20 min, ≥2 GPUs, only on an explicit maintainer decision).
Requires a real recipe from local-inference-lab/hyperflare-recipes plus model weights on cn5, and --bypass-performance-check if the workstation GPUs are not NVLink-paired (docs/cli-design.md:1538-1545). Baseline main vs PR branch on the same core, same checkpoint, same TP width, flare run only (not ignition debug-serve, per principle 12), reporting TTFT and decode tok/s with raw values and repeatability bounds (docs/performance-work.md:35-59). If T0 shows the attribute is only present on small-collective branches, the expected effect is small and concentrated in prefill — measure prefill separately and do not run a long sweep chasing noise.
Do not test: the CPU unit tests (22 + 46 passed are reproducible anywhere), old-core loading beyond the T2 regression leg (path unchanged), or anything on cn7 unless an SM121 replay is specifically requested.
What the author should be told
Make the flag explicit and data-driven, not a default (derive it from recorded per-node priority, or pass it at capture.py:193); delete the instantiation_flags None/0 modes and the duplicated validation, adopting the constant in _graphs; validate executable-derived flags before mutating, or fix the claim and assert the retained-on-failure state; clear/invalidate _flare_instantiation_flags on reset; validate keep_graph=False up front; and bring either the served-workload flare run comparison or the T0 premise evidence. T0 is cheap and the author can run it without our hardware — asking for it before referral is the efficient move.