[3/5] feat: run DeepSeek-V4 on the async GPU connector - #334
Open
specture724 wants to merge 1 commit into
Open
Conversation
specture724
requested review from
hsliuustc0106 and
jiangkuaixue123
as code owners
September 10, 2026 09:20
specture724
force-pushed
the
afd/async-gpu-v4
branch
from
September 10, 2026 11:42
de9e5c6 to
ec54c85
Compare
This was referenced Sep 11, 2026
specture724
added this pull request to stack #337
September 11, 2026 02:17
Wires the connector into both AFD roles and gives DeepSeek-V4-Flash -- 256 experts at topk 6, where the per-layer control-plane round trip costs more than the expert compute it guards -- a recipe that uses it. Both GPU runners previously asserted `control_plane is not None`, and the FFN worker loop raised NotImplementedError without one, so the connector could not run at all. The FFN side now pulls one work item at a time from the connector's own receive loop, taking the layer index and row counts from the arriving payload, and returns on an idle poll so the worker loop still sees its shutdown event. The Attention side skips vLLM's cross-DP batch agreement: async AFD lets each replica advance alone, so an idle replica never joins that all-reduce and a busy one would block in it forever -- which is exactly where a 2A2F run hung before reaching the first MoE layer. The V4 adapter learns the expert-routed dispatch protocol (the gate runs on the Attention side, so the wire carries topk ids and weights instead of token ids) and `compute_ffn_output` takes a device-side group_list so the FFN side runs only the grouped GEMM over its local experts. The V2 adapter gets the same GPU entry point, which is what the connector's e2e tests use as their reference. The rest was found bringing 2A2F up on real weights: the FFN role must force vLLM's NoDP MoE prepare/finalize under EP with DP>1, shared experts must be skipped on an empty shared slice, the SWIGLUOAI clamp has to reach the routed experts, the V4 Attention-side gate loads under its checkpoint path, and the DP coordinator's startup wait needs to be long enough for the second role's weights to load. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: specture724 <specture724@gmail.com>
specture724
force-pushed
the
afd/async-gpu-v4
branch
from
September 11, 2026 10:04
ec54c85 to
4e20b19
Compare
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.
Third of a five-PR stack. Based on #333 — the diff shown here is only this
PR's own change; review #332 and #333 first.
What this adds
Wires the connector into both AFD roles and gives DeepSeek-V4-Flash — 256
experts at topk 6, where the per-layer control-plane round trip costs more than
the expert compute it guards — a recipe that uses it.
Both GPU runners previously asserted
control_plane is not None, and the FFNworker loop raised
NotImplementedErrorwithout one, so the connector could notrun at all:
loop, taking the layer index and row counts from the arriving payload, and
returns on an idle poll so the worker loop still sees its shutdown event.
replica advance alone, so an idle replica never joins that all-reduce and a
busy one blocks in it forever — which is exactly where a 2A2F run hung before
reaching the first MoE layer.
The V4 adapter learns the expert-routed dispatch protocol (the gate runs on the
Attention side, so the wire carries topk ids and weights instead of token ids)
and
compute_ffn_outputtakes a device-sidegroup_listso the FFN side runsonly the grouped GEMM over its local experts. The V2 adapter gets the same GPU
entry point, which is what the connector's e2e tests use as their reference.
Behaviour change worth a look
layers.N.ffn.gate.*now loads on both roles. The gate's parameters liveunder
.ffnso the checkpoint names resolve, but withcompute_gate_on_attentionthe Attention side is what runs it.test_v4_gate_loads_on_both_rolespins the new contract.The rest
Found bringing 2A2F up on real weights: the FFN role must force vLLM's NoDP MoE
prepare/finalize under EP with DP>1, shared experts must be skipped on an empty
shared slice, the SWIGLUOAI clamp has to reach the routed experts, and the DP
coordinator's startup wait needs to be long enough for the second role's weights
to load.
Testing
Full unit suite unchanged against
main: same 13 pre-existing failures, noneadded.
pre-commitclean over the PR range. The recipe isrecipe/gpu/GpuAsyncAFDConnector/deepseek_v4_flash/2a2f_async.sh(4 GPUs).🤖 Generated with Claude Code