Skip to content

Default to C++20, pin embedded backends to C++17#20438

Open
cyyever wants to merge 2 commits into
pytorch:mainfrom
cyyever:cxx20-default
Open

Default to C++20, pin embedded backends to C++17#20438
cyyever wants to merge 2 commits into
pytorch:mainfrom
cyyever:cxx20-default

Conversation

@cyyever

@cyyever cyyever commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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 @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

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.
@pytorch-bot

pytorch-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🔗 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 SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 23, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Jun 23, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/trunk

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.

@cyyever

cyyever commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: none"

@pytorch-bot pytorch-bot Bot added the release notes: none Do not include this in the release notes label Jun 23, 2026
@rascani rascani self-requested a review June 23, 2026 15:13
@rascani

rascani commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

I think we'd rather keep one C++ standard level. I've opened #20468 to discuss raising the standard to C++20.

@cyyever

cyyever commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@rascani We can not move all code to cpp 20 due to device environment limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants