Repository navigation
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
Draft
original-el8 wants to merge 2 commits into
original-el8 wants to merge 2 commits into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
MappedHostVMAs + Linux THP (MADV_HUGEPAGE) and 2 MiB pre-faulting: Reduces host/device allocation time for large host-tiered models and increases hugepage coverage beforecuMemHostRegister_v2pins pages.barrier_handle == 0, grouped 16-tile vocabulary logprobs kernels, discrete GB300 worker memory sizing (704 MiB,1 GiBreserve cap), subprocess Inductor thread partitioning, and pre-capture host/CUDA cache release.Changes
helios/src/runtime_core/mod.rs: coalesce contiguous fixed UnixMappedHostspans with matching registration flags into sharedmmapregions, apply best-effortMADV_HUGEPAGE, pre-fault at 2 MiB stride in allocation order beforecuMemHostRegister_v2, and cleanly unregister/unmap once on teardown.ignition/preparation/core_storage.py: apply best-effort LinuxMADV_HUGEPAGEonHostRegion.helios/src/scheduler/cost.rs,helios/src/scheduler/rounds.rs,helios/src/scheduler/planning_tests.rs: addObservationStatecold-start discard (scoped toGraphKind::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_pairTriton kernel,_TILE_GROUP = 16logprobs 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.SM103) loading a 64-layer 307 GiB host-tiered Ergo package viaflare run: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).Compatibility and Limitations
PreparedContractschemas.MADV_HUGEPAGEhinting and 2 MiB pre-faulting apply to Linux only; integrated-GPUmlock, multi-node barrier readiness, and Windows host-mapping paths were not executed on hardware.