[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112888":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":33,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":37,"discoverSource":38},112888,"afdEP-comm","afdEP\u002FafdEP-comm","afdEP","Expert-parallel communication for Attention–FFN Disaggregation (AFD), built on DeepEP V2","https:\u002F\u002Fafdep.github.io\u002FafdEP-comm\u002F",null,"Python",94,1,13,0,2,33,45.2,"Apache License 2.0",false,"main",true,[24,25,26,27,28,29,30,31,32],"cuda","deepep","expert-parallelism","hopper","llm-inference","mixture-of-experts","nccl","nvlink","rdma","2026-11-20 23:37:10","2026-11-20 03:37:21","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"docs\u002Fassets\u002Fafdep-logo.png\" alt=\"afdEP-comm\" width=\"60%\"\u002F>\n\n\u003Cp>\u003Cb>Expert-parallel communication for Attention–FFN Disaggregation (AFD).\u003C\u002Fb>\u003C\u002Fp>\n\n\u003C\u002Fdiv>\n\nafdEP-comm connects N Attention GPUs, which route tokens, with M FFN GPUs, which hold the\nexperts: it dispatches routed tokens to the experts and combines their outputs back at\nthe source. It vendors DeepEP V2's kernels and specializes them for the two roles.\nRouting, quantization, expert compute and serving scheduling stay with the caller.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fcommunication-dark.svg\">\n  \u003Cimg alt=\"FastAFD's DeepEP M2N and afdEP-comm: who sends, receives and waits in each phase\" src=\"docs\u002Fassets\u002Fcommunication.svg\">\n\u003C\u002Fpicture>\n\n## What afdEP-comm changes\n\nEvery result here is measured against **FastAFD's DeepEP M2N**, the way\n[FastAFD](https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastAFD) runs AFD over DeepEP V2\n([`DeepEPM2NAdapter`](https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastAFD\u002Fblob\u002F3c7161949310b6d59d6b4cf9bf997a4935c8113b\u002Fpython\u002Fminisgl\u002Fmoe\u002Fdeepep_m2n_adapter.py)). DeepEP sees one symmetric\nexpert-parallel group: Attention ranks hold dummy expert slots that no token routes to,\nand every rank sends, receives and waits in both phases. The\n[AFD plugin](https:\u002F\u002Fgithub.com\u002Fms-llmd\u002Fafd-plugin) served the same code in vLLM through\nits `deepep_m2n` connector.\n\nafdEP-comm runs the same DeepEP V2 kernels and removes only what the two roles make\nunnecessary: Attention GPUs only send in dispatch and only receive in combine, and FFN\nGPUs the reverse. A change that would speed up FastAFD's DeepEP M2N as well is out of\nscope. The benchmarks run the baseline over the same vendored kernels and harness\n([benchmarks\u002Ffastafd.py](benchmarks\u002Ffastafd.py)). Every change keeps an environment\ncontrol that reverts it for measurement, except the sparse directional hybrid, which is\npart of the cross-node protocol from 1.1.0.\n\nOne exchange in one NVLink domain, with every barrier, the kernels each role runs and\nthe inbox regions each rank registers and receives into:\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fpipeline-dark.svg\">\n  \u003Cimg alt=\"Flowcharts of one exchange in one NVLink domain: FastAFD's DeepEP M2N and afdEP-comm, stage by stage\" src=\"docs\u002Fassets\u002Fpipeline.svg\">\n\u003C\u002Fpicture>\n\nIn one NVLink domain:\n- no entry barriers [§1](docs\u002Fdesign.md#1-entry-barriers); counts flow Attention → FFN only [§2](docs\u002Fdesign.md#2-directional-count-exchange);\n  only receivers wait at exit, per sending CTA [§3](docs\u002Fdesign.md#3-directed-exit);\n- receive buffers sized per role, 50% of the union registration at 2A2F and about 75%\n  at 3:1 and 1:3 [§4](docs\u002Fdesign.md#4-role-sized-registered-buffers);\n- each role launches only the warps it uses, and the FFN starts its copy epilogue at the\n  counts [§14](docs\u002Fdesign.md#14-role-suites-launch-only-what-each-role-uses), [§15](docs\u002Fdesign.md#15-ffn-receive-copy-epilogue-trigger-at-the-counts-one-nvlink-domain);\n- with one FFN rank, a single-FFN reduction and a zero-copy collect view\n  [§10](docs\u002Fdesign.md#10-single-ffn-reduction), [§13](docs\u002Fdesign.md#13-single-ffn-collect-view).\n\nAcross NVLink domains joined by NCCL GPU-Initiated Networking (GIN):\n- a directional protocol when every domain holds one role: no cross-domain barriers,\n  and counts, payloads, finish tails and combine signals each flow one way\n  [§7](docs\u002Fdesign.md#7-directional-hybrid-protocol), with route checks in the kernel\n  [§8](docs\u002Fdesign.md#8-route-checks-inside-the-directional-hybrid-dispatch) and staging kept out of remotely written inboxes\n  [§11](docs\u002Fdesign.md#11-staging-outside-remotely-written-inboxes-fix);\n- in that protocol, signals only on the channels that carry tokens: sources start on\n  staggered channels, and finish tails and combine signals skip empty channels, up to\n  68% off the small-batch round trip ([what it adds](docs\u002Fsparse-hybrid.md),\n  [§17](docs\u002Fdesign.md#17-sparse-directional-hybrid-default-across-nvlink-domains));\n- domains that hold both roles (FFN GPUs sharing a node with Attention GPUs) run\n  DeepEP's union hybrid and match FastAFD's DeepEP M2N within 1.4%; the\n  [cross-node additions](#cross-node-additions-opt-in) add a directional path for them.\n\nOpt-in and off by default: the [cross-node additions](#cross-node-additions-opt-in) ([§18](docs\u002Fdesign.md#18-mixed-role-directional-hybrid-opt-in-ffn-ranks-sharing-an-nvlink-domain), [§19](docs\u002Fdesign.md#19-fp8-combine-replies-opt-in-across-nvlink-domains)) and count-first dispatch [§16](docs\u002Fdesign.md#16-count-first-dispatch-with-a-streaming-ffn-expansion-opt-in-one-nvlink-domain). Every\nchange, its control and its evidence: [docs\u002Fdesign.md](docs\u002Fdesign.md).\n\n## Results\n\nCommunication only: one dispatch plus combine round trip under CUDA graphs, in µs,\nlower is better, maximum over Attention ranks. Each repeat runs one fresh process per\narm; latencies are medians over the repeats and every percentage is the geometric mean\nof the per-repeat paired changes, as in [docs\u002Fdesign.md](docs\u002Fdesign.md). These are not\nserving results. Data: [benchmarks.json](docs\u002Fassets\u002Fbenchmarks.json); figures:\n[plot_benchmarks.py](docs\u002Fassets\u002Fplot_benchmarks.py).\n\nThe baseline arm is the code FastAFD and the plugin ran: on 4 × H200 it matches the AFD\nplugin's own `deepep_m2n` buffer (FastAFD's DeepEP V2 snapshot with the plugin's three\nbuild patches) within −0.4% to +1.2% at 2A2F and −0.2% to +0.3% at 3A:1F, from 1 to\n2,048 tokens ([record](docs\u002Fvalidation-fastafd-equivalence.json)).\n\n### One NVLink domain\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fresults-in-node-h100-dark.svg\">\n  \u003Cimg alt=\"afdEP-comm against FastAFD's DeepEP M2N on 4 H100, six layouts\" src=\"docs\u002Fassets\u002Fresults-in-node-h100.svg\">\n\u003C\u002Fpicture>\n\nOn 4 × H100, afdEP-comm cuts the one-token round trip by 27–35% against\nFastAFD's DeepEP M2N and the 2,048-token one by 1–5%, and is faster in every\nrepeat of every cell. This tree (`bd4db4da`) has the changes of sections 1–4; sections 10\nand 13–15 came later and report their own gains on top.\n\n\u003Cdetails>\u003Csummary>4 × H100 numbers\u003C\u002Fsummary>\n\n4 × H100 in one NVLink domain, E128 \u002F top-8 (E96 for 1A:3F), capacity 2,048, BF16 unless noted, 24 transport SMs; median of three fresh-process repeats, max over Attention ranks; native tree bd4db4da (sections 1–4, before sections 10 and 13–16). Record: [validation-result.json](docs\u002Fvalidation-result.json).\n\n| 2A2F, hidden 2,048, random routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 20.7 | 24.8 | 26.3 | 35.3 | 70.6 | 192.7 |\n| FastAFD's DeepEP M2N, µs | 31.7 | 34.4 | 36.0 | 44.3 | 78.7 | 201.0 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −34.6% | −29.1% | −26.5% | −20.2% | −10.4% | −4.1% |\n\n| 2A2F, hidden 4,096, random routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 28.4 | 39.2 | 46.3 | 61.5 | 127.3 | 383.2 |\n| FastAFD's DeepEP M2N, µs | 39.1 | 47.9 | 55.7 | 68.7 | 136.2 | 392.6 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −27.2% | −18.9% | −18.4% | −10.3% | −6.4% | −2.4% |\n\n| 2A2F, hidden 2,048, skew routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 24.1 | 25.7 | 29.5 | 41.2 | 88.7 | 269.9 |\n| FastAFD's DeepEP M2N, µs | 34.3 | 35.7 | 38.9 | 50.1 | 95.9 | 274.1 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −29.5% | −27.6% | −24.1% | −17.5% | −7.6% | −1.5% |\n\n| 3A:1F, hidden 2,048, random routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 24.8 | 27.4 | 33.0 | 45.9 | 109.4 | 367.8 |\n| FastAFD's DeepEP M2N, µs | 36.4 | 38.6 | 44.8 | 55.8 | 119.5 | 372.1 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −31.4% | −29.4% | −26.5% | −17.5% | −8.4% | −1.1% |\n\n| 1A:3F, hidden 2,048, random routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 19.9 | 21.5 | 23.1 | 29.4 | 59.6 | 188.3 |\n| FastAFD's DeepEP M2N, µs | 30.5 | 31.3 | 32.8 | 39.7 | 67.7 | 197.7 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −34.2% | −31.3% | −29.3% | −24.9% | −12.2% | −4.7% |\n\n| 2A2F FP8, hidden 2,048, random routing | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 21.3 | 25.9 | 26.8 | 34.5 | 62.5 | 159.1 |\n| FastAFD's DeepEP M2N, µs | 32.3 | 35.6 | 36.7 | 43.5 | 71.8 | 167.8 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −34.1% | −27.8% | −26.8% | −20.6% | −12.9% | −5.2% |\n\n\u003C\u002Fdetails>\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fresults-in-node-h200-dark.svg\">\n  \u003Cimg alt=\"afdEP-comm against FastAFD's DeepEP M2N on 8 H200, three layouts\" src=\"docs\u002Fassets\u002Fresults-in-node-h200.svg\">\n\u003C\u002Fpicture>\n\nOn 8 × H200 the one-token reduction grows with the Attention:FFN ratio:\n22% at 4A:4F, 24% at 6A:2F and 39% at 7A:1F, where\nafdEP-comm is still 13% faster at 2,048 tokens.\n\n\u003Cdetails>\u003Csummary>8 × H200 numbers\u003C\u002Fsummary>\n\n8 × H200 in one NVLink domain (one pod), BF16, hidden 2048, top-8 of 128 experts, capacity 2,048, 24 SMs; 2 fresh processes per arm, max over Attention ranks; native tree 958652a3. Record: [validation-h200-screens.json](docs\u002Fvalidation-h200-screens.json).\n\n| 6A:2F | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 24.3 | 29.3 | 35.5 | 53.2 | 152.0 | 502.0 |\n| FastAFD's DeepEP M2N, µs | 32.2 | 38.1 | 43.7 | 61.2 | 157.9 | 507.9 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −24.4% | −23.2% | −18.8% | −13.1% | −3.8% | −1.2% |\n\n| 7A:1F | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 23.8 | 27.2 | 34.1 | 70.3 | 202.0 | 736.8 |\n| FastAFD's DeepEP M2N, µs | 39.3 | 46.4 | 53.4 | 97.3 | 244.6 | 847.4 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −39.5% | −41.3% | −36.0% | −27.8% | −17.4% | −13.0% |\n\n| 4A:4F | T=1 | 8 | 32 | 128 | 512 | 2,048 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 24.3 | 26.6 | 27.8 | 39.6 | 96.0 | 296.3 |\n| FastAFD's DeepEP M2N, µs | 31.1 | 35.1 | 36.1 | 47.4 | 102.8 | 302.9 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −21.7% | −24.3% | −23.1% | −16.5% | −6.7% | −2.2% |\n\n\u003C\u002Fdetails>\n\n### Across NVLink domains\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fresults-cross-node-dark.svg\">\n  \u003Cimg alt=\"afdEP-comm against FastAFD's DeepEP M2N across NVLink domains, four layouts\" src=\"docs\u002Fassets\u002Fresults-cross-node.svg\">\n\u003C\u002Fpicture>\n\nWith one role per NVLink domain the directional protocol cuts the one-token round\ntrip by 30% at 11:1 over 12 domains and by 26% at 5:1 over 6 domains. When the\nFFN GPUs share their node with Attention GPUs, the union hybrid runs and afdEP-comm matches\nFastAFD's DeepEP M2N within 1.4%. On real 8-GPU nodes that is the common case at high ratios: an\n11:1 deployment puts 2 FFN and 6 Attention GPUs on one node.\n\nThese are 1.0.0's dense directional protocol (tree `958652a3`). From 1.1.0 the protocol\nis sparse: one token at 11:1 takes 74 µs instead of 231 µs, 78% below FastAFD's DeepEP M2N\n([sparse directional hybrid](#sparse-directional-hybrid)).\n\n\u003Cdetails>\u003Csummary>Cross-node numbers\u003C\u002Fsummary>\n\nH200 joined by InfiniBand (NCCL GIN), FP8, hidden 2048, top-8 of 128 experts, capacity 2,048, 24 SMs; 2 fresh processes per arm, max over Attention ranks; native tree 958652a3. Record: [validation-h200-screens.json](docs\u002Fvalidation-h200-screens.json).\n\n| 11:1, 12 single-role domains (12 × 2 H200) | T=1 | 8 | 16 | 32 | 64 | 128 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 236.1 | 264.9 | 272.7 | 287.3 | 329.9 | 473.1 |\n| FastAFD's DeepEP M2N, µs | 339.4 | 354.3 | 352.2 | 361.8 | 399.7 | 494.5 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −30.5% | −25.2% | −22.6% | −20.6% | −17.5% | −4.3% |\n\n| 5:1, 6 single-role domains (6 × 4 H200) | T=1 | 8 | 32 | 128 | 512 |\n|---|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 137.8 | 155.3 | 165.0 | 235.1 | 604.8 |\n| FastAFD's DeepEP M2N, µs | 185.4 | 193.6 | 210.7 | 277.9 | 636.0 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −25.7% | −19.8% | −21.7% | −15.4% | −4.9% |\n\n| 11:1, mixed-role FFN node (3 × 8 H200) | T=1 | 8 | 16 | 32 | 64 | 128 |\n|---|---:|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 166.8 | 189.7 | 200.4 | 214.5 | 230.7 | 257.7 |\n| FastAFD's DeepEP M2N, µs | 168.9 | 189.9 | 201.0 | 213.9 | 228.1 | 255.6 |\n| afdEP-comm vs FastAFD's DeepEP M2N | −1.3% | −0.1% | −0.3% | +0.3% | +1.1% | +0.8% |\n\n| 11:1, mixed-role FFN domain (6 × 4 H200) | T=1 | 8 | 32 | 128 | 512 |\n|---|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 212.1 | 235.4 | 265.0 | 333.5 | 763.8 |\n| FastAFD's DeepEP M2N, µs | 211.3 | 235.7 | 264.6 | 332.4 | 760.4 |\n| afdEP-comm vs FastAFD's DeepEP M2N | +0.4% | −0.1% | +0.2% | +0.3% | +0.4% |\n\n\u003C\u002Fdetails>\n\n## Sparse directional hybrid\n\nFrom 1.1.0, when every NVLink domain holds one role, the directional protocol signals only\nthe channels that carry tokens; there is nothing to configure. Every exchange used to\nsignal all C channels (192 at 24 SMs), so at 11:1 an FFN GPU's NIC took 2,112 finish\natomics in dispatch and sent as many combine signals, whatever the batch. Now each source\nstarts on a different channel, publishes its token count so FFN forwarders retire unused\nchannels, and receives combine signals only on the channels that replied, plus a done\nwitness once every forward warp of the forwarder has finished.\n\nAt one token per Attention GPU it cuts the round trip by 68% at 11:1 over 12 domains, 67%\nwith two FFN domains, 49% to 51% at 5:1 and 34% with three Attention domains; the gain\nfades from about 128 tokens, where the data dominates. In serving (Qwen3-235B, 20A:4F) it\ncut median TPOT by 25% at 4 requests per Attention GPU and 10% at 64. In one NVLink domain\nnothing changes. Value, costs and every measurement:\n[docs\u002Fsparse-hybrid.md](docs\u002Fsparse-hybrid.md); design and correctness argument:\n[docs\u002Fdesign.md §17](docs\u002Fdesign.md#17-sparse-directional-hybrid-default-across-nvlink-domains).\n\n## Cross-node additions (opt-in)\n\nCommunication only unless noted, like the results above: one dispatch plus combine round\ntrip under CUDA graphs, maximum over Attention ranks.\n\nTwo opt-in additions remain across NVLink domains. With both off, afdEP-comm's default\nkernels and launches are unchanged, and in one NVLink domain nothing changes. Design,\ncorrectness argument and evidence:\n[docs\u002Fdesign.md §18](docs\u002Fdesign.md#18-mixed-role-directional-hybrid-opt-in-ffn-ranks-sharing-an-nvlink-domain) and\n[§19](docs\u002Fdesign.md#19-fp8-combine-replies-opt-in-across-nvlink-domains).\n\n**Mixed-role directional hybrid** (`AFDEP_MIXED_HYBRID=1` on every rank, prototype). When\nFFN ranks fill only part of a node, every GPU gets its role individually: each GPU on the\nFFN node still receives its rail's tokens on its own NIC (node-wide ingress), only the FFN\nGPUs hold experts, the node's Attention GPUs also send their own tokens locally, and\nAttention-only nodes just send and collect.\n\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs\u002Fassets\u002Fresults-xn-mixed-dark.svg\">\n  \u003Cimg alt=\"Mixed-role directional hybrid against afdEP-comm and FastAFD's DeepEP M2N\" src=\"docs\u002Fassets\u002Fresults-xn-mixed.svg\">\n\u003C\u002Fpicture>\n\nIt cuts the round trip against the default union hybrid by 23% at one token and 8% at\n512 tokens at 11:1, and by 21% and 6% at 23:1. It was measured and validated on 4-GPU\nNVLink domains only (6 × 4 H200, F = 1 to 3, one FFN-holding domain); 8-GPU nodes, fault\ninjection for its reply and staging orderings and a two-buffer interleave are not yet\nrun. The sparse protocol does not apply to this path yet.\n\n**FP8 combine replies** (`AFDEP_HYBRID_FP8_COMBINE=1` on every rank, opt-in). FFN\nforwarders send each reduced reply row across NVLink domains as E4M3 with one power-of-two\nscale per 128 elements (4,128 instead of 8,256 bytes at hidden 4096), and the Attention side\nsums the decoded rows in FP32. On H200 over InfiniBand, with two or more Attention domains,\nit cuts the round trip by 3–5% at 64 tokens per Attention GPU and 13–21% at 512;\n`AFDEP_HYBRID_FP8_COMBINE_MIN_BUCKET=64` keeps smaller buckets on BF16, where it would cost\n3–8%. In serving at 4,096 in \u002F 2,048 out it changed TPOT by −1.4% to +0.9%. It is lossy; on Qwen3-235B, GSM8K accuracy with FP8 replies at every bucket\nmatched BF16 within run-to-run noise (95.07% against 95.30% and 95.07%), while per-layer error and next-token KL\nare not measured yet ([docs\u002Fdesign.md §19](docs\u002Fdesign.md#19-fp8-combine-replies-opt-in-across-nvlink-domains),\n[record](docs\u002Fvalidation-fp8-combine.json)).\n\n\u003Cdetails>\u003Csummary>Cross-node numbers\u003C\u002Fsummary>\n\nH200 joined by InfiniBand (NCCL GIN), FP8, hidden 2048, capacity 2,048, 24 SMs; 2 fresh processes per arm, max over Attention ranks; afdEP-comm (union hybrid) on 958652a3, the mixed-role protocol on the tree each dataset's digests name. The sparse protocol's numbers are in [docs\u002Fsparse-hybrid.md](docs\u002Fsparse-hybrid.md#numbers).\n\n| 11:1, 2F:22A, 128 experts (6 × 4 H200) | T=1 | 8 | 32 | 128 | 512 |\n|---|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 212.1 | 235.4 | 265.0 | 333.5 | 763.8 |\n| Cross-node: mixed-role directional, µs | 163.0 | 189.0 | 207.5 | 284.1 | 701.6 |\n| FastAFD's DeepEP M2N, µs | 211.3 | 235.7 | 264.6 | 332.4 | 760.4 |\n| Cross-node: mixed-role directional vs afdEP-comm | −23.2% | −19.7% | −21.7% | −14.8% | −8.1% |\n| FastAFD's DeepEP M2N vs afdEP-comm | −0.4% | +0.1% | −0.2% | −0.3% | −0.4% |\n\n| 23:1, 1F:23A, 64 experts (6 × 4 H200) | T=1 | 8 | 32 | 128 | 512 |\n|---|---:|---:|---:|---:|---:|\n| afdEP-comm, µs | 280.3 | 319.4 | 353.4 | 437.5 | 1,082.7 |\n| Cross-node: mixed-role directional, µs | 222.2 | 267.6 | 294.0 | 383.4 | 1,015.5 |\n| FastAFD's DeepEP M2N, µs | 279.2 | 319.6 | 352.9 | 436.1 | 1,080.3 |\n| Cross-node: mixed-role directional vs afdEP-comm | −20.7% | −16.2% | −16.8% | −12.4% | −6.2% |\n| FastAFD's DeepEP M2N vs afdEP-comm | −0.4% | +0.1% | −0.2% | −0.3% | −0.2% |\n\n\u003C\u002Fdetails>\n\n## Use\n\nLinux, PyTorch ≥2.6, a CUDA toolkit with `nvcc`, and NCCL ≥2.30.7 with device headers\nare required. The release was validated with PyTorch 2.13.0+cu130, CUDA 13.0 and NCCL 2.30.7.\n\n```bash\npip install .\n# Set these before starting Python; select the same NCCL headers and runtime.\nexport AFDEP_NCCL_ROOT=\u002Fpath\u002Fto\u002Fnccl\nexport LD_LIBRARY_PATH=\"$AFDEP_NCCL_ROOT\u002Flib:$LD_LIBRARY_PATH\"\n# For a single NVLink domain, without network communication:\nexport EP_DISABLE_GIN=1\npython -m afdep doctor --build\n```\n\n```python\nfrom afdep import Buffer, Config\n\n# Set the CUDA device and initialize a CPU Gloo group first.\n# Group ranks [0, 2) own experts; [2, 4) originate tokens.\ncomm = Buffer(\n    group=group,\n    config=Config(\n        capacity_tokens_per_rank=2048,\n        hidden_size=4096,\n        num_experts=128,\n        top_k=8,\n        ffn_ranks=2,\n        attention_ranks=2,\n    ),\n)\nif comm.role == \"attention\":\n    comm.source_dispatch(x, expert_ids, weights, bucket=2048)\n    output = comm.source_collect()\nelse:\n    received = comm.worker_receive(bucket=2048)\n    weighted_rows = run_experts(received)  # Caller applies each routing weight once.\n    comm.worker_reply(weighted_rows, received.receipt)\ncomm.close()  # Collective, after all exchanges and graph replays finish.\n```\n\nRouting, quantization and expert computation belong to the caller. BF16 and\nprequantized FP8 dispatch return BF16 combined outputs. A Buffer holds one\nexchange at a time; use `Lanes` to overlap several (DBO). See the\n[tensor, graph and lifecycle contract](docs\u002Fapi.md).\n\n## Support\n\n| Architecture | Evidence | Scope |\n|---|---|---|\n| Hopper (SM90) | GPU suite of the release tree on 4 × H200; earlier trees on H100 and over two to five H200 NVLink domains | BF16\u002FFP8; eager and CUDA graphs; one NVLink domain, or several joined by GIN |\n| Blackwell (SM100) | Not validated | Port tracked in [#2](https:\u002F\u002Fgithub.com\u002FafdEP\u002FafdEP-comm\u002Fissues\u002F2) |\n| Other architectures | Not validated | No support claim yet |\n\nThe GPU suite (BF16 and FP8, small and large capacities, eager and CUDA graphs, invalid\nroutes) passes on the release tree with 2A2F, 3A:1F and 1A:3F in one four-GPU NVLink\ndomain ([record](docs\u002Fvalidation-count-first.json), `default_off_shipped`). Across\nNVLink domains the directional protocol passed it on earlier trees over two to four\ndomains of two H200 GPUs and four and five single-GPU domains joined by InfiniBand GIN\n([three](docs\u002Fvalidation-three-domain.json), [four](docs\u002Fvalidation-four-domain.json)\nand [five domains](docs\u002Fvalidation-five-domain.json),\n[eight ranks](docs\u002Fvalidation-eight-rank.json),\n[staging fix](docs\u002Fvalidation-staging-fix.json)). The 8-GPU NVLink domain and the\n24-rank layouts under Results are measured, not suite-validated. Other layouts\nand larger multi-domain worlds require validation. `allow_hybrid_mode` keeps DeepEP's\nmeaning; it does not enable an unvalidated topology.\n\nThe sparse directional hybrid passed the GPU suite on 24 ranks over 12 × 2 and 6 × 4\nH200, with one and two FFN domains, BF16 and FP8, the 1.1.0 tree included\n([validation](docs\u002Fsparse-hybrid.md#validation)). The opt-in cross-node additions are\nvalidated more narrowly: the mixed-role path passed the suite on 6 × 4 H200 with F = 1 to 3\n([record](docs\u002Fvalidation-mixed-hybrid.json)).\n\nFFN ranks on every node (`ffn_ranks_per_domain`, [design](docs\u002Fdesign.md) section 20) passed\nthe suite on 2 × 4 and 3 × 4 H200 with one and two FFN GPUs per node, BF16 and FP8, and on\nFastAFD's DeepEP M2N in the same layouts ([record](docs\u002Fvalidation-per-domain.json)). These\nlayouts run the union hybrid's work with silent FFN rails and Attention rails without the\ndispatch-entry barrier ([record](docs\u002Fvalidation-attention-rails.json)), or with hybrid off one\nRDMA hop per token\n([direct record](docs\u002Fvalidation-direct-per-domain.json)); nodes with different GPU counts are not\nsupported.\n\n## Acknowledgments\n\nafdEP-comm's communication kernels are DeepEP's. [DeepEP](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepEP),\nby Chenggang Zhao, Shangyan Zhou, Liyue Zhang, Chengqi Deng, Zhean Xu, Yuxuan Liu, Kuai Yu,\nJiashi Li and Liang Zhao at DeepSeek, provides the V2 elastic dispatch and combine transport\nthat afdEP-comm vendors and specializes for the two AFD roles. It runs on NVIDIA NCCL's GIN\nbackend.\n\nThe DeepEP V2 snapshot reached this project through [FastAFD](https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastAFD),\nby Yichao Fu, Yuxuan Zhang, Ruitian Wang, Junda Chen and Hao Zhang at\n[Hao AI Lab](https:\u002F\u002Fhaoailab.com), and through the [AFD plugin](https:\u002F\u002Fgithub.com\u002Fms-llmd\u002Fafd-plugin).\nAttention-FFN disaggregation comes from [MegaScale-Infer](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.02263)\n(ByteDance Seed), which introduced disaggregated expert parallelism and an M2N communication\nlibrary, and [Step-3](https:\u002F\u002Farxiv.org\u002Fabs\u002F2507.19427) (StepFun), which named it AFD.\n\nIf you use afdEP-comm, please also cite DeepEP and FastAFD as their authors ask:\n\n```bibtex\n@misc{deepep2025,\n      title={DeepEP: an efficient expert-parallel communication library},\n      author={Chenggang Zhao and Shangyan Zhou and Liyue Zhang and Chengqi Deng and Zhean Xu and Yuxuan Liu and Kuai Yu and Jiashi Li and Liang Zhao},\n      year={2025},\n      publisher = {GitHub},\n      howpublished = {\\url{https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepEP}},\n}\n\n@misc{fastafd2026,\n  title  = {FastAFD: Open-Source Large-Scale Attention-FFN Disaggregation on Blackwell NVL72},\n  author = {Fu, Yichao and Zhang, Yuxuan and Wang, Ruitian and Chen, Junda and Zhang, Hao},\n  year   = {2026},\n  url    = {https:\u002F\u002Fgithub.com\u002Fhao-ai-lab\u002FFastAFD},\n  note   = {Technical blog and open-source release}\n}\n```\n\n## Licenses\n\nafdEP-comm's own Python code is Apache-2.0. The vendored native transport and afdEP-comm's\nchanges to it are MIT: DeepEP's license (Copyright (c) 2025 DeepSeek) and FastAFD's license,\nwhose copyright line reads Copyright (c) 2026 sgl-project because FastAFD started from a\nmini-sglang codebase, both ship with the code. The adapters taken from the AFD plugin keep\nits Apache-2.0 attribution. afdEP-comm is an independent project, not affiliated with or\nendorsed by DeepSeek, the DeepEP authors or the FastAFD authors.\n[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) lists every origin, license and local change.\n\n[Design and evidence](docs\u002Fdesign.md) · [v0 validation](docs\u002Fvalidation.md) ·\n[Contributing](CONTRIBUTING.md) · [Licenses and provenance](THIRD_PARTY_NOTICES.md)\n","afdEP-comm 是一个面向注意力-前馈网络解耦（AFD）架构的专家并行通信库，专为分离式 MoE 推理优化。它将 Attention GPU（负责 token 路由）与 FFN GPU（负责专家计算）解耦，仅在必要方向上执行 dispatch\u002Fcombine 通信，剔除冗余同步与内存注册，支持 NVLink\u002FRDMA 跨节点高效传输，并基于 DeepEP V2 内核进行角色特化（如按角色分配接收缓冲区、定向退出等待、CTA 级细粒度调度）。适用于大模型 MoE 架构下高吞吐、低延迟的分布式推理部署场景，尤其适合 Hopper 架构 GPU 集群。","2026-11-24 04:44:29","CREATED_QUERY"]