Skip to content

[AUTOGENERATED] [release/1.15.0] Let PyTorch choose the C++ standard when building ops - #343

Merged
rocm-repo-management-api-6[bot] merged 1 commit into
release/1.15.0from
autogenerated/release/1.15.0_cherry-pick_pr-341
Oct 19, 2026
Merged

rocm-repo-management-api-6[bot] merged 1 commit into
release/1.15.0from
autogenerated/release/1.15.0_cherry-pick_pr-341

Conversation

@rocm-repo-management-api-6

Copy link
Copy Markdown

Cherry-pick of #341

torch.utils.cpp_extension compiles extensions with -std=c++20 since
PyTorch 2.12, but the op builder appended -std=c++17 to the host C++
flags and to the ROCm hipcc flags. The later flag wins, so every op was
compiled as C++17. PyTorch 2.14 headers require C++20 (ATen.h raises
"C++20 or later compatible compiler is required", and c10 uses
std::strong_ordering and requires-clauses), so every op fails to build,
both when JIT-built on first use and when prebuilt with APEX_BUILD_*=1.

Remove every hard-coded -std flag from the op builder: from cxx_args(),
from the ROCm branch of nvcc_args(), and the CUDA-version-based selection
in the CUDA branch. torch.utils.cpp_extension adds the standard that
matches the installed PyTorch headers whenever no -std flag is passed,
on both the JIT and setup.py paths. This follows NVIDIA#2006, which
made the same change upstream.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@rocm-repo-management-api-6
rocm-repo-management-api-6 Bot merged commit 11867be into release/1.15.0 Oct 19, 2026
@rocm-repo-management-api-6
rocm-repo-management-api-6 Bot deleted the autogenerated/release/1.15.0_cherry-pick_pr-341 branch October 19, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant