Repository navigation
helios: gate PCIe peer-access graphs and fix teardown, AsyncTransfer, and startup drain races - #727
Conversation
… and startup drain races
Why:
Four concurrency and lifetime defects affect multi-rank PCIe serving,
teardown, asynchronous extent transfers, and startup error handling in
Helios:
1. CopyEngineGate previously flagged only graphs with explicit
Node::Copy(Memory::Peer) nodes. Single-host PCIe multi-rank cores whose
graphs use kernel-based P2P collectives (referencing Memory::Peer via
kernel parameters, module globals, or indirect pointer tables such as
rank_data) alongside local Node::Copy nodes bypassed CopyEngineGate and
deadlocked GPUs under --prefix-cache-memory. If a coordinator rank
wedged inside CUDA, ThreadedExecutor had no watchdog past its 120 s
deadlines.
2. NativeModel::drop freed ranks sequentially in reverse order through
release_execution_resources, which short-circuited
stop_persistent_worker().is_err() || stop_async_transfers().is_err() and
released peer Device allocations and MappedHost mailboxes on rank N-1
before ranks 0..N-2 drained and before self.engram.clear() joined
background Engram threads polling those MappedHost addresses.
3. In AsyncTransfer, worker.rs reset submitted_io each iteration while
IoUringBackend::flush could leave queued_sqes unsubmitted on EINTR or
partial submit (stranding DEMAND reads); a cuEventRecord or cuEventQuery
failure after cuStreamWriteValue64_v2 had already succeeded later called
publish_notice(notice, true), clobbering live or reused completion slots
with error sentinels (neither path was modeled in AsyncTransfer.tla);
and server/metrics.rs labeled async-transfer Prometheus metrics with flat
vector indices rather than true rank IDs.
4. In ThreadedExecutor::new, a peer failing Command::FinishStartup exited
without servicing Command::Drain or sending Reply::Drained, causing
startup cleanup to call std::process::abort().
What changed:
- PCIe peer-access gating and AsyncTransfer decoupling
(helios/src/runtime_core/{payload,mod,serving,model}.rs,
docs/prefix-cache-offload.md):
- Before: NativeResources tracked only peer_copy_graphs
(Node::Copy(Memory::Peer)) and reused that predicate for both
CopyEngineGate and Execution.async_transfers validation.
- After: payload::load scans 8-byte aligned payload words against
Memory::Peer intervals to identify indirect peer-pointer tables;
NativeResources tracks both peer_copy_graphs (strictly
Node::Copy(Memory::Peer)) and peer_access_graphs (copies, memsets,
kernel argument/attribute relocations or inline fixed addresses into
peer/peer-table allocations, and peer-referencing module globals).
NativeModel queries NVML P2P_CAPS_INDEX_NVLINK via all_nvlink_p2p and
gates all peer_access_graphs under CopyEngineGate on single-host PCIe
multi-rank deployments without all-pairs NVLink, while
validate_async_transfer_peer_copy_compatibility continues checking only
peer_copy_graphs.
- Rank-wedge watchdog and FinishStartup drain handshake
(helios/src/execution/threaded.rs):
- Before: peer FinishStartup errors exited the startup loop without
answering Command::Drain (triggering abort during cleanup),
best_effort_drain_peers gave each peer a separate deadline, and no
watchdog monitored wedged coordinator calls.
- After: Reply::Started carries Result<()>; failing peers reply
Reply::Started(Err(error)) and remain in run_startup_phase to service
Command::Drain -> Reply::Drained cleanly; best_effort_drain_peers uses
one shared deadline; RankWedgeWatchdog monitors busy/closing/peer-exit
stalls past TIMEOUT + 30 s grace with zero idle CPU via Condvar.
- Three-phase cross-rank teardown barrier
(helios/src/runtime_core/{mod,model}.rs, docs/runtime-core-design.md):
- Before: NativeModel::drop freed ranks in reverse order with ||
short-circuiting before joining Engram/offload workers.
- After: stop_rank_workers stops both persistent workers and async
transfers without short-circuiting; teardown_model_ranks drains and
synchronizes every rank first, joins self.engram.clear() and
self.offload.reset() while MappedHost and CUDA contexts remain live,
destroys graphs/modules/allocations across ranks, and releases green
contexts, VA reservations, and CUDA contexts in reverse order (retaining
all resources if any rank fails drain).
- AsyncTransfer SQE flush, hardware-signaled faulted DMA, metrics, and TLA+
(helios/src/async_transfer/{io_backend,scheduler,worker,lifecycle_tests}.rs,
helios/src/server/metrics.rs,
verification/helios-lifecycle/{AsyncTransfer.tla,AsyncTransfer.cfg,
README.md,check.py}):
- Before: IoUringBackend::flush did not retry EINTR or expose
pending_submissions, worker.rs flushed only when submitted_io was set in
the current iteration, post-WriteValue64 faulted DMAs published error
sentinels on drain, and metrics labeled flat indices.
- After: IoUringBackend::flush loops on EINTR and partial submits via
flush_queued_sqes and exposes pending_submissions(); worker.rs flushes
whenever submitted_io || pending_submissions() > 0; InflightDma,
PendingEventDma, and UntrackedFaultedDma track hardware_signaled so
post-WriteValue64 faults never overwrite completion slots with error
sentinels and still monotonically advance host_comp on clean drain;
ChannelConfig and AsyncTransferSnapshot carry true global rank IDs
rendered in metrics.rs; AsyncTransfer.tla, lifecycle_tests.rs, and
check.py model unflushedIo (FlushIo / UnflushedIoBounded) and
hwSignaledFaulted (HwSignaledFaultedSafe) with matching TLA+ and Rust
mutations.
Claimed result:
Eliminates single-host PCIe TP>=2 CopyEngineGate deadlocks for kernel-P2P
graphs under --prefix-cache-memory, bounds wedged-rank hangs via the
watchdog, prevents cross-rank MappedHost/Device UAF during NativeModel::drop,
prevents io_uring SQE stranding and post-WriteValue64 completion-slot
clobbering in AsyncTransfer, reports accurate rank labels in Prometheus
metrics, and replaces FinishStartup peer-error process aborts with clean
drain errors.
Validation:
- Formal & mutation checks (python3 verification/helios-lifecycle/check.py
--tlc-jar /home/luke/.cache/flare-formal/tla2tools-1.7.4.jar
--java /usr/bin/java --target-dir flare-cli/target --mutations):
exited 0; all 10 TLA+ models, all 9 Rust conformance suites (431 observed
AsyncTransfer transitions, 7,940 DispatchRing transitions), and all TLA+
and Rust mutations (including UnflushedIoBounded, HwSignaledFaultedSafe,
unflushed io completed ok before flush, and hardware-signaled faulted dma
clobbered completion slot) passed.
- Rust crate tests & builds (release, --locked):
- eos (12 passed), selene, selene-manager, flare, flare-cli, helios
integration tests with FLARE_TEST_TEMPLATE_DIR=/tmp/flare-test-templates,
flare-cli release build, flare-cli --features roce check, and heliopause
check all passed.
- helios --lib with RUSTFLAGS="-D warnings": 0 warnings, 1,920 passed
(including all new peer_usage_tests, copy_gate_policy,
teardown_model_ranks, stop_rank_workers, flush_queued_sqes,
hardware_signaled_faulted_dma, async_transfer_metrics_label_true_rank_ids,
finish_startup_peer_error_drains_mixed_peers_cleanly_without_abort, and
3 RankWedgeWatchdog tests). 6 frontend template tests failed because
meta-models/Muse-Spark-Open-816B-A42B-NVFP4 returns HTTP 403 without
gated HuggingFace access.
- Python tests/cli: 206 passed.
- SM120 GPU verification (RTX PRO 6000 Blackwell Max-Q):
- live_cuda_async_transfer_end_to_end (CUDA_VISIBLE_DEVICES=2): passed.
- Live SM120 PCIe TP4 serving of DeepSeek-V4.1-Flash (135 graphs/rank,
1.92 GiB peer views, Engram lookahead prefetch, --prefix-cache-memory 4G,
--memory-limit 81G) on GPUs 2,3,4,14: 20 concurrent 13k-token requests
completed (0.59-3.86 s) with 1.09 GiB active Copy Engine host offload
(37 stored records, 0 store failures, 67 prefill / 38 snapshot / 161
speculative launches, 456 Engram gathers) and exited cleanly on SIGTERM
(status 0 in 3 s).
- Limitations / unrun checks: SM103/SM121 hardware, multi-host RoCE runs,
Kani CLI (cargo-kani not on PATH; completion/state-view validators were
not modified), and the 6 gated Muse-Spark template tests were not run.
No multi-GPU core combining Execution.async_transfers without
Node::Copy(Memory::Peer) was available locally (the local DeepSeek TP2
tiered-MoE core contains Node::Copy(Memory::Peer) and was correctly
rejected at load time).
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
Signed-off-by: Luke Alonso <lalonso@gmail.com>
|
A case file has been opened for 727. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core fixes for #722's PCIe kernel-P2P
Walkthrough
Merge Risk: High · up to
|
…, and round-robin peer drain
Why:
Three concurrency defects and several redundant checks remained after the
initial Helios P0 patch:
1. TransferScheduler::complete_io removed completed reads from inflight_io
with swap_remove(pos), which swaps the tail entry into pos and breaks
FIFO submission order relative to the kernel io_uring SQ ring. After a
partial flush of A followed by A completing, inflight_io reordered to
[C, B] while the SQ held [B, C], causing the next mark_io_flushed(1) to
mark C instead of B and complete_io(B, true) to permanently drop B's CQE.
2. RankWedgeWatchdog's closing branch applied one fixed 150 s wall-clock
timer without checking activity progress, so a multi-stage or poisoned
close() (draining pending frames, closing peers, running
best_effort_drain_peers, and closing rank zero) could trigger
std::process::abort() while still actively making stage progress.
3. best_effort_drain_peers iterated peers sequentially against one shared
deadline; if an earlier peer was wedged and exhausted the deadline, later
peers that had already sent Reply::Drained were skipped without a
non-blocking try_recv() sweep, leaving finished threads detached.
What changed:
- AsyncTransfer SQ FIFO preservation and bounded EINTR retries
(helios/src/async_transfer/{scheduler,io_backend,worker}.rs):
- Before: complete_io used swap_remove(pos), flush_queued_sqes retried
EINTR unboundedly, and AsyncTransferRuntime exposed an unused rank()
getter.
- After: complete_io uses remove(pos) (max_total_io <= 32) to preserve
exact SQ FIFO order with regression test
partial_flush_preserves_sq_fifo_order_across_completions;
flush_queued_sqes caps consecutive EINTR retries at 16 per call while
preserving queued_sqes for the next worker iteration; removed unused
AsyncTransferRuntime::rank().
- Progress-aware watchdog close monitoring and round-robin best-effort drain
(helios/src/execution/threaded.rs):
- Before: closing ignored activity counters, stop_and_join duplicated
Drop, and best_effort_drain_peers polled peers sequentially.
- After: closing resets close_since whenever activity advances and close()
records progress across pending drain, peer joins in close_peers and
best_effort_drain_peers, and local close; removed stop_and_join in favor
of drop(self.watchdog.take()); rewrote best_effort_drain_peers to sweep
live peers round-robin with non-blocking try_recv() against the shared
deadline (including a final non-blocking pass at deadline expiry) and
added regression tests for progressing close() and healthy peers behind
a wedged peer.
- Peer-interval and NVML P2P cleanup (helios/src/runtime_core/{mod,model}.rs,
docs/api.md):
- Before: interval merging and collect_peer_referencing_allocations were
duplicated across prepare_kernels and prepare_graphs,
prepare_async_transfers repeated the already-enforced peer-copy check,
and all_nvlink_p2p queried only one direction per GPU pair.
- After: factored storage_intervals(), computed peer_refs once in
prepare_kernels and consumed it in prepare_graphs, removed the
unreachable duplicate peer-copy check in prepare_async_transfers,
checked both (i, j) and (j, i) NVLink P2P directions in all_nvlink_p2p,
and clarified in docs/api.md that flare_async_transfer_* rank labels
carry global rank IDs.
Claimed result:
Prevents silent CQE loss on partial io_uring submissions, prevents false
RankWedgeWatchdog aborts during progressing multi-stage close(), ensures
already-drained peers join cleanly behind a wedged peer without blocking
past the shared deadline, and removes duplicated runtime-core setup logic.
Validation:
- RUSTFLAGS="-D warnings" targeted helios unit tests (50/50 passed, 0
warnings), including partial_flush_preserves_sq_fifo_order_across_completions,
bounded EINTR retry, progressing multi-stage close watchdog test, and
best_effort_drain_peers_joins_healthy_peers_even_when_earlier_peer_is_wedged.
- SM120 GPU (CUDA_VISIBLE_DEVICES=2): live_cuda_async_transfer_end_to_end
passed (0.59 s).
- Formal & mutation checks (python3 verification/helios-lifecycle/check.py
--tlc-jar /home/luke/.cache/flare-formal/tla2tools-1.7.4.jar
--java /usr/bin/java --target-dir flare-cli/target --mutations): exit 0
(all 10 TLA+ models, all 9 conformance suites, and all TLA+ and Rust
mutations passed).
- flare-cli release build and --features roce check passed.
- Limitations: SM103/SM121 hardware, RoCE live runs, and Kani CLI were not
re-run locally (CI runs Kani on push).
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
Signed-off-by: Luke Alonso <lalonso@gmail.com>
|
@flare-autobot Pushed |
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedAll Round 1 findings are resolved at
Walkthrough
Merge Risk: Medium · up to
|
…eserve cuEventQuery host mirrors
Why:
Two edge-case defects remained in poisoned multi-rank drain and
asynchronous extent-transfer fault handling:
1. In execution/threaded.rs, a peer failing validate_submission sends
replies.send(Err(error.clone())) before entering drain_outstanding_frames
(which can block up to TIMEOUT = 120 s or wedge inside executor.poll()).
best_effort_drain_peers treated Ok(Err(_)) as thread exit and called
unbounded thread.join(), starving healthy peers behind it and risking
CloseStalled watchdog aborts. Every actual peer exit drops replies
(Disconnected) or sends Reply::Drained after executor.close() returns.
2. In async_transfer/worker.rs, the cuEventQuery failure branch constructed
UntrackedFaultedDma with host_mirror_on_drain: None, discarding
PendingEventDma.completion_action for hardware-signaled HostOnly
completions (device_completions_base != 0) so host_comp[slot] never
advanced even after copy_stream drained cleanly.
What changed:
- Round-robin peer drain exit detection (helios/src/execution/threaded.rs):
- Before: best_effort_drain_peers set exited = true on Ok(Err(_)) and
joined immediately.
- After: only Ok(Ok(Reply::Drained)) and Err(TryRecvError::Disconnected)
set exited = true; Ok(Err(_)) drains alongside other non-terminal
replies so exiting peers hit Disconnected on the next try_recv() while
peers still draining in drain_outstanding_frames never block healthy
peers. Added regression test
best_effort_drain_peers_does_not_block_joining_peer_that_sent_err_before_exiting.
- Shared EventCompletionAction host-mirror extraction
(helios/src/async_transfer/worker.rs):
- Before: cuEventRecord failure extracted HostOnly(slot, val) while
cuEventQuery failure hardcoded host_mirror_on_drain: None.
- After: added EventCompletionAction::host_mirror_on_drain(bool) shared
by both cuEventRecord and cuEventQuery fault paths, with unit test
host_mirror_on_drain_preserves_hardware_signaled_host_only_completions.
- Deduplication (helios/src/runtime_core/{mod,host}.rs,
helios/src/async_transfer/lifecycle_tests.rs):
- Exposed merge_sorted_intervals as pub(super) and reused it in
host::host_vmm_ranges; simplified format_json_vec to format!("{v:?}").
Claimed result:
Prevents unbounded thread.join() blocking in best_effort_drain_peers when a
peer sends Err(...) before finishing drain_outstanding_frames, ensures
host_comp advances monotonically after clean copy_stream drain on
cuEventQuery faults for hardware-signaled DMAs, and removes duplicated
interval-merging and projection-formatting code.
Validation:
- RUSTFLAGS="-D warnings" targeted helios unit tests: 54/54 passed, 0
warnings (including the two new regression tests and runtime_core::host::
tests).
- SM120 GPU (CUDA_VISIBLE_DEVICES=10): live_cuda_async_transfer_end_to_end
passed (1.24 s).
- Formal & mutation checks (python3 verification/helios-lifecycle/check.py
--tlc-jar /home/luke/.cache/flare-formal/tla2tools-1.7.4.jar
--java /usr/bin/java --target-dir flare-cli/target --mutations): exit 0
(all 10 TLA+ models, all 9 conformance suites, and all TLA+ and Rust
mutations passed).
- flare-cli release build and --features roce check passed.
- Live SM120 PCIe TP4 serving (CUDA_VISIBLE_DEVICES=3,4,5,6) of
DeepSeek-V4.1-Flash (gb202-tp4-202611281955, --prefix-cache-memory 4G
--memory-limit 81G --embedding-table-cache-size 1G): 20/20 concurrent
~13k-token requests succeeded (0.45-3.74 s, 1.09 GiB active Copy Engine
host offload across 37 records, 0 failures, 62 prefill / 37 snapshot /
140 speculative launches, 404 Engram gathers); SIGTERM exited cleanly
(status=0 in 3 s).
- Limitations: SM103/SM121 hardware, multi-host RoCE runs, and local Kani
CLI (CI runs Kani on push) were not executed locally.
Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b
Signed-off-by: Luke Alonso <lalonso@gmail.com>
|
@flare-autobot Pushed |
Fixes #722
Why
Four concurrency and memory-lifetime defects affect multi-rank PCIe serving, model teardown, asynchronous extent transfers, and startup error handling in Helios:
CopyEngineGatedeadlock (helios: TP4 serving hangs under --prefix-cache-memory on SM120 PCIe; CopyEngineGate leaves 145/177 DeepSeek-V4.1-Flash graphs ungated #722) and unguarded rank wedges:NativeResources::prepare_graphsflagged only graphs containing explicitNode::Copynodes targetingMemory::Peer. On single-host PCIe multi-rank topologies, captured graphs using kernel-based peer-to-peer collectives (accessingMemory::Peerthrough kernel parameters, module globals, or indirect peer-pointer tables such asrank_data) alongside localNode::Copynodes bypassedCopyEngineGate. Under--prefix-cache-memory, concurrent host offload Copy Engine transfers deadlocked those GPUs at 100% utilization. BecauseExecution.async_transferscompatibility validation reused the samepeer_copy_graphspredicate, wideningCopyEngineGatewithout separating Copy Engine peer-copy nodes from kernel peer accesses would falsely reject NVLink SM P2P or kernel-P2P cores. Separately, when a coordinator rank wedged inside a CUDA driver call,ThreadedExecutorhad no independent watchdog past its 120 s step/drain deadlines.NativeModel::drop:NativeModel::dropiterated ranks in reverse callingrelease_execution_resources(), which short-circuitedstop_persistent_worker().is_err() || stop_async_transfers().is_err()and freed peerMemory::Deviceallocations andMemory::MappedHostmailboxes on rankN-1while ranks0..N-2had not finished draining and beforeself.engram.clear()joined background Engram threads polling thoseMappedHostaddresses.AsyncTransferSQE stranding, completion-slot sentinel clobbering, and wrong Prometheus rank labels:async_transfer/worker.rs,submitted_iowas reset every loop iteration whileIoUringBackend::flush()retained unsubmitted entries inqueued_sqesafterEINTRor partial submission, allowingDEMANDreads to strand in the submission queue.cuEventRecordorcuEventQueryfailed aftercuStreamWriteValue64_v2had already been queued on the Copy Engine stream, draining the stream later calledpublish_notice(notice, true), overwriting live or reused completion slots withCOMPLETION_ERROR_BIT | error_code. Neither failure mode was modeled inAsyncTransfer.tla.server/metrics.rslabeledflare_async_transfer_*Prometheus series with the flat vector index across all local channels instead of each channel's global rank ID.FinishStartupfailure: Inexecution/threaded.rs, a peer rank whosefinish_startupfailed exitedrun_startup_phasewithout servicingCommand::Drainor sendingReply::Drained, causingcleanup_failed_startupto callstd::process::abort().What changed
CopyEngineGatedetection andAsyncTransferdecoupling (helios/src/runtime_core/{payload,mod,host,serving,model}.rs,docs/prefix-cache-offload.md):NativeResourcesrecorded onlypeer_copy_graphs(Node::Copywith aMemory::Peerendpoint) and reused that predicate for bothCopyEngineGateandExecution.async_transfersvalidation (duplicated inNativeResources::prepare_async_transfers).payload::loadaligns parallel chunk boundaries to 8 bytes and scans 8-byte aligned payload words againstMemory::Peerintervals (when any exist) to flag indirect peer-pointer-table allocations.NativeResourcescomputes the transitive peer-referencing closure once inprepare_kernels(sharingmerge_sorted_intervalswithhost.rsandstorage_intervals, consuming it inprepare_graphs) and trackspeer_copy_graphs(strictlyNode::Copy(Memory::Peer)) separately frompeer_access_graphs(peer copies, peer memsets, kernel argument/attribute relocations or inline fixed addresses into peer or peer-pointer-table allocations, and peer-referencing module globals).NativeModelchecks symmetric NVMLP2P_CAPS_INDEX_NVLINK(all_nvlink_p2p) and enablesCopyEngineGateoverpeer_access_graphson single-host PCIe multi-rank deployments without all-pairs NVLink, whilevalidate_async_transfer_peer_copy_compatibilitycontinues rejecting onlypeer_copy_graphs.FinishStartupdrain handshake (helios/src/execution/threaded.rs):FinishStartupfailures exited the startup loop without answeringCommand::Drain(triggeringstd::process::abort()),best_effort_drain_peerspolled peers sequentially with separate deadlines, and no watchdog monitored wedged coordinator calls.Reply::StartedcarriesResult<()>; peers that failfinish_startupsendReply::Started(Err(error))and stay inrun_startup_phaseto serviceCommand::Drain -> Reply::Drained.best_effort_drain_peerssweeps all live peers round-robin with non-blockingtry_recv()against one shared deadline (including a final non-blocking sweep at expiry) and only joins onOk(Ok(Reply::Drained))orErr(TryRecvError::Disconnected), so healthy peers join even when an earlier peer is wedged or still insidedrain_outstanding_framesafter sendingErr(...).RankWedgeWatchdogmonitors busy, closing, and peer-exit stalls with zero idle CPU viaCondvar::wait_while—resetting the stall timer wheneveractivityadvances across multi-stageclose()transitions and terminating the process viastd::process::abort()if a rank remains wedged pastTIMEOUT + 30 sgrace (or30 sgrace after unrecoverable peer exit).helios/src/runtime_core/{mod,model}.rs,docs/runtime-core-design.md):NativeModel::dropfreed each rank sequentially in reverse order with||short-circuiting between persistent-worker and async-transfer stops beforeself.engram.clear()andself.offload.reset().stop_rank_workersevaluates both worker stops without short-circuiting.teardown_model_ranksexecutes a three-phase barrier: (1) drain workers and callcuCtxSynchronizeon every rank before freeing any storage; (2) joinself.engram.clear()andself.offload.reset()whileMemory::MappedHostmailboxes and CUDA contexts remain live, then destroy streams, graphs, modules, and allocations across ranks; (3) destroy green contexts, VA reservations, and primary CUDA contexts in reverse rank order. If any rank fails drain, all ranks retain their CUDA and host resources until process exit.AsyncTransferSQE flush, hardware-signaled faulted DMA, true rank metrics, andAsyncTransfer.tla(helios/src/async_transfer/{io_backend,scheduler,worker,lifecycle_tests}.rs,helios/src/server/metrics.rs,docs/api.md,verification/helios-lifecycle/{AsyncTransfer.tla,AsyncTransfer.cfg,README.md,check.py}):IoUringBackend::flush()did not retryEINTRor expose pending SQEs,worker.rsflushed only whensubmitted_iowas true in the current iteration,complete_ioremoved entries withswap_remove, post-cuStreamWriteValue64_v2faulted DMAs published error sentinels on drain, andmetrics.rsused flat.enumerate()indices as rank labels.IoUringBackend::flush()retriesEINTR(bounded to 16 consecutive retries per call so shutdown polling stays responsive) and drains partial submissions viaflush_queued_sqeswhile exposingpending_submissions(), andworker.rsflushes wheneversubmitted_io || pending_submissions() > 0.InflightIotracksflushedandcomplete_iouses orderedremove(pos)(max_total_io <= 32) somark_io_flushedremains synchronized with kernelio_uringSQ FIFO order across partial submits.InflightDma,PendingEventDma, andUntrackedFaultedDmatrackhardware_signaledso post-WriteValue64faults (from eithercuEventRecordorcuEventQuery) never overwrite completion slots with error sentinels and monotonically advancehost_compviaEventCompletionAction::host_mirror_on_drainon clean stream drain.ChannelConfigandAsyncTransferSnapshotcarry true global rank IDs rendered inmetrics.rs(documented indocs/api.md).AsyncTransfer.tla,lifecycle_tests.rs, andcheck.pyextend the projection to 16 integers addingFlushIo(UnflushedIoBounded),hwSignaledFaulted(HwSignaledFaultedSafe), and corresponding TLA+ and Rust mutations.Claimed benefit and result
CopyEngineGatedeadlocks for kernel-P2P graphs under--prefix-cache-memory, bounds wedged-rank hangs viaRankWedgeWatchdog(std::process::abort()on unrecoverable wedges while allowing progressing multi-stage closes), joins healthy peers behind wedged or draining peers inbest_effort_drain_peers, eliminates cross-rankMappedHost/Deviceteardown UAF inNativeModel::drop, preventsio_uringSQE stranding, FIFO CQE drops on partial flush, and post-WriteValue64completion-slot clobbering or stalehost_compmirrors inAsyncTransfer, reports true global rank IDs in Prometheusflare_async_transfer_*metrics, and replacesFinishStartuppeer-error aborts with clean drain errors.f7b83ae2): Serving an exported 4-rankDeepSeek-V4.1-Flashcore (135graphs/rank,1.92 GiBpeer views, Engram lookahead prefetch) under--prefix-cache-memory 4G --memory-limit 81Gon 4 SM120 PCIe GPUs completed 20 concurrent ~13k-token requests in0.45s–3.74swhile offloading1.09 GiB(37host records,0failures) concurrently with TP4 prefill/snapshot/speculative graphs and exited cleanly onSIGTERM(status=0in3s). No throughput speedup claim is made beyond deadlock/fault elimination.Supporting evidence and limitations
f7b83ae2):python3 verification/helios-lifecycle/check.py --tlc-jar /home/luke/.cache/flare-formal/tla2tools-1.7.4.jar --java /usr/bin/java --target-dir flare-cli/target --mutations0. All 10 TLA+ models, all 9 Rust-to-TLA+ conformance suites (431observedAsyncTransfertransitions,7,940DispatchRingtransitions), and all TLA+ and Rust mutations passed (includingUnflushedIoBounded,HwSignaledFaultedSafe,unflushed io completed ok before flush, andhardware-signaled faulted dma clobbered completion slot).--locked --release):f7b83ae2: targetedhelios --features runtime-core,servertests withRUSTFLAGS="-D warnings"(54/54passed,0warnings, includingbest_effort_drain_peers_does_not_block_joining_peer_that_sent_err_before_exiting,host_mirror_on_drain_preserves_hardware_signaled_host_only_completions,partial_flush_preserves_sq_fifo_order_across_completions, boundedEINTRretry, progressing multi-stage close watchdog test,best_effort_drain_peers_joins_healthy_peers_even_when_earlier_peer_is_wedged, andruntime_core::host::*),flare-clirelease build, andflare-cli --features rocecheck all passed.224fb403:eos(12passed),selene --features test-support,selene-manager --features test-support,flare,flare-cli,helios --test '*'withFLARE_TEST_TEMPLATE_DIR=/tmp/flare-test-templates,heliopausecheck,helios --lib(1,920passed), Pythontests/cli(206passed), plus GitHub CI (lifecycle,kani,pytestall green onc9df77bd).RTX PRO 6000 Blackwell Max-Q, re-run onf7b83ae2):FLARE_RUN_CUDA_TESTS=1 CUDA_VISIBLE_DEVICES=10 cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server -- async_transfer::worker::cuda_tests::live_cuda_async_transfer_end_to_end: passed (1.24s).CUDA_VISIBLE_DEVICES=3,4,5,6) ofdeepseek-ai/DeepSeek-V4.1-Flash-1017(gb202-tp4-202611281955,--prefix-cache-memory 4G --memory-limit 81G --embedding-table-cache-size 1G):20/20concurrent ~13k-token requests succeeded (0.45s–3.74s,flare_host_cache_stored_total=37,flare_host_cache_bytes_out_total=1171271680/1.09 GiB,flare_host_cache_store_failed_total=0,62prefill /37snapshot /140speculative /13init launches,404Engram gathers);SIGTERMexited cleanly (status=0,3s).6helios --libfrontend template tests failed locally becausetests/frontend/prepare_templates.pyreceives HTTP 403 on gated HuggingFace repositorymeta-models/Muse-Spark-Open-816B-A42B-NVFP4.cargo-kaninot onPATH; CI runs the Kani workflow) were not run locally.Execution.async_transferswithoutNode::Copy(Memory::Peer)was available locally (the localDeepSeek-V4.1-FlashTP2 tiered-MoE core includesNode::Copy(Memory::Peer)and was rejected at load time as intended).Discord: lukealonso