[2/12] Upgrade cpp_extension and cpp_builder to C++20#176659
[2/12] Upgrade cpp_extension and cpp_builder to C++20#176659r-barnes wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176659
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (7 Unrelated Failures)As of commit e2812cd with merge base d87ebee ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
@pytorchbot rebase -b main |
|
@pytorchbot started a rebase job onto refs/remotes/origin/main. Check the current status here |
|
Successfully rebased |
35b596b to
a22254a
Compare
Summary: Update the default C++ standard from c++17 to c++20 in torch.utils.cpp_extension and torch._inductor.cpp_builder. This affects how user C++ extensions and inductor-generated code are compiled. Test Plan: Sandcastle Reviewed By: desertfire, malfet Differential Revision: D95103085
a22254a to
e2812cd
Compare
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: Comment with id 4019547341 not found Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "Failure looks like a flake, internal tests pass, changes to C++ are in Python strings, so skipped C++ format linter shouldn't be problematic" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: PR #176659 has not been reviewed yet |
|
@pytorchbot merge -i (Initiating merge automatically since Phabricator Diff has merged, merging with -i because oss signals were bypassed internally) |
|
This PR needs to be approved by an authorized maintainer before merge. |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 2 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m1-14), trunk / macos-py3-arm64 / test (openreg, 1, 1, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
@pytorchmergebot merge -i |
Merge startedYour change will be merged while ignoring the following 7 checks: inductor / inductor-cpu-test / test (cpu_inductor_torchbench, 1, 2, linux.2xlarge.amx, unstable), trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m1-14), trunk / macos-py3-arm64 / test (openreg, 1, 1, macos-m1-stable), trunk / linux-jammy-rocm-py3.10 / test (default, 2, 6, linux.rocm.gpu.gfx950.1), trunk / linux-jammy-rocm-py3.10 / test (distributed, 3, 3, linux.rocm.gpu.gfx950.4), trunk / linux-jammy-rocm-py3.10 / test (distributed, 2, 3, linux.rocm.gpu.gfx950.4), trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (distributed, 3, 3, lf.linux.g4dn.12xlarge.nvidia.gpu) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
PyTorch commit ad56ff73b751 ("[2/12] Upgrade cpp_extension and
cpp_builder to C++20", pytorch/pytorch#176659) changed the default
C++ standard from C++17 to C++20 for extensions built via
torch.utils.cpp_extension. Under C++20, std::lerp from <cmath> is
visible alongside the custom lerp(float,float,float) defined in this
file. When the third argument is c10::BFloat16 (implicitly convertible
to float), the compiler finds two equally-valid overload candidates
and fails with "more than one instance of overloaded function matches".
Rename the custom lerp to _lerp to eliminate the ambiguity.
Signed-off-by: Xiao Wang <24860335+xwang233@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PyTorch commit ad56ff73b751 ("[2/12] Upgrade cpp_extension and
cpp_builder to C++20", pytorch/pytorch#176659) changed the default
C++ standard from C++17 to C++20 for extensions built via
torch.utils.cpp_extension. Under C++20, std::lerp from <cmath> is
visible alongside the custom lerp(float,float,float) defined in this
file. When the third argument is c10::BFloat16 (implicitly convertible
to float), the compiler finds two equally-valid overload candidates
and fails with "more than one instance of overloaded function matches".
Rename the custom lerp to _lerp to eliminate the ambiguity.
Signed-off-by: Xiao Wang <24860335+xwang233@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary: Update the default C++ standard from c++17 to c++20 in torch.utils.cpp_extension and torch._inductor.cpp_builder. This affects how user C++ extensions and inductor-generated code are compiled. Test Plan: Sandcastle Reviewed By: malfet Pull Request resolved: pytorch#176659 Approved by: https://github.com/malfet
Summary:
Update the default C++ standard from c++17 to c++20 in
torch.utils.cpp_extension and torch._inductor.cpp_builder.
This affects how user C++ extensions and inductor-generated
code are compiled.
Test Plan: Sandcastle
Reviewed By: malfet
cc @jbschlosser @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo