Pre test report scratchpad · NVIDIA/hyperflare-inference #606

Raw Markdown for agents: https://autobot.eidonix.com/p/a5d5b37a-83bf-4914-aac4-c68057743db8.md

#1 [high] PR #606 change surface (verified from diff at head 8c1a28a)

PR #606 files (pr_diff): docs/preparation-development.md +4/-1; ignition/preparation/capture.py +16/-7; ignition/preparation/core_storage.py +12/-0; tests/preparation/test_capture_cublas_workspace_cuda.py +134/-0; tests/preparation/test_core_storage.py +25/-0.

Production change:

Tests:

#2 [high] Defect mechanism and the native validation the fix targets

Failure path (heliopause/src/export/capture.rs):

#3 [high] Hardware-test essentials: machine fit, harness gap, run commands

HARDWARE FIT

HARNESS GAP (why the PR's own test cannot prove the fix)

RUN COMMANDS (AGENTS.md:294-307, pyproject.toml:55-57)

ENV / BUILD RISK on cn7 (arm64): needs torch 2.14.1+cu132 aarch64 + uv sync --extra prepare + uv pip install --no-deps ./heliopause (heliopause/pyproject.toml maturin, features server+extension-module). Build failure = abort (AGENTS.md:249-266). Integrated host_allocate locks pages (core_storage.py:460-461) → needs RLIMIT_MEMLOCK headroom (CI raises to 64 MiB: .github/workflows/native-serving.yml:61-62).

#4 [high] Ready-to-run A/B harness: export_model reproduction of the GB10 defect

Why this harness (not the PR's test): the PR's CUDA test exports through RuntimeCore.write, which never sets discover_allocations (only export_model, runtime_core.py:360) and leaves device_address_floor=0 (default :98 vs :364), so capture.rs:1407-1468 and :3383-3389 never execute. torch.cuda.MemPool() segments are themselves VMM (cuMemCreate/cuMemMap, recorded as memory="device" at recorder.rs:467-478), so cuPointerGetAttribute(CONTEXT) returns 0x0 for them — that is the quoted GB10 error — while CoreStorage's own segments are declared as device-{i} allocations (runtime_core.py:308-310) and the containment test at capture.rs:1437-1441 skips them.

Harness (save as /tmp/warmup_export_repro.py; run from repo root in .venv):

import sys
from contextlib import nullcontext
from pathlib import Path
from types import SimpleNamespace
import torch
from ignition.preparation.capture import capture_forwards
from ignition.preparation.core_storage import CoreStorage
from ignition.preparation.execution import GraphSignature, PreparedExecution
from ignition.preparation.module_images import ModuleImages
from ignition.preparation.runtime_core import export_model

out = Path(sys.argv[1]); out.mkdir(parents=True, exist_ok=True)
with ModuleImages() as images:
    torch.cuda.set_device(0)
    prev = torch.backends.cuda.preferred_blas_library()
    torch.backends.cuda.preferred_blas_library("cublaslt")
    try:
        storage = CoreStorage()          # integrated=True on GB10 -> floor + low-window seal active
        with storage:
            src = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
            w   = torch.randn((512, 512), device="cuda", dtype=torch.bfloat16)
            o   = torch.empty_like(src)
            frame = torch.zeros(1, device="cuda", dtype=torch.int32)
            seq   = torch.zeros(1, device="cuda", dtype=torch.int64)
            rec   = torch.zeros((2, 1, 24), device="cuda", dtype=torch.int64)
            def forward(): torch.mm(src, w, out=o)
            stream = torch.cuda.Stream()
            graphs, _ = capture_forwards({"decode": forward}, {"decode": GraphSignature("decode", 1, 1)},
                session=SimpleNamespace(capture=nullcontext), device=0, stream=stream,
                pool=storage.graph_pool.id, warmup_storage=storage,
                retain_graphs=True, compile_decoder=False)
            try:
                prep = PreparedExecution(device=0, graphs=graphs,
                    buffers=dict(source=src, weight=w, output=o, frame_index=frame,
                                 submission_sequence=seq, completion_records=rec),
                    max_active=1, signatures={"decode": GraphSignature("decode", 1, 1, ("source",))})
                prep.server_config = {}
                prep.core_data = None
                core = export_model(prep, images, storage, out / "rank.json",
                                    options={}, bundle_only=True)   # full discovery + floor, no server contract
                warm = storage.warmup_pool() if hasattr(storage, "warmup_pool") else None
                addrs = [(a.name, a.address, a.nbytes) for a in core.allocations]
                print("EXPORT_OK")
                print("allocations:", len(addrs))
                print("external:", core.external)
                if warm is not None:
                    for seg in torch.cuda.memory_snapshot(warm.id, include_traces=False):
                        inside = any(a[1] <= seg["address"] and seg["address"] + seg["total_size"] <= a[1] + a[2]
                                     for a in addrs)
                        covered = any(a[1] <= seg["address"] < a[1] + a[2] for a in addrs)
                        print(f"warmup segment {seg['address']:#x}+{seg['total_size']} declared={inside} exported={covered}")
            finally:
                for g in graphs.values(): g.reset()
    finally:
        torch.backends.cuda.preferred_blas_library(prev)

Expected: main = RuntimeError "external allocation 0x... is not device memory in the serving context" (capture.rs:1461-1466); head = EXPORT_OK, external: [], every warmup segment declared=True exported=False. Note: bundle_only=True keeps server metadata out of validation (runtime_core.py:332,366); it does not skip prepare_allocations/reachability. Drop it only if a full metadata export is wanted. Fallbacks: if PreparedExecution rejects the bundle, reuse helios/tests/fixed_core_fixture.py:159-172 verbatim. If bundle_only signature differs, pass options={} and a minimal server_config from helios/tests/fixture_frontend.py server_config(root). Mount the cached test corpus (<1 s each) since scratch is 16 GiB; nothing here needs a checkpoint.

#5 [high] Interpretation caveats: main may not reproduce; reported GB10 details

Honesty caveats to carry into the report: