ep/cxi: async write path with completion-gated control atomics - #4
Merged
Conversation
added 8 commits
June 11, 2026 06:59
Replace the blocking post/wait_all/atomics sequence with an async design: - writes post without waiting; ring slots retire on CQ completion via a per-loop retire sweep (verbs-style), with an outstanding cap as backpressure - tail/control atomics inject immediately behind their writes, relying on same-TX-context submission ordering (measured on Slingshot-11; see uccl-project#956 discussion) - -FI_EAGAIN on any post is handled by polling + retry instead of terminating - UCCL_CXI_SYNC_WRITES=1 restores the previous conservative behavior - quiet drains all outstanding writes; shutdown drains bounded Also: env-gated UCCL_CXI_DELIVERY_COMPLETE=1 knob on TX (audit A/B).
Immediate same-TX injection reordered under FI_CXI_RDZV_THRESHOLD=0: every write goes rendezvous (target pulls data), so an eager atomic lands before the payload it announces -> corrupted dispatch output at >=1024 tokens. Queue atomics per peer with threshold = writes posted before them; flush in cxi_retire_ctx as completions arrive. Standalone atomics (no writes in flight) still inject immediately. quiet/barrier/shutdown drain the queue.
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
Completes the CXI transport in #1: replaces the blocking
post/wait-all/then-atomics design with an asynchronous write path, and fixes
the correctness and robustness gaps found in review and stress testing.
+16–22% on the EP dispatch/combine benchmarks on top of #1, and closes
three review findings (EAGAIN-as-fatal, write→atomic ordering, barrier
carve-out sizing).
fi_writes post without waiting; ring slots retireon CQ completion via a per-loop sweep (mirroring the verbs design), with a
per-transport outstanding cap as backpressure (
UCCL_CXI_MAX_OUTSTANDING,default 512).
UCCL_CXI_SYNC_WRITES=1restores the previous blockingbehavior as a fallback.
with
FI_CXI_RDZV_THRESHOLD=0every write goes through the rendezvousprotocol (target pulls the data), so same-TX-context submission order does
not order an eager atomic's placement against a write's placement —
immediate injection corrupted dispatch payloads at ≥1024 tokens. Control
atomics now queue per peer with a threshold equal to the writes posted
before them and are injected as those writes complete. Standalone atomics
(no writes in flight) still inject immediately. The empirical
submission-order results discussed in [Proposal] libfabric-CXI backend for UCCL-EP on HPE Slingshot uccl-project/uccl#956 do not
transfer to rendezvous-forced environments.
path (write, atomic, barrier) instead of terminating the proxy — TX-queue
exhaustion under load is expected, not fatal.
barrier injection orders behind prior traffic to the peer.
UCCL_CXI_DELIVERY_COMPLETE=1setsFI_DELIVERY_COMPLETEon TX(measured perf-neutral over a 35-minute A/B soak).
carve-out (top 4 KiB), making the slot region safe by construction.
ep/bench/dispatch_loop.py: sustained-dispatch wire-utilizationmeasurement tool.
Performance (2×4 GH200, Slingshot-11/CXI, Isambard)
EP8, 4096 tokens, hidden 7168, 288 experts, top-k 8 (fixed chunks; vs the
sync path in #1 measured the same night on the same nodes):
Wire-level: sustained single-stream dispatch reaches 21.15 GB/s per NIC
= 87% of the measured practical ceiling (24.27 GB/s by raw
fi_write,uni- and bidirectional); verified against NIC packet-histogram counters.
The residual is iteration-boundary pipeline fill in the kernel's chunk
staging, which production microbatch overlap hides.
Validation
test_internode.pycorrectness (all variants) at 1024 and 4096 tokens.--debug-hash), EAGAIN-torture (UCCL_CXI_MAX_OUTSTANDING=4, fullthroughput, zero failures), sync-mode fallback regression.
(FP8 21.8 / BF16 22.4 / combine 23.8 GB/s), HT+LL pressure — all green.
DeepSeek-V4-Flash, 2 nodes, DBO,
deepep_high_throughput,concurrency 1024 — 2048/2048 requests, 7364 out-tok/s, zero EP/CXI
errors in server logs.
Produced with heavy coding-agent assistance.