mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[GH-ISSUE #698] hybrid_ep_cpp extension hardcodes -std=c++17; should inherit torch's C++ standard like deep_ep_cpp #404
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#404
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @janbernloehr on GitHub (Jul 24, 2026).
Original GitHub issue: https://github.com/deepseek-ai/DeepEP/issues/698
Describe the bug
DeepEP'shybrid-epbranch hardcodes-std=c++17for thehybrid_ep_cppCUDAExtension insetup.py(get_extension_hybrid_ep_cpp()). Recent PyTorch builds require C++20 — their headers emit#error C++20 or later compatible compiler is required to use PyTorchwhen included from a C++17 translation unit. As a result, buildinghybrid_ep_cppagainst a current-PyTorch environment fails at compile time.The sibling
deep_ep_cppextension (get_extension_deep_ep_cpp()) sets no explicit-stdflag — itsnvcc_flags = ['-O3', '-Xcompiler', '-O3']— and therefore inherits torch's default standard (now c++20). That is whydeep_ep_cppstill builds whilehybrid_ep_cppdoes not.To Reproduce
hybrid-epwith the hybrid-EP multinode extension enabled:hybrid_ep_cppaborts with the C++20#errorshown below.Expected behavior
hybrid_ep_cppbuilds against current PyTorch, the same way the siblingdeep_ep_cppextension already does.Actual behavior
Building the
hybrid_ep_cppextension aborts at compile time.nvccinvokes the host compiler with-std=c++17for thehybrid_ep_cppsources, which include PyTorch headers (torch/all.h:5,ATen/ATen.h:5); those headers hard-#errorunder C++17:The build log shows a mix of
-std=c++17invocations (forhybrid_ep_cpp) and-std=c++20invocations (for the siblingdeep_ep_cpp, which inherits torch's standard); only the C++17 ones fail.pip install .then exits with code 1, so DeepEP is not installed and every downstream consumer is blocked.Proposed fix
Remove the hardcoded
-std=c++17entry from thehybrid_ep_cppnvcccompile args insetup.py, so the extension inherits torch's C++ standard fromCUDAExtension/BuildExtension— exactly likedeep_ep_cpp. This is portable: it builds against both C++17 torch (older) and C++20 torch (current), rather than swapping one hardcoded standard for another (a hardcoded-std=c++20would instead break users still on a C++17 torch). The runtime JIT compiler (csrc/hybrid_ep/jit/compiler.cu) can keep-std=c++17, since its JIT-compiled kernels do not include torch headers and it relies onstd::any.Validated experimentally: with the hardcoded flag removed, the extension compiles cleanly and a DeepSeek-V3 MXFP8 expert-parallel (EP=8) training run completes end-to-end with healthy convergence (loss 12.02 decreasing to 6.60 across 50 steps) and no runtime regressions on GB200-class hardware (CUDA arch
10.0/9.0, PyTorch built for C++20).Environment
hybrid-epbranch, commit17cfb817bccec3a9c247013360cc550c2bac441e10.0 9.0This issue was drafted with assistance from the
opusAI model.