Correctness report · NVIDIA/hyperflare-inference #589

Raw Markdown for agents: https://autobot.eidonix.com/p/634b4bb0-c9e3-4c28-95a2-0b27137eacc5.md

PR #589 correctness review

Scope: every changed file read in context through the Correctness lens — selene/src/offload.rs, selene/src/offload/tests.rs, selene/src/registrar.rs, selene/src/slab.rs, selene/src/pool/builder.rs, selene/src/pool/startup.rs, helios/src/cuda.rs, helios/src/offload/{mod,registrar,transfer}.rs, helios/src/runtime_core/{memory,model}.rs, helios/src/execution/roce.rs, helios/src/frontend/mod.rs, helios/native/roce_proxy_dlopen.c, helios/build.rs, .github/workflows/release.yml (not opened), eos/src/unix.rs, and the four Cargo.toml diffs.

Judged against the project charter: "Supported matrix & compatibility: check interactions across every supported model, cache scheme, parallel layout, multi-host setup, and hardware target named in the docs"; "Bug fixes need to address the root cause; don't just swallow, skip, or retry an unexplained error (#397)"; "Bring real evidence".

Key findings

No blocking defect. Two should-fix items, both in the new lazy-libibverbs/CUDA-12 code paths, and two documentation/error-reporting nits. The Selene budgeting rework — the part of the PR with the largest blast radius — checks out end to end: the budget the planner consumes and the budget prepare_offload later receives are the same number, in both capture and non-capture configurations, and the HOST_NUMA fallback leaks nothing and does not swallow real errors.


Should fix

FLARE_LOAD_IBV(query_port, "ibv_query_port", "IBVERBS_1.1") makes flare_ibv_init dlclose and abort with "libibverbs.so.1 is missing required symbol ibv_query_port" (macro at lines 72-82) whenever libibverbs does not export the un-prefixed name.

Why the un-prefixed export is not what the proxy needs:

Effect: RoceTransport::open (helios/src/execution/roce.rs:191-195) fails with "RoCE transport setup failed: libibverbs.so.1 is missing required symbol ibv_query_port" on such hosts, i.e. multi-host RoCE serving is dead while single-host serving looks fine.

Fix: delete that FLARE_LOAD_IBV line (the trampoline reimplements the function through verbs_get_ctx_op / _compat_ibv_port_attr), or make flare_ibv_sym fall back to ___ibv_query_port for this one symbol.

Why the PR's evidence does not cover it: the new test lazy_libibverbs_loader_resolves_symbols_or_reports_install_hint (helios/src/execution/roce.rs:511-521) only asserts that a failure message contains libibverbs.so.1 and libibverbs1 — a missing-symbol message contains both, so it passes whether the load succeeds or fails. The release smoke checks (.github/workflows/release.yml:110-121 (not opened)) run only flare --version and {run,agent,orbit} --help, never an actual transport open, so CI would not notice either. That is precisely the "bring real evidence" gap.

Settled by: nm -D --defined-only libibverbs.so.1 | grep query_port inside ubuntu:22.04 and ubuntu:24.04 (rdma-core), ideally added to the release verification step.

2. helios/src/cuda.rs:532-537 — CUDA_ERROR_INVALID_VALUE is read as "feature unsupported"

is_host_numa_unsupported accepts status 1 or 801, and it is applied to four different calls inside try_map_device_host_parts:

Status 1 is also how CUDA reports genuinely invalid arguments — a part larger than the driver's maximum single allocation, or properties/granularity that the driver rejects. Those requests are now silently downgraded to SlabPool::sized + portable cuMemHostRegister_v2 (selene/src/offload.rs:631-638), whose mapping the driver aliases into every device at roughly 2 MiB per GiB — the exact cost the split pool exists to avoid (selene/src/slab.rs:254-260). The doc comment immediately below (:539-544) and the PR description ("real errors such as OOM propagate unchanged") overstate what holds: only non-INVALID_VALUE errors propagate.

Fix: restrict the fallback to CUDA_ERROR_NOT_SUPPORTED (801), and for the WDDM/GA10B case probe capability once (host-NUMA attribute + granularity) before reserving, rather than reading INVALID_VALUE as an answer about capability. Confirming which status WDDM/GA10B actually returns needs a Windows or Jetson run; that run should also confirm the granularity path returns 801 rather than 1.

Nits

3. helios/src/frontend/mod.rs:1400-1402 — stale budget documentation

The comment justifies post-sizing tokenizer allocations with "HOST_SERVICE_HEADROOM_BYTES (2 GiB) plus one twentieth of total memory". After this PR the reserve is host_service_headroom_bytes(total) — 64 MiB at ≤ 16 GiB, min(2 GiB, total/32) above (selene/src/offload.rs:808-814), plus total/20 (:818-820). On an 8 GiB Jetson the real margin is ~470 MiB, so the stated headroom is off by ~2 GiB. Update the prose (and the same claim, if repeated, in docs/prefix-cache-offload.md (not opened)).

4. helios/src/runtime_core/memory.rs:213-219 — the explicit-limit arm saturates instead of reporting

For MemoryLimit::Bytes/Fraction, physical.min(cap.saturating_sub(loaded.saturating_add(future))) (:216) collapses the offload host budget to 0 when the cap cannot hold resident resources, and headroom_with_inputs_for_budget then floors intake at intake_slots(layout, 1) (selene/src/offload.rs:174-177). A misconfigured --memory-limit therefore yields a sliver of intake rather than the loud diagnostic the KV path produces ("memory limit is {cap} bytes, but loaded model resources require {required} bytes", memory.rs:294-296). Use checked_sub and the same message.


Verified clean (candidates I traced and dropped)

Open questions / could not verify

  1. Does stock rdma-core libibverbs export the un-prefixed ibv_query_port? Finding 1 turns on this; only nm -D inside the target container settles it, and no CI step performs a transport open.
  2. allocate_caches reads options.prefix_cache.memory_bytes (memory.rs:831) while planned_offload_host subtracts cfg.memory_bytes (:1109). If cfg can hold a resolved value different from options.prefix_cache (for example after a shard or disabled-cache adjustment), the plan and prepare budgets diverge. I could not show a path where they differ from the code I read; a one-line check or a shared accessor would close it.
  3. Unverified on hardware, as the PR itself states: native aarch64 build and the ubuntu-24.04-arm job, real cuMemcpyAsync behaviour on pinned host pointers under CUDA 12.x drivers, and the exact status codes GA10B / Windows WDDM return for HOST_NUMA VMM (Finding 2).