Skip to content

Coalesce mapped host VMAs for THP, harden speculative cost/forecast tracking, and update GB300 AOT compile pool - #710

Draft
original-el8 wants to merge 2 commits into
mainfrom
feat/gb300-tiered-runtime
Draft

original-el8 wants to merge 2 commits into
mainfrom
feat/gb300-tiered-runtime

Conversation

@original-el8

Copy link
Copy Markdown
Collaborator

Summary

Shared Helios and Ignition runtime/preparation improvements for single-GPU NVIDIA GB300 (SM103) host-tiered serving and AOT preparation, kept model-agnostic with no changes to package wire contracts:

  1. Coalesced MappedHost VMAs + Linux THP (MADV_HUGEPAGE) and 2 MiB pre-faulting: Reduces host/device allocation time for large host-tiered models and increases hugepage coverage before cuMemHostRegister_v2 pins pages.
  2. Speculative cost and confidence forecast hardening: Prevents cold-start first-sample spikes or contradicted narrower shapes from locking out faster speculative siblings, and keeps deep GPU confidence forecasts updated during narrow rounds without calibrating unverified depths.
  3. Ignition readiness, logprobs, and GB300 AOT compile-pool updates: Single-launch timestamp-pair readiness kernel when barrier_handle == 0, grouped 16-tile vocabulary logprobs kernels, discrete GB300 worker memory sizing (704 MiB, 1 GiB reserve cap), subprocess Inductor thread partitioning, and pre-capture host/CUDA cache release.

Changes

  • helios/src/runtime_core/mod.rs: coalesce contiguous fixed Unix MappedHost spans with matching registration flags into shared mmap regions, apply best-effort MADV_HUGEPAGE, pre-fault at 2 MiB stride in allocation order before cuMemHostRegister_v2, and cleanly unregister/unmap once on teardown.
  • ignition/preparation/core_storage.py: apply best-effort Linux MADV_HUGEPAGE on HostRegion.
  • helios/src/scheduler/cost.rs, helios/src/scheduler/rounds.rs, helios/src/scheduler/planning_tests.rs: add ObservationState cold-start discard (scoped to GraphKind::Speculative), mark contradicted single-sample or >10%-slower strictly narrower siblings stale for funded refresh, separate deep GPU confidence forecast updates from realized acceptance calibration, and add unit tests.
  • ignition/components/readiness.py, ignition/components/logprobs.py, ignition/preparation/{aot,capture,compile_pool}.py, tests/preparation/test_forward_compile_options.py: add _timestamp_pair Triton kernel, _TILE_GROUP = 16 logprobs tiling, GB300 compile-pool sizing and thread partitioning, pre-capture cache release, and updated unit tests.

Validation

  • cargo test --manifest-path helios/Cargo.toml --lib: 755 passed, 0 failed, 4 ignored.
  • cargo build --release --manifest-path flare-cli/Cargo.toml: clean release build.
  • pytest tests/preparation/test_forward_compile_options.py tests/preparation/test_forward_cache_sources.py: 12 passed.
  • Live serving on 1x NVIDIA DGX Station GB300 (SM103) loading a 64-layer 307 GiB host-tiered Ergo package via flare run:
    • Startup host/device allocation time: 41.0 s -> 13.9 s (-66%).
    • AnonHugePages: 14.5 GiB (4.6%) -> 64.5–91.5 GiB (21–30%) (bounded by available 512 MiB order-13 buddy blocks on the tested ARM64 host).
    • Speculative width-8 round time reduced by ~17%.

Compatibility and Limitations

  • No changes to package wire format, execution ABI, or PreparedContract schemas.
  • MADV_HUGEPAGE hinting and 2 MiB pre-faulting apply to Linux only; integrated-GPU mlock, multi-node barrier readiness, and Windows host-mapping paths were not executed on hardware.

Single-GPU SM103 preparation and serving require CUDA-graph-safe GPU timestamp
instrumentation without a redundant second launch when no collective barrier is
present, lower per-worker discrete GPU memory estimates for GB300 compiler
workers, parallel Inductor thread allocation across CompilePool subprocesses,
grouped vocabulary tiles in logprobs kernels, and explicit host/CUDA cache
release before graph capture.

What changed:
- ignition/components/readiness.py: added the _timestamp_pair Triton kernel so
  wait_for_readiness writes both post-wait timestamps in one launch when
  barrier_handle is zero.
- ignition/components/logprobs.py: grouped 16 vocabulary tiles per Triton
  program (_TILE_GROUP = 16) in _statistics and _candidates to reduce grid size
  and launch overhead on large vocabularies.
- ignition/preparation/compile_pool.py, ignition/preparation/aot.py, and
  ignition/preparation/capture.py: sized discrete compiler workers at 704 MiB
  with a 1 GiB compile reserve cap, partitioned inner Inductor compile threads
  across workers with worker_start_method="subprocess", allowed parent-side
  compile_threads up to 24, and called release_unused() and
  torch.cuda.empty_cache() before CUDA graph capture.
- tests/preparation/test_forward_compile_options.py: updated compile_threads
  and worker_start_method assertions to match the CompilePool options.

Claimed benefit and result:
Enables multi-worker AOT compilation under tight discrete HBM budgets on NVIDIA
GB300 and reduces pre-capture memory fragmentation and logprobs/readiness
launch overhead while keeping Helios model-agnostic.

Supporting evidence and limitations:
Validated with pytest tests/preparation/test_forward_compile_options.py
tests/preparation/test_forward_cache_sources.py (12 passed) and end-to-end
GB300 SM103 preparation and Flare serving of 64-layer Ergo packages. Multi-node
collective barrier readiness paths were not exercised on hardware.

Design-Signed-Off-By: Jason Cook; design-review=2e5b
…t tracking

Models that tier large weight tables in Grace/host unified memory over
NVLink-C2C register dozens to hundreds of contiguous MappedHost allocations
via mmap and cuMemHostRegister_v2. Registering each allocation as a separate
VMA without MADV_HUGEPAGE or userspace pre-faulting causes cuMemHostRegister_v2
to pin 64 KiB base pages that khugepaged cannot promote, splits hugepage
alignment boundaries across allocations, and takes ~41 s to allocate 307 GiB.
Separately, in Helios's speculative scheduler, narrow speculative rounds skipped
updating GPU confidence forecasts beyond the verified prefix length, and
cold-start or stale single-sample/narrower speculative cost observations could
lock out faster sibling shapes until the full freshness TTL elapsed.

What changed:
- helios/src/runtime_core/mod.rs: coalesced contiguous fixed Unix MappedHost
  allocations with matching registration flags into shared mmap spans tracked
  in host_mappings, applied best-effort Linux MADV_HUGEPAGE, pre-faulted mapped
  pages at 2 MiB stride in package allocation order before cuMemHostRegister_v2
  (with full unmap cleanup on error), and unregistered and unmapped each
  coalesced span once on teardown.
- ignition/preparation/core_storage.py: applied best-effort Linux MADV_HUGEPAGE
  to HostRegion allocations.
- helios/src/scheduler/cost.rs: added ObservationState tracking to Estimate
  (scoped to Speculative graphs) so cold-start first-sample spikes are
  discarded on fast follow-up replays and contradicted single-sample or
  >10%-slower strictly narrower confirmed siblings in the same batch are marked
  stale for funded refresh while retaining their ranking cost until refreshed.
- helios/src/scheduler/rounds.rs: separated GPU confidence forecast observation
  across all step.draft_tokens depths from realized acceptance calibration
  bounded to lane.tokens - 1.
- helios/src/scheduler/cost.rs and helios/src/scheduler/planning_tests.rs:
  added unit tests covering cold-start discard, contradicted sibling refresh,
  and deep confidence forecast updates without calibrating unverified depths.

Claimed benefit and result:
On 1x NVIDIA GB300 serving a 64-layer 307 GiB host-tiered Ergo package with
flare run, measured startup host/device allocation time dropped from 41.0 s to
13.9 s (-66%), AnonHugePages rose from 14.5 GiB (4.6%) to 64.5-91.5 GiB
(21-30%, reaching the host's available 512 MiB order-13 buddy blocks), cutting
speculative width-8 round time by ~17%, and speculative cost/forecast updates
avoid cold-start lockouts without extra steady-state allocations or
model-specific branching.

Supporting evidence and limitations:
Validated with cargo test --manifest-path helios/Cargo.toml --lib (755 passed,
0 failed, 4 ignored), cargo build --release --manifest-path flare-cli/Cargo.toml,
pytest tests/preparation/test_forward_compile_options.py
tests/preparation/test_forward_cache_sources.py (12 passed), and live GB300
serving via flare run. Material limitations: transparent hugepage hinting and
2 MiB pre-faulting apply to Linux only; on the tested ARM64 host, sub-512 MiB
mTHP sizes were set to never in sysfs so AnonHugePages remained bounded by free
512 MiB order-13 buddy blocks; integrated-GPU mlock and Windows host-mapping
paths were not executed on hardware.

Design-Signed-Off-By: Jason Cook; design-review=2e5b
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.

1 participant