Repository navigation
Conversation
The deepgemm expert backend imported only the top-level deep_gemm package, so every M2N environment had to build upstream DeepGEMM from source. vLLM v0.32.0 CUDA builds already vendor DeepGEMM as vllm.third_party.deep_gemm, with the same _C API the connector uses. load_deepgemm() now resolves DeepGEMM in vLLM's own order: an installed upstream deep_gemm first (deployments can still pin a version), then the vendored copy. It falls back only when the upstream package is not installed; an installed but broken deep_gemm raises instead of silently switching kernels. With neither, the error names both packages and the fused_experts backend. The resolved package is logged. Add a unit test for the resolution order and update the installation docs: the source build is now only needed to pin upstream DeepGEMM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: ronenkat <16743404+ronenkat@users.noreply.github.com>
load_deepgemm() now imports only vllm.third_party.deep_gemm, the copy vendored in the vLLM wheel. A separately installed upstream deep_gemm is no longer preferred, so the experts always run the DeepGEMM version the pinned vLLM ships, whatever else is installed. A vLLM build without DeepGEMM gets an error pointing to the fused_experts backend; any other import failure surfaces unchanged. The installation docs drop the DeepGEMM source build: a stock vLLM v0.32.0 CUDA install needs only the afdep extra. The bundled JIT runs without the elfutils headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: ronenkat <16743404+ronenkat@users.noreply.github.com>
ronenkat
requested review from
hsliuustc0106 and
jiangkuaixue123
as code owners
November 15, 2026 12:05
Collaborator
Author
|
FYI. @Etelis |
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.
Purpose
Make
DeepEPM2NAFDConnector's defaultdeepgemmexpert backend use theDeepGEMM bundled in the vLLM wheel (
vllm.third_party.deep_gemm) instead of aseparately built upstream
deep_gemmpackage. With a stock vLLMv0.32.0CUDA install, including the
vllm/vllm-openaiimage, the connector thenneeds only the
afdepextra. The DeepGEMM source build (submodules, elfutilsheaders, a
--no-depswheel install) is no longer part of the installation.The connector always uses vLLM's copy, also when an upstream
deep_gemmisinstalled, so its experts run the DeepGEMM version the pinned vLLM ships.
Issue
Scope
afd_plugin/connectors/gpu/deepep_m2n/deepgemm.py: where DeepGEMM isimported from.
docs/installation.md,tests/gpu/README.md,tests/e2e/README.md, the DeepEP M2N recipe READMEand
afd_plugin/connectors/README.md.fused_expertsbackend, connector config and APIs, other connectors,NPU.
Implementation Notes
load_deepgemm()importsvllm.third_party.deep_gemm._C. The kernelwrappers in
deepgemm.pyare unchanged; the import staysfunctools.cached and deferred to first use, sofused_expertsdeployments never import DeepGEMM.
vllm.third_partypackage) gets an errorthat points to
expert_backend: fused_experts. Any other import failureinside the bundled copy is raised unchanged.
deep_gemmis ignored by the connector. vLLM's ownkernels still prefer it (
vllm/utils/deep_gemm.py); both can be loaded inone process, since upstream registers its functions through pybind and the
vLLM fork through
TORCH_LIBRARY(deep_gemm).vLLM installs.
Test Plan
Environment: one node with 4x H200, stock
vllm/vllm-openai:v0.32.0, theplugin with the
devgroup and the lockedafdepextra (afdEP-commv1.1.0). No upstreamdeep_gemmand no elfutils headers installed;EP_DISABLE_GIN=1.pre-commit run --files <changed files>pytest -v tests/unit/connectors/test_deepep_m2n_connector.py -k deepgemmpytest tests/unitand the CI gatepytest -m "not gpu and not vllm_runtime" tests/unitload_deepgemm()resolution check in the podpytest -sv -m gpu tests/gpu/test_deepep_m2n_gpu.py, cold JIT caches, thenwarm
Test Result
tests/unit: 1568 passed, 52 skipped, 2 failed. CI gate: 1555 passed,51 skipped, 2 failed. The two failures are
tests/unit/compat/npu/test_feature_validation.py::test_npu_feature_validation[gate-on-attention]and
[async-graph], which fail onmainas well and are unrelated.load_deepgemm()returnsvllm.third_party.deep_gemm._C.tests/gpu/test_deepep_m2n_gpu.py: 33 passed, 2 skipped, cold in 32 minand warm in 7.9 min. The skipped cases are
test_attention_tp_peers_dispatch_disjoint_slices[2F-2DPx2TP-{bf16,fp8}],which need 6 GPUs. The BF16 and FP8 DeepGEMM expert cases, CUDA graph and
DBO cases all pass with the bundled DeepGEMM, and its JIT compiles without
the elfutils headers.
Docs Impact
docs/gpu/DEEPEP_M2N_CONNECTOR_USER_GUIDE.md: DeepGEMM comes with vLLM;the source build and elfutils steps are removed.
docs/installation.mdtests/gpu/README.md,tests/e2e/README.mdrecipe/gpu/DeepEPM2NAFDConnector/README.mdafd_plugin/connectors/README.mdEssential PR Checklist
🤖 Generated with Claude Code