Skip to content

Library seams for export and load: address-width check, explicit device window, no-identity export - #297

Merged
lukealonso merged 3 commits into
NVIDIA:mainfrom
gmbuell:pr/library-seams
Nov 14, 2026
Merged

lukealonso merged 3 commits into
NVIDIA:mainfrom
gmbuell:pr/library-seams

Conversation

@gmbuell

@gmbuell gmbuell commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Why: using export_capture and Helios's loader as a library on a GPU outside the platform table currently means patching Hyperflare:

  • Under WDDM, a fixed reservation beyond the GPU's address space hangs cuMemAddressReserve. That is the hang docs/windows.md records for RTX Spark, and the default 4 TiB device window triggers it on a 1 TiB GPU.
  • The device window can only be moved by editing constants.
  • Export fails when the PCI id names no platform.

What:

  1. Export and load check each fixed reservation against the address width WDDM reports (KMTQAITYPE_QUERY_GPUMMU_CAPS). A reservation that doesn't fit fails with an error instead of hanging.
  2. CoreStorage(device_window=(base, extent)) takes an explicit, validated window. The defaults are unchanged.
  3. The capture request takes device_identity: "none", which exports an unknown-device core that claims no platform. The default stays "required".

Evidence (Windows 11, RTX 3090 (SM86, unsupported), with #293 and #294):

  • With the default window, export now fails in 0.02 s instead of hanging.
  • A 13-graph export with an explicit window and no identity loads in a separate process and replays bit-identically.
  • The heliopause suite passes (168 tests), apart from one failure that also occurs without these changes.

Not tested: supported GPUs, Linux, flare run with an unknown-device core, and whether RTX Spark reports 44 bits.

🤖 Generated with Claude Code

gmbuell and others added 3 commits November 14, 2026 10:16
Under WDDM, cuMemAddressReserve with a fixed address beyond the GPU's
virtual address space does not return. docs/windows.md records this for
host reservations at 16 TiB and 32 TiB on RTX Spark N1X. The same hang
occurs for Heliopause's default Windows device window (4 TiB, 1 TiB per
rank) on a GPU whose WDDM address space is 1 TiB. Export and load then
stall inside the driver without an error, and the process must be
killed. WDDM reports the address width per adapter, so a reservation
that cannot fit can be rejected before it is requested.

helios/src/runtime_core/address_space.rs adds virtual_address_bits,
which maps a CUDA device to its WDDM adapter (cuDeviceGetLuid, then
D3DKMTOpenAdapterFromLuid) and returns the VirtualAddressBitCount that
D3DKMTQueryAdapterInfo reports for KMTQAITYPE_QUERY_GPUMMU_CAPS. It also
adds check_fits, which rejects a range ending beyond 2^bits. Outside
Windows, or when the query fails, the width is unknown and nothing is
rejected. Helios checks each core reservation and each Windows host
reservation before reserving it; Heliopause checks every rank's device
window in flare_core_initialize. A reservation that fits behaves as
before. docs/windows.md describes the check and what it does not cover:
Linux, and Ignition's own host-region reservations during export.

Result: on a GPU whose address space cannot hold a fixed window, export
and load fail immediately with an error that names the reservation and
the width, instead of hanging.

Evidence, on Windows 11 build 26200 with an RTX 3090 (SM86, not a
supported GPU; WDDM reports 40 bits) and NVIDIA driver 621.01:
- heliopause's reports_the_device_address_width (ignored by default; run
  with --include-ignored) prints 40 bits for device 0, read through the
  CUDA LUID to adapter mapping.
- CoreStorage() with the default Windows window fails after 0.02 s:
  "native core device window 0x40000000000+0x10000000000 exceeds the
  GPU's 40-bit virtual address space". Without this check the same call
  does not return. This ran on a tree that also contains the explicit
  device window and device identity changes that follow and NVIDIA#293/NVIDIA#294,
  which Windows builds and exports need.
- With the check active, the Helios loader loaded a 15.5 GiB core
  exported at 256 GiB, and an existing core, and replayed all 13 of each
  one's graphs bit-identically to the export.
- heliopause's library suite passes except
  sync_parent_normalizes_a_relative_basename, which fails with "Access is
  denied" with and without this change. check_fits's unit test is in
  Helios, whose library tests do not compile on Windows
  (execution/roce_fabric.rs uses std::os::unix); it was not run.
Not tested: any supported GPU. Whether RTX Spark N1X reports 44 bits,
which would explain the 16 TiB host hang, is unverified.

Design-Signed-Off-By: Claude Opus 5.5 (Claude Code); design-review=ed22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Garret Buell <gmbuell@gmail.com>
Heliopause places each rank's fixed device window at a compile-time
base: 4 TiB on Windows, 8 TiB on Linux, 1 TiB per rank. A caller whose
GPU address space ends below that base cannot export, and with the
preceding address-width check it now fails with an explicit error
instead of hanging. The only remedies were to patch the constants in
heliopause/src/allocator.rs and ignition/preparation/core_storage.py,
or to add an environment override, which docs/design-review.md
principle 10 prohibits. An explicit, typed argument lets a caller that
drives CoreStorage and export_capture as a library place the window
where the device can reserve it.

CoreStorage gains a keyword argument, device_window=(base, extent).
Rank r's window is then base + r * extent, extent bytes long; omitted,
the defaults (DEVICE_BASE, RESERVATION_BYTES) apply as before. The base
must lie at or above EXTERNAL_FLOOR and the extent must be nonzero,
checked before CUDA is touched. Heliopause adds
flare_core_initialize_window(rank, world, device, base, extent), and
flare_core_initialize now calls it with the platform defaults. It
rejects empty or overflowing windows, windows that are not aligned to
the allocation granularity (the extent to twice it, since its halves
serve the pool and persistent storage), and windows that overlap the
host ranges. With the default window the overlap condition is the same
as before. Host ranges keep their 1 TiB per rank stride, now named
HOST_RESERVATION_BYTES in CoreStorage, and host bounds no longer depend
on the device extent. docs/windows.md documents the argument.

Result: on a GPU whose address space cannot hold the default window,
export works with a window the caller chooses. Recipes and callers that
do not pass device_window see no change.

Evidence, on Windows 11 build 26200 with an RTX 3090 (SM86, not a
supported GPU) and NVIDIA driver 621.01, on a tree that also contains
the device identity change that follows and NVIDIA#293/NVIDIA#294:
- CoreStorage(device_window=(0x4000000000, 0x1000000000)) initializes.
  Windows below EXTERNAL_FLOOR and empty windows raise ValueError.
- A core export with that window captured 13 CUDA graphs (15.5 GiB
  mapped), and a separate process loaded the core through Helios and
  replayed all 13 bit-identically to the export.
- heliopause's library suite passes, including
  explicit_device_windows_are_validated, except
  sync_parent_normalizes_a_relative_basename, which fails with "Access is
  denied" with and without this change.
- tests/preparation/test_core_storage.py passes on Windows (8 tests,
  including the two device-window cases); its Linux layout test was
  skipped.
Limits: the caller chooses a window that WDDM's own per-process
placements leave free. One of four loads of that core failed with an
address collision at the window base; the other three succeeded. No
supported GPU or Linux system was tested.

Design-Signed-Off-By: Claude Opus 5.5 (Claude Code); design-review=ed22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Garret Buell <gmbuell@gmail.com>
Heliopause's capture export names every core after the platform that the
capture GPU's PCI id maps to in helios/src/core/naming.rs. It fails when
the id maps to none ("NVML reports unsupported GPU PCI id"). A program
that drives export_capture as a library on a development or test GPU
outside that table therefore cannot export at all, unless it adds the GPU
to the platform table, which would present it as a supported platform.
Helios already defines cores without a device identity: they load,
their cache entries use the unknown-device label
(naming::unknown_device_candidate), and Flare's catalog and hub, which
filter on naming::PLATFORMS, never list them as a supported platform.
Export is the one path that cannot produce such a core.

The capture request gains device_identity. "required", the default,
keeps the current behavior: the PCI id must name a platform. "none"
skips the lookup and records no platform. Export then names the core
with the existing unknown-device scheme:
- signed hardware_identity "unknown-device" (the schema requires a
  nonempty value);
- deployment unknown-device-tp<N>, unless the cluster supplies an
  export id;
- cache entry unknown-device-tp<N>-<UTC minute>, from
  deployment_candidate(None, ...).
No request field can name a platform, so a capture is either identified
by its hardware or claims none. docs/core-format-design.md describes the
field.

Result: export_capture can export on a GPU outside the platform table,
and the resulting core is marked as claiming no platform. Requests that
omit the field behave as before.

Evidence, on Windows 11 build 26200 with an RTX 3090 (SM86, PCI id
outside the platform table) and NVIDIA driver 621.01, on a tree that
also contains the two preceding changes and NVIDIA#293/NVIDIA#294:
- device_identity_defaults_to_required_and_accepts_none: an omitted field
  and "required" parse as Required, "none" as None, other values are
  rejected.
- A capture export with device_identity "none" and an unmodified
  platform table produced a core whose deployment is unknown-device-tp1,
  cache entry unknown-device-tp1-202611141806. A separate process loaded
  it through Helios's VerifiedCore and NativeResources and replayed all
  13 graphs bit-identically to the export.
- heliopause's library suite passes except
  sync_parent_normalizes_a_relative_basename, which fails with "Access is
  denied" with and without this change.
Not tested: the "required" path was not re-run, though it is the
unchanged call to current_platform. flare run, the catalog, and the hub
were not exercised with an unknown-device core.

Design-Signed-Off-By: Claude Opus 5.5 (Claude Code); design-review=ed22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Garret Buell <gmbuell@gmail.com>
@gmbuell
gmbuell marked this pull request as ready for review November 14, 2026 18:23
@lukealonso
lukealonso merged commit d5c2bd1 into NVIDIA:main Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants