Repository navigation
Accelerate multi-host rank export transfer and check disk space up front - #588
Draft
FujitsuPolycom wants to merge 2 commits into
Draft
FujitsuPolycom wants to merge 2 commits into
FujitsuPolycom wants to merge 2 commits into
Conversation
Why: Native export repeats CUDA driver symbol and kernel parameter queries across graphs, scans captured weight blocks serially, and serializes executable resource compression during publication. What: Before: Heliopause repeated CUDA symbol and kernel parameter lookups per graph, scanned weight blocks sequentially, and compressed executable resources one at a time. After: Heliopause caches resolved driver symbols and kernel parameter layouts per recording session (invalidating on module unload or context teardown), scans weight blocks in parallel, streams large weight groups into verified cache companions, and compresses executable resources in memory-bounded batches (`IN_MEMORY_BATCH_BYTES = 64 MiB` cumulative plaintext per batch, scaled down by `/proc/meminfo` `MemAvailable` and falling back to zero-batch streaming below `512 MiB` headroom) while writing in capture order. Result: Native export reduces repeated driver queries and overlaps executable compression with archive writes while bounding transient batch plaintext memory to at most two 64 MiB batches (`128 MiB`). Evidence: - `cargo test --locked --release --manifest-path heliopause/Cargo.toml --lib -- --test-threads=1`: 216 passed, 5 ignored, 0 failed. - `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib core::export -- --test-threads=1`: 36 passed, 1 ignored, 0 failed. - `python -m pytest -q -rs tests/preparation/test_core_boundary.py tests/test_design_review_hook.py`: 22 passed. - Live CUDA recording, signed-core serving, and isolated export throughput remain unverified on this revision. Discord: Dooner Design-Signed-Off-By: Antigravity (Gemini 4); design-review=c3a9 Signed-off-by: FujitsuPolycom <[email protected]>
Why: Multi-host `ignition export` can exhaust disk space after GPU preparation, stalls peer transfers behind rank zero's local export, and re-reads verified companion files during cache adoption. What: Before: Ignition ran preparation without checking host disk space, rank zero finished local export before receiving peer payloads, and companion installation re-hashed verified files. After: Ignition checks free staging and cache bytes up front, deducting only verified planned checkpoint blobs (`sha256_hex` and byte length) or signed `CoreEnvelope` weight payloads matching model identity, TP width, `i32` compute-capability architecture, and exact `checkpoint_revision`, reserving hard `UsageError` failures for `free_bytes < net_weights` while warning on heuristic executable margins. Rank zero overlaps peer reception with local export, aborts wake blocked peers and release descriptors, and Linux cache adoption links verified companions by inode/header. Result: Defensible weight-capacity shortfalls fail before GPU preparation without false deductions from unrelated revisions, while rank transfer overlaps with local export and avoids redundant companion reads. Evidence: - `python -m pytest -q -rs tests/preparation/test_core_boundary.py tests/test_design_review_hook.py tests/cli/test_export_disk_preflight.py tests/preparation/test_host_ranks.py tests/preparation/test_checkpoint_source.py`: 82 passed. - `cargo test --locked --release --manifest-path heliopause/Cargo.toml --lib -- --test-threads=1`: passed, 0 failed. - `cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib core::cache -- --test-threads=1`: 101 passed, 1 ignored, 0 failed. Discord: Dooner Design-Signed-Off-By: Antigravity (Gemini 4 Carbon); design-review=c3a9 Signed-off-by: FujitsuPolycom <[email protected]>
voipmonitor
reviewed
Nov 28, 2026
voipmonitor
left a comment
Collaborator
There was a problem hiding this comment.
Draft Review & Build/Test Report (commit 1c0d47b7, stacked on #585)
Verdict: Do not merge — fails to compile flare-heliopause (E0277), stacked on #585, and introduces a cache verification bypass plus disk-preflight and concurrency bugs.
Build & Automated Test Results
- Python
pytest -q tests/cli/test_export_disk_preflight.py tests/preparation/test_host_ranks.py— 23 passed, 0 failed (note:test_export_disk_preflight.py:313monkeypatches out the Rust helper). cargo test --locked --release --manifest-path heliopause/Cargo.toml --lib— FAILS TO COMPILE (E0277):error[E0277]: can't compare `i32` with `u32` --> src/export/weight_reuse.rs:163:63 | 163 | ...y.architecture != architecture) | ^^ no implementation for `i32 == u32`body.architectureisVec<i32>whileverified_reusable_weight_bytestakesarchitecture: &[u32].
Blockers
- [Blocker]
flare-heliopausedoes not compile (heliopause/src/export/weight_reuse.rs:163). - [Blocker]
pub fn Root::adopt_verified_companionbypasses payload SHA-256 verification for external paths (helios/src/core/cache.rs:1975-2080,heliopause/src/export/transfer.rs:1303-1325):
Unlike#585's privatepublish_verified_payload(confined toRoot's own private staging transaction),#588exposes a public method taking an external path +(dev, ino)aftertransfer.rscallsdrop(file), verifies only(dev, ino), size, and the 4 KiB header (notreadonly,nlink == 1, or continuous fd ownership), hard-links via/proc/self/fd, and skips payload SHA-256 verification. Any concurrent writer holding a writable fd can mutate bytes afterdrop(file)and poison the immutable content-addressed cache. Fix by streaming received companions directly into aRoot-owned private staging transaction, or keepadopt_companion's post-link verification. - [Blocker] 140 LOC of untested Rust verification code masked by
except Exception: return 0(weight_reuse.rs:93-220,ignition/planning.py:151-185):
Zero Rust or Python tests invokeverified_reusable_weight_bytes/export_verified_reusable_weight_bytes(which is whyE0277went undetected).planning.py:184catches bareexcept Exception: return 0, silently masking real errors, andplanning.py:170constructsSimpleNamespace(directory=None, ...)breaking local-checkpoint reuse accounting.
Major Issues
- Disk preflight false positives blocking valid exports (
serve.py:203-214,planning.py:56-70, 188-201, 365-384,weight_reuse.rs:136):- Pre-rendezvous check breaks cached re-exports:
_export_hostsrunscheck_export_disk_space(None, ..., profiles=None)before rendezvous, soverified_reusable == 0always — hard-failing valid 300+ GiB cached re-exports withUsageErrorbefore reaching the post-rendezvous call that actually suppliesplanandprofiles. weight_reuse.rs:136only inspectsrefs/default(blocks TP4 re-export if TP1 is default), and peer hosts receive0reuse credit.probe_filesystem(planning.py:56-70) walks up past dangling symlinks (e.g.~/.cache/flare/cores -> /mnt/nvme/coresbefore target creation), probing/instead of/mnt/nvme.- Hard lower bound ignores TP replicated-weight content dedup and unused checkpoint tensors (e.g. vision weights under
--language-model-only) with no override flag.
- Pre-rendezvous check breaks cached re-exports:
- Disk preflight false negatives (
weight_reuse.rs:173-215,planning.py:271-296,serve.py:329): Over-creditsdraft_byteson--no-mtpagainst a target+draft core; only checksfree_bytes <= 0on split staging filesystems (missing 188.8 GiB Engram staging); single-host_prepareruns preflight beforefetch(model, hub_cache). - Doubled
IoBudgetduring concurrent capture + receive & teardown gaps (host_ranks.py:544-575, 643-658,transfer.rs:1392-1393):
Rank 0 runsexport_model(IoBudget::for_capture(1)) concurrently withreceive_ranks(IoBudget::for_ranks(1)), doubling native transfer RAM (~2 GiB + pinned rings) while the full model is GPU/unified-DRAM resident (contradictingdocs/runtime-core-design.md:299-306). Early peer receive failures do not cancel rank-0 capture;HostRankGroup.close()drops the drain-failure guard and skips socket/distteardown ifmodel.close()raises; dualStartupProgress::stderr_rows()instances race on stderr. - Concurrency & portability bugs in
heliopause/src/export/transfer.rs:- Condvar lost-wakeup race (
transfer.rs:86-93, 104-142):AbortScope::trigger()callsFILE_TRANSACTIONS.1.notify_all()without lockingFILE_TRANSACTIONS.0. - FD
capacityinflation (transfer.rs:145-160):saturating_subpaired withsaturating_addinflatescapacityaboveRLIMIT_NOFILEheadroom after saturation. POLLRDHUPordering & portability (transfer.rs:299-325): Callslibc::send()afterpoll()already returnedPOLLRDHUP, and uses Linux-onlylibc::POLLRDHUPinside#[cfg(unix)].
- Condvar lost-wakeup race (
Stacking note: Commit 1 (3805fcf9) is verbatim #585; rebase once #585 is split/resolved and add real Rust+Python unit tests for weight_reuse.rs plus live multi-host RSS validation.
FujitsuPolycom
force-pushed
the
perf/multihost-rank-export-transfer
branch
from
November 28, 2026 22:18
1c0d47b to
7aa9346
Compare
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.
Why
Multi-host
ignition exportcan discover insufficient disk space after preparing weights and graphs. Peer transfers also wait behind rank zero's local export, and cache installation re-reads companion files that transfer framing already verified.What changed
Before: Ignition started preparation without checking host storage, rank zero finished its local export before receiving peer payloads, and cache installation re-read verified companion files.
After: Ignition checks cache and staging capacity before preparation, deducting reusable bytes only from verified planned checkpoint blobs (
(sha256_hex, nbytes)incore_cache/blobs/) or signedCoreEnvelopeWeightspayloads verified viaflare_heliopause.export_verified_reusable_weight_bytes(matching recipe, checkpoint repository, exactcheckpoint_revision, weight-scoped parameters, TP width, and architecture). HardUsageErrorrejection applies strictly whenfree_bytes <= 0orfree_bytes < net_weights; heuristic executable/staging margins emitUserWarningadvisories. Rank zero receives peer payloads concurrently with local export, transfer aborts wake blocked peers and release descriptors, and Linux cache adoption links verified companions after inode/header checks.Claimed benefit and result
Predictably infeasible weight exports fail before GPU preparation without crediting unrelated cached revisions or rejecting tight margins on heuristic floors, while peer transfer overlaps with rank-zero export.
Supporting evidence and limitations
Candidate 1c0d47b711a9131923f82b2095037128df7ba066 stacked on #585 (
perf/native-capture-and-streaming-publishat3805fcf9cbf8a5ba938f4909779bdfff31569909, atopmain167f22c88076c1da801fe0ceca35f846d7295b24). Verified in WSL2:python -m pytest -q -rs tests/preparation/test_core_boundary.py tests/test_design_review_hook.py: 22 passed.python -m pytest -q -rs tests/cli/test_export_disk_preflight.py tests/preparation/test_host_ranks.py tests/preparation/test_checkpoint_source.py: 60 passed. Covers rejecting unverified or mismatched-revision cache files, deducting verified planned digests and signed weight-reuse cores, and emitting warnings rather than hard errors whennet_weights <= free_bytes < recommended_bytes.cargo test --locked --release --manifest-path heliopause/Cargo.toml --lib -- --test-threads=1: 218 passed, 5 ignored, 0 failed.cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server --lib core::cache -- --test-threads=1andcore::export: passed, 0 failed.heliosunit runs reproduce two pre-existing base failures on167f22c88076c1da801fe0ceca35f846d7295b24(model::tests::packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shapeandserver::runtime::phase_tests::worker_observes_prefill_decode_and_prerequisite_timings).Stack and merge order
Merge #585 (
3805fcf9cbf8a5ba938f4909779bdfff31569909) intomainfirst, then rebase and mark this PR ready. While this Draft PR targetsmain,Files changedincludes #585; see the incremental diff for this commit alone.Discord: Dooner