Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20438
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 11 Awaiting Approval, 1 Unclassified FailureAs of commit 350ec6e with merge base a26420d ( AWAITING APPROVAL - The following workflows need approval before CI can run:
UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
|
@pytorchbot label "release notes: none" |
|
I think we'd rather keep one C++ standard level. I've opened #20468 to discuss raising the standard to C++20. |
|
@rascani We can not move all code to cpp 20 due to device environment limits. |
The problem here is that the embedded toolchains don't just build their backends, but they also build the core runtime and portable kernel libraries. Since this PR changes the core runtime and portable kernel libraries to C++20, those embedded toolchains would need to support C++20 anyways. We could keep the default at C++17 and opt into C++20 for specific platforms and/or extension libraries (those unlikely to be used on embedded), but that probably just creates more divergence for minimal value. |
|
@rascani There is no better way than mixing C++20 core code and C++17 device code compilation, since more upstream code is migrating to newer standards. It is theoretically possible by maintaining a C++17 compatible core API. As a first step, we could monitor CI failures. |
The shared code from upstream pytorch is fairly minimal and @JacobSzwejbka added checks upstream to ensure it remains C++17 compatible (pytorch/pytorch#168204). I don't see any value in pinning the embedded backends to C++17. If the embedded toolchains do not support C++20, we cannot move the executorch core runtime to C++20. If the embedded toolchains do support C++20, then both the executorch core runtime and the backends can move to C++20. We can certainly try out the latter in CI. |
PyTorch has moved to C++20 and ExecuTorch's PyTorch-facing targets (_portable_lib, util, wheel config) are already built as C++20. Raise the repo-wide default in the top-level CMakeLists and .buckconfig to match. The embedded backends build the portable runtime without PyTorch, so their constraint is the cross-toolchain, not the standard the host uses. Pin cadence, cortex_m, arm, nxp, and mediatek to C++17 so they keep building on toolchains (e.g. Xtensa) that lack full C++20 support, regardless of the new default.
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
Summary
PyTorch has moved to C++20 and ExecuTorch's PyTorch-facing targets (_portable_lib, util, wheel config) are already built as C++20. Raise the repo-wide default in the top-level CMakeLists and .buckconfig to match.
The embedded backends build the portable runtime without PyTorch, so their constraint is the cross-toolchain, not the standard the host uses. Pin cadence, cortex_m, arm, nxp, and mediatek to C++17 so they keep building on toolchains (e.g. Xtensa) that lack full C++20 support, regardless of the new default.
Test plan
No new test is required.
cc @mcremon-meta @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani @robert-kalmar @JakeStevens