Explore report · NVIDIA/hyperflare-inference #589

Raw Markdown for agents: https://autobot.eidonix.com/p/9660a724-8167-4cd1-acb9-66b34e27295b.md

Case file — PR #589 "Fix CUDA 12 batched copies, Linux ARM64 release portability, and Selene unified-memory budgeting"

Repository: NVIDIA/hyperflare-inference · PR: https://github.com/NVIDIA/hyperflare-inference/pull/589 Base main, head aed8039, merged as ba3afb13 (2026-11-28) · +994 / −133 in 21 files · labels: none · reviews: none · comments: none · CI on head: passed. All file:line anchors below are at PR head aed8039 unless stated otherwise.

Key findings

  1. Merged with no review of any kind, and it re-introduces a shape the project's own review bot had flagged as a should-fix on sibling PRs 1–2 days earlier. #589 has zero comments, zero reviews, zero reactions (PR conversation is empty; orientation packet "Reviews: none yet"). Open PR #497's round-2 Autobot review objected to "two test-only seams in shipped signatures … prepare_inner's host_budget is None on every production path … → #[cfg(test)] wrapper", and #323's open review says "Both prepare() wrappers drop the setting … drop the positional parameter from all four signatures". #589 ships exactly that wrapper: prepare_with_inputs_budget(..., host_budget: Option<u64>, ...) in selene/src/offload.rs and helios/src/offload/mod.rs, while both prepare_with_inputs wrappers still forward None (helios/src/offload/mod.rs:82-103, selene/src/offload.rs:497-520).
  2. It lands directly on top of two open PRs that rewrite the same functions and will force rebases plus semantic reconciliation, with neither PR mentioned in the description. #497 (open, FujitsuPolycom, +1636/−249) touches the same 6 files and had just removed a host-budget seam; #323 (open, javieratomic, +631/−65) makes the same budget()/host_pool_budget() computations configurable. #589 merged first (2026-11-28).
  3. Undeclared behaviour change: pool registration charges now shrink the capture host budget on integrated GPUs. pool_host_charge (helios/src/runtime_core/memory.rs:956,1013-1018,1021-1025) is added into host_future before host_growth is computed; the description speaks only of "pre-planned offload host budget" and post-KV-alloc double subtraction.
  4. The portability fix covers the .tgz archive only. packaging/debian/Dockerfile still builds the .deb on Ubuntu 24.04 (glibc 2.39) and packaging/debian/package.sh:46-48 still adds ibverbs-providers on arm64; docs/debian.md:4,49 still says 24.04. NOTICE, THIRD_PARTY_NOTICES.md:74-79, Dockerfile:37 and docs/container.md:31-34 still describe a linked-libibverbs world.
  5. No linked issue, and the targeted hardware is outside the project's declared matrix. No user report or issue exists for any of the three defects; the ARM64 breakage was found by inspecting CI, not by a report. The charter names SM103/SM120/SM121 workstations and DGX Spark and says "not interested in … broad hardware support"; Jetson Orin/GA10B/JetPack and Windows WDDM appear nowhere in docs/cli-design.md:6 or docs/core-design.md:3 (not opened).
  6. Five verification gaps the PR itself admits or that inspection shows: no CUDA <13 driver ever runs the new copy_batch fallback; no aarch64 build and no ubuntu-24.04-arm CI run; the HOST_NUMA fallback is exercised only by a mock registrar, never GA10B/WDDM; lazy_libibverbs_loader_resolves_symbols_or_reports_install_hint passes whichever way dlopen goes; and the rewritten release.yml is tag-triggered, so it had not run on main at merge time.
  7. Three unrelated defect classes in one merge commit with disjoint blast radius and separate verification burdens (CUDA copy API ~5 lines; a new 236-line C translation unit + rewritten release job; a multi-crate memory-budgeting rework), so any hardware failure on one part means reverting or hot-fixing all of ba3afb13.

The change

Shape. 21 files, +994/−133, three independent fixes bundled (file inventory confirmed against pr_files):

Group Files Size
CUDA copy fallback helios/src/cuda.rs part of +57/−22
Lazy libibverbs + release helios/native/roce_proxy_dlopen.c (new, +236), helios/build.rs (+3/−2), helios/src/execution/roce.rs (+20/−1), .github/workflows/release.yml (not opened) (+54/−28), `helios flare
Selene budgeting + HOST_NUMA + Eos THP selene/src/{offload.rs +134/−14, offload/tests.rs +159, registrar.rs +11, slab.rs +27/−12}, helios/src/runtime_core/{memory.rs +152/−22, model.rs +7/−5}, helios/src/offload/{mod.rs +27/−1, registrar.rs +8}, eos/src/unix.rs +60/−1, 4 docs widest surface

1. CUDA 12 batched copies (helios/src/cuda.rs). Driver gains CopyAsync / copy_async (cuda.rs:81,225,303, symbol!("cuMemcpyAsync")). Stream::copy_batch (cuda.rs:791-834) keeps the single cuMemcpyBatchAsync_v2 call when the driver exports it (CUDA ≥13) and otherwise loops per entry calling cuMemcpyAsync (cuda.rs:824-833), replacing cuMemcpyDtoDAsync_v2, which under UVA cannot infer direction for pinned host pointers. copy_dtod_async (cuda.rs:1142-1146) still uses cuMemcpyDtoDAsync_v2, consistently, since its only callers copy device↔device (helios/src/offload/transfer/gpu_codec.rs:525 (not opened),620). Mixed host/device callers of copy_batch are as the description says: helios/src/offload/transfer.rs:396-399, helios/src/offload/transfer/codec.rs:948 (not opened), and graph input staging helios/src/execution/transport.rs:1087-1093 where frame.input comes from cuMemHostAlloc(..., flags = 0) (transport.rs:471,630; cuda.rs:842-852). Undeclared detail: the doc comment at cuda.rs:781-790 still states "Every address is a device address, including the device alias of registered host memory. CPU addresses of registrations are not necessarily GPU-accessible", while the new fallback comment says raw cuMemHostAlloc(..., flags=0) pointers are accepted — two different address-class contracts inside one function.

2. Lazy libibverbs loading (helios/native/roce_proxy_dlopen.c, new 236 lines). dlopen("libibverbs.so.1", RTLD_NOW|RTLD_GLOBAL) under pthread_once (:60-63); dlvsym with version IBVERBS_1.1 falling back to dlsym; 17 required ibv_* symbols (:70-104) matching the 17 calls in helios/native/roce_proxy.c, plus optional ibv_reg_mr_iova2 under IBVERBS_1.8 (:106-109). It #defines ibv_* → flare_ibv_* before #include "roce_proxy.c", so the vendored file stays byte-identical (the file header claims this; the #undef lines for ibv_query_port/ibv_reg_mr avoid redefinition warnings). ibv_poll_cq and ibv_post_send are deliberately not wrapped — they are static inline in verbs.h (not opened) built on provider op pointers (roce_proxy.c:753,822,871,957,1128,1299). Failure path returns −1 with "cannot load libibverbs.so.1 (…); install libibverbs1 and ibverbs-providers for multi-host RoCE serving" (:66,111-121). helios/build.rs:67-77 compiles it and links dl+pthread, dropping rustc-link-lib=ibverbs. RoceTransport::open calls roce_ensure_libibverbs after the preflight checks (helios/src/execution/roce.rs:188-199), so the install hint appears only when a RoCE transport is opened.

3. Release builds (release.yml). Matrix shape unchanged (ubuntu-24.04/x86_64, ubuntu-24.04-arm/aarch64, fail-fast: false, :37-53); the old per-target runtime-packages (libibverbs1 ibverbs-providers) is deleted; libibverbs-dev stays on arm64 for the header. Build+package now runs inside docker run … ubuntu:22.04 with the work tree bind-mounted, rustup 1.94.1 installed in-container, cargo build --locked --release --manifest-path flare-cli/Cargo.toml --bin flare then packaging/archive.py (not opened) (:58-80). Verification (:81-121): license/notice payload present; readelf -d must not mention libibverbs.so; a Python check rejects any GLIBC_x.y above 2.35 in readelf --version-info; smoke tests flare --version and flare {run,agent,orbit} --help in dependency-free ubuntu:22.04 and ubuntu:24.04. Docker is now a hard requirement of the job. Feature set is unchanged — no --features roce on the command line — so RoCE still arrives on aarch64 only via flare-cli/Cargo.toml:43-44 (features = ["runtime-core","server","roce"] for cfg(all(linux, aarch64))); the x86_64 archive has no RoCE code and the new DT_NEEDED check is meaningful only for arm64.

4. Selene / Helios host budgeting. selene/src/offload.rs:802-885 adds HOST_SERVICE_HEADROOM_BYTES, host_service_headroom_bytes (64 MiB at ≤16 GiB, min(2 GiB, total/32) above), host_reserve_bytes (scaled service headroom + unchanged total/20 system share), host_pool_budget_from, host_pool_budget, host_pool_budget_with_reserve(future, apply_reserve). Shared into helios/src/runtime_core/memory.rs:28,185,202, where budget() now calls host_reserve_bytes (the local 2 GiB integrated_host_bytes is deleted) and integrated_offload_host_budget (:194-221) honours an explicit --memory-limit without implicit reserves (MemoryLimit::Reserve(r) → free.min(total) − r − future). NativeModel::allocate_caches now returns Result<Option<u64>> (memory.rs:1102-1112, planned offload host budget; capture → tier_host.max(chain_bytes) where chain = (pages + row_slots) * page_record_bytes, else tier_host − cfg.memory_bytes), which prepare_offload (model.rs:906-918) forwards to prepare_with_inputs_budget (model.rs:967-975). host_pool_budget_with_reserve's apply_reserve=false path has no caller at head (only host_pool_budget passes true).

5. HOST_NUMA fallback. New try_map_device_host_parts returns Ok(None) only when cuDeviceGetAttribute(HOST_NUMA_ID), cuMemGetAllocationGranularity, cuMemCreate or cuMemSetAccess returns status 1 (CUDA_ERROR_INVALID_VALUE) or 801 (CUDA_ERROR_NOT_SUPPORTED); every other status flows through driver.check, so OOM still fails startup (helios/src/cuda.rs). HostRegistrar::try_map_split has a default implementation that calls map_split and wraps it in Some (selene/src/registrar.rs:28-37), so pool/builder, ClosedRegistrar (selene/src/pool/startup.rs:223-230), IdentityRegistrar/TrackingRegistrar and selene-manager tests keep propagating Err. Only CudaRegistrar::try_map_split (helios/src/offload/registrar.rs:31-37) forwards to the new path, and SlabPool::try_sized_by_rank (selene/src/slab.rs:160-268) returns Ok(None); the memory-only branch of prepare_with_inputs_budget (selene/src/offload.rs:~600-645) then does SlabPool::sized(...) + register(registrar, context). map_device_host_parts and sized_by_rank keep their names but now emit new messages ("HOST_NUMA virtual memory allocation is not supported on this device or driver"; "split host mapping is not supported on this host"). Rank>1 wrinkle: headroom_with_inputs_for_budget charges mapped.div_ceil(512) where mapped = (pinned + intake).div_ceil(ranks) only when there is no disk and no pool (offload.rs:187-199) — exactly the memory-only case that can now fall back to a replicated registered mapping that every device maps at 1/512 of the whole pool (slab.rs:186-199, docs/prefix-cache-offload.md:520-535), so for ranks > 1 the fallback maps up to ranks× the device bytes charged. Identical for ranks == 1 (Jetson Orin single GPU, single-GPU WDDM).

6. Eos THP ordering (eos/src/unix.rs:85-120). Before: mmap(MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE) then madvise(MADV_HUGEPAGE). After: no MAP_POPULATE; MADV_HUGEPAGE first; then MADV_POPULATE_WRITE (success only on return 0) with a page-stride write_volatile(0) fallback. MADV_POPULATE_WRITE needs Linux ≥5.14; older kernels get EINVAL and use the userspace loop — correct, but no longer a single kernel-side prefault. eos/src/windows.rs:166 (not opened) unchanged. map_host backs SlabPool::new (selene/src/slab.rs:162-178).

Bundling. The three parts have separate root causes, separate verification burdens and disjoint blast radius; the only cross-PR overlap (#497, #323) touches part 4/6 only, so all rebase cost lands there, and the "Unrun checks" paragraph admits the gap for all three at once.


The why



Recent activity


People

Community

Project fit


Claims and evidence

Backed (per PR body; CI on aed8039 green):

Not backed / cannot be:

Reach

Process


Open questions / not found