# Repository Briefing: vllm-project/afd-plugin
> Source: https://repoforai.com/repo/vllm-project/afd-plugin (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/vllm-project/afd-plugin
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: C++
- **License**: Apache-2.0
- **Engineering Health**: A+ (89/100 · Maintenance 35/35 · Adoption 17/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v0.26.0rc1 (2026-08-19) — https://github.com/vllm-project/afd-plugin/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: GPU
- **Momentum**: 256 ★ total (+0 24h / +0 7d) · 75 forks
- **When to Use**: Best for: Inference teams with CUDA or Ascend capacity, a tested model–connector pairing, and a measured reason to provision Attention and FFN separately. Skip if: Standard colocated vLLM already meets service targets, you need a turnkey production deployment, or you cannot validate correctness and lifecycle behavior on the target topology.

## Overview
```text
### Architecture & Core Mechanics
AFD is an external vLLM plugin that splits Attention and feed-forward (FFN) execution across worker roles. It loads through vLLM's general-plugin entry point without requiring changes to the vLLM source tree. Clients send inference requests to Attention; FFN workers serve work delivered through the configured connector. Role and topology configuration enters through `--additional-config` rather than a separate client API for FFN.

The plugin owns workers, model runners, model wrappers, connectors, configuration validation, and compatibility shims. The Python package, `vllm-afd-plugin`, targets Python 3.11 through 3.13; its setuptools build declares wheel, setuptools-scm, pybind11, and CMake 3.16 or later, with native backend code under `csrc/`. v0.30.0rc1 completed the ModelRunnerV2 transition on CUDA and Ascend. The extension boundary avoids maintaining a source fork, but the runner integration remains tied to the vLLM runtime contract.

### Key Capabilities & Differentiators
The core capability is separate placement of Attention and FFN ranks rather than keeping both stages colocated. On GPU, v0.32.0rc1 introduced expert-routed M:N communication: `DeepEPM2NAFDConnector` uses afdEP-comm to send tokens directly from M Attention ranks to the FFN ranks among N that own the selected experts. This is a specific expert-routing path, not evidence that every model or connector supports the same topology.

The plugin has CUDA GPU and Ascend NPU backends. v0.34.0rc1 expands GPU M:N transports, standalone FFN services, and Ascend A3/A5 execution paths. Use `docs/support.md` to select a tested model, connector, and configuration before choosing a recipe; it also identifies known accuracy and shutdown limitations. Hardware-gated integration tests are relevant to that choice, but support for one combination should not be extrapolated to another.

### Trade-offs & Limitations
Compared with standard colocated vLLM, AFD gives operators an explicit way to choose Attention and FFN placement and capacity separately. The cost is a cross-rank communication path on top of model execution, plus more topology and lifecycle decisions. Without a bottleneck that separate placement actually relieves, that extra complexity may offer no advantage over keeping the stages together.

Treat the plugin as experimental. The adoption test is a controlled comparison against colocated vLLM using the same model and workload: measure per-role memory peaks, throughput, tail latency, output correctness, and startup and shutdown behavior on the intended backend. Do not infer a gain from M:N support alone. Apache-2.0 applies to the plugin package; redistribution should also account for the separately listed CANN kernel license file and the terms of any bundled runtime or model artifacts.

### Hardware & Deployment Guide
For self-hosting, select a supported model and connector in `docs/support.md`, follow the CUDA or Ascend installation path in `docs/installation.md`, and use the matching recipe under `recipe/`. The package requires Python `>=3.11,<3.14`; source builds declare setuptools, wheel, setuptools-scm, pybind11, and CMake. Pass roles and topology via `--additional-config`, direct client requests to Attention, and validate both role paths on the intended accelerators.

Pin the plugin and runtime together. The supplied release milestones track vLLM 0.30.0, 0.32.0, and 0.34.0; for v0.34.0rc1 specifically, the Ascend pairing is vLLM-Ascend `7dcdb690` with CANN 9.3.0. CPU-only or macOS environments support development checks such as `uv run pytest` and `uv run ruff check .`, not hardware acceptance. Use the hardware E2E path under `tests/e2e/` and verify model correctness, startup, and shutdown on the chosen configuration before rollout.
```

## Key Capabilities
```text
- Plugin boundary: Registers through the vLLM general-plugin entry point without patching the vLLM source tree.
- Request flow: Attention receives client traffic; FFN serves connector-delivered work; `--additional-config` sets roles and topology.
- GPU routing: `DeepEPM2NAFDConnector` uses afdEP-comm to deliver tokens directly to the FFN ranks that own their selected experts.
- Runner lifecycle: v0.30.0rc1 completes the ModelRunnerV2 transition on CUDA and Ascend and retires legacy ModelRunnerV1 execution.
- Backend evolution: v0.34.0rc1 targets vLLM 0.34.0 and expands standalone FFN services, GPU M:N transports, and Ascend A3/A5 execution paths.
- Validation boundary: Hardware-gated integration tests complement a support matrix covering tested combinations and known accuracy and shutdown limitations.
```

## Quick Start / Clone
```bash
uv run pytest
uv run ruff check .
```
