Repository navigation
Support FFN ranks on every node - #27
Merged
Merged
Conversation
ffn_ranks_per_domain f puts the FFN ranks at local ranks [0, f) of every NVLink domain, so layouts like 4A1F on each of two nodes can run (#18). Every domain then holds both roles, which neither directional protocol covers, so these layouts run the union hybrid with per-rank roles. Sources validate their real routes as the route guard does and translate them to DeepEP's logical experts in a new kernel; shared device sources are unchanged. The FastAFD baseline maps real IDs the same way. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
With ffn_ranks_per_domain set, the NVLink domains must always be the layout's, so f == F across several domains is rejected instead of silently running the global prefix. Dispatch asserts the domain shape and the handle copy for native callers. The comm benchmark maps the baseline's IDs once outside timing and keeps them alive with the graph, and rejects arms that give a rank different roles. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Design section 20 describes the per-domain FFN prefix, its GPU-suite record on 2 x 4 and 3 x 4 H200 (source ece614e6) and comm-only screens against today's layouts. The union protocol runs it at FastAFD M2N's speed: 12-27% slower than the directional and mixed-role protocols up to 128 tokens, 4-5% faster than the union with the FFN on one node at 512 tokens. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
With FFN GPUs at local ranks [0, f) of every NVLink domain, each FFN rail joins FFN GPUs only, none of them a source, so nothing crosses domains on it. FFN GPUs now run generated copies of the hybrid dispatch and combine that skip every scale-out action (rail barrier halves, counts, finish tails, combine signals and waits) and keep their NVLink work and scale-up barriers; Attention GPUs keep the union kernels. A per-call gate (2L <= U) keeps their partials below a forwarder's unflushed dispatch staging and falls back to union otherwise. The agreement tuple reports the per-domain protocol. GPU suite on 2 x 4 and 3 x 4 H200 in docs/validation-silent-ffn-rails.json. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
DeepEP V2's direct (non-hybrid) kernels write NVLink-reachable peers with TMA stores and the others with RDMA, then pass a barrier that flushes the QPs and signals through the NIC. Flushing covers RDMA only, so a same-node receiver could see the signal before the NVLink rows and read stale data whenever a node holds both senders and receivers (FastAFD's DeepEP M2N too). The GIN barrier now fences at system scope before its flush and signals. On 2 x 4 H200, 8 of 8 runs mismatched without the fence or with the proxy fence alone, and 8 of 8 passed with the system fence. NVLink barriers are unchanged. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
With hybrid off, DeepEP folds the NVLink domains into one logical domain, so per-domain roles and the route translation now use the physical domain size, the in-kernel route check gives way to the translating one, and ffn_ranks_per_domain no longer requires hybrid mode. Each Attention GPU then reaches each FFN GPU in one RDMA hop. GPU suite on 2 x 4 and 3 x 4 H200 in docs/validation-direct-per-domain.json. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Design section 20 records silent FFN rails, the GIN barrier fence and a decode screen on 2 x 4 and 3 x 4 H200: with one FFN GPU per node the direct path wins up to 32 tokens and beats every FFN-first layout on three nodes, while hybrid wins from 128 tokens and with two FFN GPUs per node. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
With FFN GPUs at local ranks [0, f) of every NVLink domain, each Attention rail joins one Attention GPU per domain, and each is both a source and its rail's forwarder. Attention GPUs now also run the generated per-domain copies, which keep the union kernels' work but no rail half of the dispatch-entry or combine-entry barrier: every write across domains for exchange N+1 follows its reader's exchange-N reads through the round trip. Combine signals take their own words, because a GPU that both forwards and collects receives a peer's dispatch tail and its combine signal in the same word, and every rank's reply inbox and combine staging move into the slices reserved at the window end, as in the mixed-role hybrid. FFN GPUs keep silent FFN rails or union per call; the rails are disjoint. The agreement tuple reports the protocol. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
The per-domain combine now asserts at compile time that the hybrid tail words (channels x domains) stay below the combine signal words. The argument beside afdep_domain_attention_rails also states that it assumes strict dispatch/combine pairing, which afdep/deepep.py enforces, and that AFDEP_UNION_HYBRID must be set before construction. The silent FFN rails comment and its provenance entry no longer say that Attention GPUs keep the union kernels. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Design section 20 describes the protocol and its three changes, with comm-only screens on 2 x 4 and 3 x 4 H200 against the per-node hybrid of #22, the mixed-role and directional layouts and the direct path of #24: 1.9-9.4% (3.8-10.0 us) faster in every cell, which ties the mixed-role layout at 512 tokens on two nodes and beats it by 4.6% on three. The record has the GPU suite on 27c46154 and deferred-put fault injection: the protocol and a barrier control pass with one domain lagging, and each negative control (shared signal words, reply inbox or combine staging at DeepEP's offsets) fails. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
FastAFD's DeepEP M2N in the same per-node layouts is 3.7-16.3% slower than this branch in every cell and repeat. That screen ran in a second session on the same nodes, where this branch and #22 re-measured within 1% of the first. Design section 20 gains a row per table. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
A screen on 2 x 4 and 3 x 4 H200 split the gain: dropping only the dispatch-entry rail half gives all but 0.7 points of it, dropping only the combine-entry rail half gives nothing measurable. Attention GPUs now keep the combine-entry barrier, as in #22. The three fixes stay, because each guards the next dispatch landing early: combine signals on their own words, and every rank's reply inbox and combine staging in the end slices. The change is also smaller: Attention rails follow afdep_domain_hybrid instead of a new selector (so the agreement tuple is unchanged), the combine-word offset lives in the generated copy instead of a header, one helper names the layouts that use the end slices, and the comments are condensed. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
Design section 20 now describes the protocol as shipped (dispatch-entry rail half dropped, combine-entry barrier kept) in one short section with a screen per layout: 1.4-8.5% (3.1-9.1 us) faster than #22's per-node hybrid in every cell and repeat, and 3.4-16.1% faster than FastAFD's DeepEP M2N in the same layout. The record is tied to bc3d223c: the GPU suite (25 runs, invalid routes), deferred-put fault injection where the protocol and a barrier control pass and each negative control fails (the reply-inbox control at capacity 512, where the regions overlap), the barrier split and the screens, as summaries instead of raw processes. Signed-off-by: Itay Etelis <92247226+Etelis@users.noreply.github.com>
This was referenced Nov 1, 2026
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Part of #18. Supersedes #22, whose commits are included as they were.
What and why
FFN ranks had to be ranks
[0, F). DeepEP numbers ranks node by node, so the FFN always landed on the first node(s). This PR lets every node hold FFN GPUs, so a deployment can scale by adding identical nodes. It also makes that layout faster.Main changes
ffn_ranks_per_domain=f. The firstfGPUs of every node are FFN ranks. Callers keep real expert IDs, and the library maps them to DeepEP's numbering.Result (comm-only, kermit, 4 × H200 per node, FP8):
Details are in
docs/design.md§20.Checks
Evidence
docs/validation-attention-rails.json, plus the per-domain records from #22 (docs/validation-per-domain*.json,docs/validation-direct-per-domain*.json).