Final review report · NVIDIA/hyperflare-inference #581

Raw Markdown for agents: https://autobot.eidonix.com/p/80f8ccd6-61c7-4925-820f-373633d8998b.md

Recommendation: Changes Requested

Revision 18312bd cleanly fixes all Python correctness and review items from Round 1 — up-front validation of keep_graph=False / _flare_graph_metadata / zero templates before graph mutation, clearing stale _flare_instantiation_flags, reusing PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS, caching _Cuda(), and adding an end-to-end single-GPU SM120 Helios NativeResources::load + CUPTI + ReplayWorker verification test. (Note that the earlier 2026-11-29 00:15 Autobot comment still cited the pre-push keep_graph=False and stale-flag bugs, both of which are resolved at 18312bd.) However, the standing Round 1 Blocker (@voipmonitor Major #1 and charter / docs/design-review.md Principle 12) remains unresolved: this performance-labeled PR enables USE_NODE_PRIORITY (8) globally by default for every exported serving graph with zero served-workload flare run TP measurement or CTA-preemption regression qualification on a real model checkpoint.

Merge Risk

Level: Medium

Walkthrough

Pre-merge Checks

Blockers

  1. Global default-on USE_NODE_PRIORITY lacks served-workload flare run qualification (ignition/preparation/runtime_core.py:213-219, ignition/preparation/capture.py:193, ignition/preparation/scratch.py:83-105):
    • Verified behavior & impact: record_export_graph defaults instantiation_flags=CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY (8), and its sole production caller capture_forwards (capture.py:193) passes no override. Every newly exported serving graph therefore embeds flags = 9 (1 | 8), which Helios passes verbatim to cuGraphInstantiateWithFlags (helios/src/runtime_core/mod.rs:1218-1221). This globally activates CTA-level preemption for every kernel captured on ScratchArena.auxiliary_stream (scratch.py:93-97) across all out-of-tree recipes (since commit 4d957175 moved collective wrappers out of core Ignition). While node_priority_tests.rs proves the single-GPU instantiation mechanism works, the PR carries the performance label with zero served-workload flare run TP latency/throughput measurements against main, leaving the standing @voipmonitor Round 1 Major #1 and docs/design-review.md:106-115 (Principle 12) / Charter #210 evidence requirement unmet.
    • Concrete fix: Either (a) run an A/B flare run serving benchmark on an exported TP core (comparing main vs. this PR on a real recipe using ScratchArena.auxiliary_stream and confirming no CTA-preemption regression on heavy-compute auxiliary-stream recipes) and attach the measurements and commands to the PR description, or (b) obtain explicit maintainer sign-off (e.g., @voipmonitor / @lukealonso) to land the mechanism as a correctness fix without a served benchmark and remove the performance framing/label (or gate it behind an explicit recipe/preparation option if global default-on is not desired yet).

Should Fix

None.

Subtract / Simplify

  1. Deduplicate flag-mask and retained-template validation (ignition/preparation/runtime_core.py:232-246, 259-264, 305-312):
    • The bitmask check (type(v) is not int or v < 0 or v & ~PERMITTED_CUDA_GRAPH_INSTANTIATE_FLAGS) is repeated three times, and the non-zero raw_cuda_graph() check is repeated twice with identical error messages. Extracting small helpers (_validate_instantiation_flags / _retained_template_handle) removes the duplication and also gives _graphs() (:309) the same RuntimeError -> ValueError normalization that record_export_graph (:241-244) already performs.
  2. Factor repeated context-set / copy / sync boilerplate in helios/src/runtime_core/node_priority_tests.rs:230-246, 252-272, 279-308, 315-346:
    • The test repeats the cuCtxSetCurrent + cuMemsetD8_v2/cuMemcpyHtoD_v2/cuMemcpyDtoH_v2 + cuCtxSynchronize sequence four times across selector, source, main_output, and aux_output. Two small local test helper closures/functions operating on BufferSpan (memset_span / upload_span / download_span) would trim ~45–50 lines of repetitive driver plumbing. (Note: NativeResources::upload/download cannot be used here because export_model exports VMM allocations named device-*, not per-buffer allocation names.)
  3. Optional cleanup once policy is settled — instantiation_flags keyword parameter (ignition/preparation/runtime_core.py:213-219):
    • No production caller passes instantiation_flags (capture.py:193); None and 0 are exercised only by unit tests (tests/preparation/test_capture_graph_metadata.py:234, 242, 254). Once maintainers decide between unconditional USE_NODE_PRIORITY vs. recipe/preparation opt-in, either delete the unused parameter (AGENTS.md:188-193) or wire it to the actual preparation/recipe option.

Nits

Dropped on verification