[PR #699] [MERGED] fix(build): inherit PyTorch C++ standard for hybrid EP #715

Closed
opened 2026-10-27 21:05:31 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepEP/pull/699
Author: @tiramitree
Created: 7/25/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @jershi425

Base: hybrid-ep ← Head: fix/hybrid-ep-cxx-standard


📝 Commits (2)

  • 7af4d03 fix(build): inherit PyTorch C++ standard for hybrid EP
  • 7f3d6d8 test(build): keep standard guard Python 3.8 compatible

📊 Changes

2 files changed (+37 additions, -1 deletions)

View changed files

📝 setup.py (+0 -1)
➕ tests/test_setup_compile_flags.py (+37 -0)

📄 Description

Summary

  • remove the hardcoded -std=c++17 flag from hybrid_ep_cpp
  • let PyTorch's CUDAExtension / BuildExtension select the compatible C++ standard, matching deep_ep_cpp
  • add a standard-library regression test that rejects any exact hardcoded -std=c++NN string anywhere in this extension builder, including future appended or cxx flags

Fixes #698.

Why

Recent PyTorch headers require C++20, while older supported PyTorch releases may still select C++17. Inheriting PyTorch's selected standard avoids forcing either generation and keeps the two DeepEP extensions consistent.

The runtime JIT compiler's separate C++17 flag is intentionally unchanged because this patch only covers the PyTorch-header extension build.

Validation

  • The regression scanner finds -std=c++17 on the exact base, hybrid-ep@94a9f8f6b146c07d97ec58f67cd6d303296d6098.
  • After the source change, python -m unittest tests/test_setup_compile_flags.py -v passes.
  • The exact test also passes under an actual official Python 3.8.10 Windows embeddable runtime, covering the repository's documented minimum; it also passes under Python 3.12.10.
  • python -m py_compile setup.py tests/test_setup_compile_flags.py
  • git diff --check

Validation boundary

I did not run an NVCC/CUDA build, GPU workload, or training run in this environment. This PR's local evidence is limited to the red/green structural regression, Python 3.8/3.12 test execution, Python compilation, and diff validation.

The implementation, test, review-response update, and PR text were prepared with material AI assistance and checked against the current source and issue before submission.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepEP/pull/699 **Author:** [@tiramitree](https://github.com/tiramitree) **Created:** 7/25/2026 **Status:** ✅ Merged **Merged:** 7/27/2026 **Merged by:** [@jershi425](https://github.com/jershi425) **Base:** `hybrid-ep` ← **Head:** `fix/hybrid-ep-cxx-standard` --- ### 📝 Commits (2) - [`7af4d03`](https://github.com/deepseek-ai/DeepEP/commit/7af4d03ff8f311c6a83ec7688ac425df681446d5) fix(build): inherit PyTorch C++ standard for hybrid EP - [`7f3d6d8`](https://github.com/deepseek-ai/DeepEP/commit/7f3d6d8c41a84c481167785bd559688bd50dbc34) test(build): keep standard guard Python 3.8 compatible ### 📊 Changes **2 files changed** (+37 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `setup.py` (+0 -1) ➕ `tests/test_setup_compile_flags.py` (+37 -0) </details> ### 📄 Description ## Summary - remove the hardcoded `-std=c++17` flag from `hybrid_ep_cpp` - let PyTorch's `CUDAExtension` / `BuildExtension` select the compatible C++ standard, matching `deep_ep_cpp` - add a standard-library regression test that rejects any exact hardcoded `-std=c++NN` string anywhere in this extension builder, including future appended or `cxx` flags Fixes #698. ## Why Recent PyTorch headers require C++20, while older supported PyTorch releases may still select C++17. Inheriting PyTorch's selected standard avoids forcing either generation and keeps the two DeepEP extensions consistent. The runtime JIT compiler's separate C++17 flag is intentionally unchanged because this patch only covers the PyTorch-header extension build. ## Validation - The regression scanner finds `-std=c++17` on the exact base, `hybrid-ep@94a9f8f6b146c07d97ec58f67cd6d303296d6098`. - After the source change, `python -m unittest tests/test_setup_compile_flags.py -v` passes. - The exact test also passes under an actual official Python 3.8.10 Windows embeddable runtime, covering the repository's documented minimum; it also passes under Python 3.12.10. - `python -m py_compile setup.py tests/test_setup_compile_flags.py` - `git diff --check` ## Validation boundary I did not run an NVCC/CUDA build, GPU workload, or training run in this environment. This PR's local evidence is limited to the red/green structural regression, Python 3.8/3.12 test execution, Python compilation, and diff validation. The implementation, test, review-response update, and PR text were prepared with material AI assistance and checked against the current source and issue before submission. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 21:05:31 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#715
No description provided.