AFD Plugin Explained

AFD Plugin Explained

Code version: afd-plugin @ 7452d52 · 2026-10-27 · vLLM @ ced6857

afd-plugin is a vLLM external plugin for AFD. The attention part and the feed-forward (FFN/MoE) part of a model run in two separate server processes, and a connector moves hidden states between them. The plugin adds its own worker classes, model runners, model wrappers, connectors, config validation and compatibility patches, and it changes no vLLM source file (README.md:9-13, README.md:21-24). This site explains the plugin code at commit 7452d52, and the vLLM code it builds on at commit ced6857. You need to know Python and the basics of LLM serving.

At a glance#

What it isA vLLM external plugin for Attention-FFN Disaggregation (AFD) (README.md:9-13).
Runs onNVIDIA CUDA GPU and Ascend NPU (README.md:11-13). This site explains the GPU paths in full; one page, Ascend NPU overview: the same contract, different transports, covers the NPU.
TargetsvLLM v0.30.0 at commit ced6857 (README.md:21, pyproject.toml:37). Other vLLM versions are not supported on GPU (README.md:69-70).
ModelsDeepSeek V2 / V3 / V3.2 / V4, GLM-MoE-DSA, Qwen3-MoE, and one Qwen3.5-MoE architecture, Qwen3_5MoeForConditionalGeneration (the README lists this one under "Qwen3.5 / Qwen3.6 MoE"). The code registers eight architectures, each under an AFD-prefixed name (afd_plugin/__init__.py:96-131, README.md:47-51).
ConnectorsThree: P2pNcclAFDConnector (CUDA), CAMP2pAFDConnector and CAMAsyncAFDConnector (both NPU) (afd_plugin/connectors/factory.py:88-102).
Code sizeAbout 20,195 lines of Python in afd_plugin/, across 78 files. The C/C++ kernels in csrc/ are out of scope. See The code map: folders, sizes and dependencies for the breakdown and the method.
How to runStart two vllm serve processes, one for each role, and give each one --additional-config '{"afd":{ ... }}'. Send requests only to the attention API server (README.md:218-240, README.md:258-260).

The system map#

One decode step runs left to right, then back. The attention server computes attention and hands its hidden states to the FFN server through the connector. The FFN server runs the experts and hands the result back. The colour stripe shows where the code runs. Each box links to its page and to the file.

Start here#

Pick the path that fits what you know.

How to use this site#

  • Levels. Each page shows a level dot: Beginner, Intermediate or Advanced.
  • Two depths. Each page starts simple, then has a Deep dive with shapes, numbers and a line-by-line code reading. Use "Open all deep dives" to expand them.
  • Check yourself. Most pages end with a short quiz.
  • Search. Press / to search. Hover a glossary term for its tooltip.
  • Code links. Every file:line link opens the exact code at the pinned commit.
  • Grey "soon" entries in the sidebar are pages that are not written yet.

What is not in this release#

This site has limits of scope, and the plugin itself states limits.

Out of the site's scope.

  • The C/C++ kernel sources in csrc/. The site explains only how the Python code selects, builds, loads and calls them.
  • The Ascend NPU code, except the one overview page Ascend NPU overview: the same contract, different transports. Other pages name the NPU variant in one line only.
  • The tests. They are a source of facts, not a page topic.

What the repository calls experimental or limited.

  • The project is experimental and needs more large-scale testing (README.md:17-19).
  • The GPU target is exactly vLLM 0.30.0; other versions are not supported on GPU (README.md:69-70).
  • GPU CUDA graphs are limited to FULL_DECODE_ONLY (README.md:86).
  • Native DBO is limited to exactly two ubatches (README.md:87).
  • Qwen3-MoE rejects attention-side gate placement, sequence-parallel MoE, EPLB, pipeline parallelism, speculative decoding, LoRA and NPU (README.md:91-92).
  • The GPU and NPU end-to-end tests are opt-in and need real hardware and model weights (README.md:85).

The code version this site explains#

This site explains one exact commit of each repository. Use these versions when you study the code with the site. The plugin pins vLLM to one release: vllm==0.30.0 (pyproject.toml:37), and the README names the exact commit (README.md:21). So every line number on this site is stable only at these two commits.

To get exactly this version of the code, run these commands:

Commit7452d52748fec2a858b63e4cb22941dadd7a3ee3 (short: 7452d52)
Date2026-10-27 19:15:00 +0800
Subject“Provide a skill for benchmarking AFD recipes (#465)”
Browsevllm-project/afd-plugin at 7452d52
git clone https://github.com/vllm-project/afd-plugin.git
cd afd-plugin
git checkout 7452d52748fec2a858b63e4cb22941dadd7a3ee3

The site also cites vLLM. Citations with the prefix vllm: point to this commit:

Commitced6857afa0ea7b2e3f0846a62e1394e90f15607 (short: ced6857)
Date2026-09-21 15:32:49 -0700
Subject“[CI][Build] Harden triton-cpu sleef submodule fetch in CPU image build (#57871)”
Browsevllm-project/vllm (v0.30.0) at ced6857
git clone https://github.com/vllm-project/vllm.git
cd vllm
git checkout ced6857afa0ea7b2e3f0846a62e1394e90f15607