Explore report · NVIDIA/hyperflare-inference #652

Raw Markdown for agents: https://autobot.eidonix.com/p/500503d4-ed58-45e1-8660-97d3519084a1.md

Case file — PR #652 heliopause: prune unreferenced kernels from exported CUDA ELF64 cubins

Author @lukealonso (COLLABORATOR, Discord: lukealonso). Head 9ea2491, base main (branched at 571a447), open, ready for review, no labels, no reviews, no comments, CI on head "pending". Size: +937 / −5 in 2 files (heliopause/src/export/cubin.rs +927/−1, heliopause/src/export/capture.rs +10/−4).

Key findings (what the description does not tell a reader)

  1. Two silent, all-or-nothing fallbacks decide whether pruning happens at all, and neither is mentioned. try_prune_unused_kernels returns Ok(None) (→ debug-stripped passthrough, no log, no error) if any captured symbol name has no matching .text.<name> section (cubin.rs:452-457), and skips pruning entirely unless there are strictly more .text.* sections than kept functions (cubin.rs:434-436). One mangled/sanitised-name mismatch therefore disables pruning for a whole module silently. This is plausibly why the description reports only 35 of 123 modules pruned — the description lists fallbacks only for stripped section names, missing program headers, SHN_XINDEX and non-zero vaddrs (cubin.rs:381-407), not these two.
  2. No CI lane runs the tests this PR relies on. No workflow invokes cargo test --manifest-path heliopause/Cargo.toml (not opened); the only CI touching cubins is python-cpu.yml (CUDA_VISIBLE_DEVICES="", line 32), which exercises tests/preparation/test_cubin.py through the pyo3 extension. strip_and_prune is not exposed to Python (recorder.rs:1010-1016 registers only three cubin fns), and that test file was not modified. So the "223 non-CUDA tests passed" and the 2 new unit tests (cubin.rs:1223, cubin.rs:1273; 5 total in the module with cubin.rs:977/995/1015) are manual-only evidence.
  3. Evidence is on hardware outside the charter's target matrix. The charter's goal is SM103/SM120/SM121 serving (charter line 21); all live validation is SM87/AGX Orin, and the Limitations say SM103/120/121 and multi-rank TP were not run. The CUTLASS-heavy modules the change targets are exactly the SM120/121 ones left unverified.
  4. Documentation now contradicts the code and was not updated. docs/core-format-design.md:380-381 states "The exporter preserves kernel and global symbol names in cubins"; pruning drops dead symbols' names from .strtab and clears their section index. docs/runtime-core-design.md:76 still describes heliopause cubin handling as "debug stripping" only. No docs file is in the diff.
  5. Correctness of the rewritten ELF is only structurally self-checked. strip_and_prune re-parses its output (cubin.rs:363-367); nothing loads the pruned image through the driver at export time. An ELF that parses but is semantically invalid fails at serving load (helios/src/runtime_core/mod.rs:795-798), on the serving machine.
  6. All numeric claims (cubin 166.51→19.46 MiB, kernels.safetensors 9.93→1.5 MiB, Prepare kernels 0.5s→0.1s, pre-cache 6.73→6.45 GiB, KV 15,488→32,768 tokens) are unattached to any artifact, log, script or baseline in the repo, and no automated lane could reproduce them (all cubin tests use hand-built synthetic ELF fixtures, cubin.rs:910, cubin.rs:1032).

The change

cubin.rs gains strip_and_prune(image, &keep_functions) (cubin.rs:355-370): it calls the existing strip_debug, returns early when the keep set is empty (standalone modules), otherwise attempts try_prune_unused_kernels (cubin.rs:372-903) and falls back to the stripped image on None.

try_prune_unused_kernels (verified in code):

capture.rs builds a per-module BTreeSet<&str> of symbol names from output.index.ranks[0].functions filtered by f.module == name (capture.rs:3282-3287), calls strip_and_prune (capture.rs:3288), stages the pruned bytes and advances the phase byte counter with them (capture.rs:3289-3291), and — the behaviour change the description does state — calls cubin::global_symbols(&exported) rather than &image, in both the standalone-module guard (capture.rs:3293-3298) and the cuModuleGetGlobal_v2 loop (capture.rs:3315). Side effect: a module whose globals were pruned away can no longer trip the "standalone module declares globals without a captured kernel" error.

Nothing in the diff touches the wire format, protobuf, Helios runtime, Cargo manifests or docs.

The why

No issue is linked or closed; the motivation is prose only. The mechanism is real in the code: every module.file cubin is loaded whole via driver.module_load (helios/src/runtime_core/mod.rs:790-799). Ambient repo evidence of the pressure: ignition/preparation/memory_inventory.py:310-311 prints cubin bytes as "not resident VRAM"; #394 measures 32 SM120 cubins at 3,422,080 bytes; #479 reported 9,488 kernels / 436.17 MiB cubin for 314 graphs. The nearest open issue on the same symptom class is #630 (GB10 unified memory: KV budget responds to page-cache-polluted MemFree) — not referenced, not fixed here. Searching the local copy found no prior issue or PR asking for kernel pruning specifically: this is author-initiated.

Recent activity

heliopause/src in the last 60 days is dominated by the author (#646, #647, #620, #618) plus #586 (PCCessna), #587 (FujitsuPolycom) and a silent-export-corruption fix. This PR continues that stream rather than reversing it: it keeps the capture_rank module loop (path-only modules from request.modules at capture.rs:2973-2977, per-function image discovery at capture.rs:3028-3032) and swaps only the cubin transform and the image used to enumerate globals.

People

The author is the de facto owner of this area: 62 commits in heliopause/src in 180 days (vs Martin Vit 11, Jason Cook 5), the only person who had ever touched cubin.rs before this PR (14a6a273, 3edd2c3a, 28f0833b licensing), 33 merged PRs in 180 days and — until this PR — 0 open. There is therefore no other reviewer with prior art on this file; nearest reviewers of the export path are voipmonitor (#394, #585 review), FujitsuPolycom (#585/#586/#587), PCCessna (#586). The adjacent author most affected is yatesdr (codec cubins).

Community

Zero engagement: Discussion (0), no reviews, no reactions, no labels — unlike the author's other PRs (e.g. #646 carries area:caching, area:memory, bug, performance, triage:review), and with no Autobot case-file comment yet even though every other PR in the local copy received one. related_items(652) cannot resolve because the PR is not in the local copy; cross-references above come from search_items/items_touching. Interest so far exists only in the description.

Project fit

Aligns: the charter's merge bar includes "a measured performance/memory issue"; the description follows the four-part format (why / what changed / claimed result / evidence) with commands and a Limitations paragraph; no new flags, no per-model branches, no runtime/API change ("no per-model special cases or flags", "keep the runtime small"); readers of old cores are unchanged, so #412-style artifact compatibility holds.

Does not align / open: the hardware matrix (SM103/120/121) is precisely what was not run (charter line 21); evidence snapshots are not reproducible from the repo (charter "bring real evidence … benchmarks showing an actual speedup … on a served workload" is partly met — load-time numbers on a served workload exist, but no command line, script or log); docs drift as in Key finding 4; the charter's line 44 ("GPU kernel code: report concrete defects only") makes the ELF-rewriting portion of this diff review-shaped, and review should look at the p_align == 8 hardcode (cubin.rs:883), the unremapped sh_info of sections sh_info_is_section does not recognise (e.g. a bare .nv.constant0 or .nv.global.init), and the absence of any post-rewrite assertion that every kept .text survived the cascade.

Claims and evidence

Verified in code: the reachability sources, the symtab index preservation, the sh_info cascade and remap, the global .nv.info/callgraph filters, the passthrough branches, the global_symbols(&exported) change. Not asserted by any test: .symtab's own sh_info after pruning, driver acceptance of a pruned image, the non-SHF_INFO_LINK .nv.constant* naming edge, and modules with a partially matching keep set (the fallback that would silently disable pruning). Test count is consistent: 5 export::cubin tests total, 2 new (one covering two fixture variants). All performance and memory figures are unsupported in-repo, as is "35 multi-kernel modules pruned" out of 123.

Reach

An unconditional change to the export path — no flag, no per-module opt-out, and the only signal is the aggregate byte count in the "Capture compiled modules and globals" phase (capture.rs:3384-3387). Artifacts get smaller, so re-exports produce different payload bytes; signing/publishing, ExecutableResource framing and the runtime reader are untouched. No configuration, CLI, dependency or Cargo change. Benefits are visible only on memory-constrained devices; failure modes move from export time to serving load time. Any request.modules path-only module and the KV-codec standalone module flow through the empty-keep-set branch.

Process

Hours old at capture (opened and last updated 2026-12-01 06:15), open/ready for review, unlabelled, unreviewed, CI pending. The two new tests are not wired into any CI workflow. No stale-work risk yet.

Open questions

Whether the missing prune on 88 of 123 modules is intended passthrough or the unmatched-name fallback (cubin.rs:452-457 / cubin.rs:434-436); whether p_align = 8 and zero vaddr/paddr reproduce NVIDIA's own layout for SM120/121 CUTLASS cubins (never run); whether a driver-level validation pass at export time is feasible; and whether docs/core-format-design.md:380-381 and docs/runtime-core-design.md:76 should be updated as part of this PR.