Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate torchgen exception boundary with ExecuTorch #7546

Open
wants to merge 25 commits into
base: gh/swolchok/124/base
Choose a base branch
from

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Jan 7, 2025

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Jan 7, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7546

Note: Links to docs will display an error until the docs builds have been completed.

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

@facebook-github-bot facebook-github-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 Jan 7, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 7, 2025
Pull Request resolved: #7546

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

ghstack-source-id: 260556841
@exported-using-ghexport

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

@swolchok swolchok added the release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc. label Jan 7, 2025
@swolchok swolchok marked this pull request as draft January 7, 2025 22:28
@swolchok
Copy link
Contributor Author

swolchok commented Jan 7, 2025

converting to draft to prevent accidental merge until the PR is updated to include a proper PyTorch pin bump; right now it points directly at pytorch/pytorch#144341 . It will still be reviewable whenever I get CI fixed

build/Codegen.cmake Outdated Show resolved Hide resolved
)
)
if(GEN_ADD_EXCEPTION_BOUNDARY)
set(_gen_command "${_gen_command} --add-exception-boundary")
Copy link
Contributor

@huydhn huydhn Jan 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the set command use semi-colon separator instead of space, i.e. /opt/conda/envs/py_3.10/bin/python3;-m;torchgen.gen_executorch;--source-path=/pytorch/executorch/configurations/../codegen;--install-dir=/pytorch/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out/configurations/optimized_native_cpu_ops_lib;--tags-path=/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torchgen/packaged/ATen/native/tags.yaml;--aten-yaml-path=/opt/conda/envs/py_3.10/lib/python3.10/site-packages/torchgen/packaged/ATen/native/native_functions.yaml;--op-selection-yaml-path=/pytorch/executorch/pip-out/temp.linux-x86_64-cpython-310/cmake-out/configurations/optimized_native_cpu_ops_lib/selected_operators.yaml;--add-exception-boundary

The failure is complaining about a wrong filename https://github.com/pytorch/executorch/actions/runs/12660296601/job/35287265644#step:14:1992

Suggested change
set(_gen_command "${_gen_command} --add-exception-boundary")
set(_gen_command "${_gen_command}" --add-exception-boundary)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strange, I thought I built this locally. Giving it a shot now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does seem to have improved the situation (thanks!) but the torchgen version still seems to be wrong: https://github.com/pytorch/executorch/actions/runs/12680876952/job/35343491373?pr=7546#step:9:2186

Copy link
Contributor Author

@swolchok swolchok Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huydhn still seeing at least some wrong-torchgen-version failures:

however, we do have mac successes. looking into the common thread for these failures now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ARM one is easy: the workflow directly invokes install_executorch from .ci/scripts/utils.sh without "use-pt-pinned-commit". Is there a reason "use-pt-pinned-commit" isn't the default or only option?

test-llava-runner-linux reruns install_requirements.sh and doesn't pass --use-pt-pinned-commit, same with test-phi-3-mini-runner, test-eval_llama-wikitext-linux, test-eval_llama-mmlu-linux, and test-llama_runner_eager-linux. I will send a PR to fix those.

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

swolchok added a commit that referenced this pull request Jan 8, 2025
Pull Request resolved: #7546

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

ghstack-source-id: 260686358
@exported-using-ghexport

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)
It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 9, 2025
Pull Request resolved: #7546

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

ghstack-source-id: 260777714
@exported-using-ghexport

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

swolchok added a commit that referenced this pull request Jan 9, 2025
Pull Request resolved: #7546

It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

ghstack-source-id: 260814512
@exported-using-ghexport

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)
swolchok added a commit that referenced this pull request Jan 9, 2025
Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

[ghstack-poisoned]
It should be permissible for this library to use exceptions, since it is not required to supported embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

swolchok added a commit that referenced this pull request Jan 28, 2025
…gation"

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 28, 2025
This is needed to respect the torchgen pinned commit for #7546.

Differential Revision: [D68593517](https://our.internmc.facebook.com/intern/diff/D68593517/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 28, 2025
…,reference}-delegation"

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 28, 2025
This is needed to respect the torchgen pinned commit for #7546.

Differential Revision: [D68593517](https://our.internmc.facebook.com/intern/diff/D68593517/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 28, 2025
…gation"

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 28, 2025
Pull Request resolved: #7579

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.
ghstack-source-id: 263542481
@exported-using-ghexport

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)
manuelcandales pushed a commit that referenced this pull request Jan 29, 2025
Pull Request resolved: #7579

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.
ghstack-source-id: 263542481
@exported-using-ghexport

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

Co-authored-by: Scott Wolchok <swolchok@meta.com>
It should be permissible for this library to use exceptions, since it is not required to support embedded systems.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

@swolchok swolchok changed the title Build optimized operators lib with -fexceptions Integrate torchgen exception boundary with ExecuTorch Jan 30, 2025
As of #7746, we build with exceptions by default, so we just need to use them.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

As of #7746, we build with exceptions by default, so we just need to use them.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

As of #7746, we build with exceptions by default, so we just need to use them.

TODO: presumably we need to manage rollout of the torchgen patch?

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

@swolchok
Copy link
Contributor Author

looks like tests are good; the github export mechanism just doesn't seem to be basing the PRs off main

kirklandsign pushed a commit that referenced this pull request Jan 31, 2025
* --use-pt-pinned-commit in one-off linux jobs

Pull Request resolved: #7922

This is needed to respect the torchgen pinned commit for #7546.
ghstack-source-id: 263542478
@exported-using-ghexport

Differential Revision: [D68593517](https://our.internmc.facebook.com/intern/diff/D68593517/)

* use-pt-pinned-commit for test-arm-{backend,reference}-delegation (#8023)

Pull Request resolved: #7579

Without this, these builds don't respect the torchgen pinned commit and thus fail with #7546.
ghstack-source-id: 263542481
@exported-using-ghexport

Differential Revision: [D67996459](https://our.internmc.facebook.com/intern/diff/D67996459/)

Co-authored-by: Scott Wolchok <swolchok@meta.com>

---------

Co-authored-by: Scott Wolchok <swolchok@meta.com>
@mergennachin
Copy link
Contributor

mergennachin commented Feb 4, 2025

@swolchok - FYI, there's a PR here to improve torchgen package import (#6730), related original issue (#6689)

Somewhat complementary but related

As of #7746, we build with exceptions by default, so we just need to use them.

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

As of #7746, we build with exceptions by default, so we just need to use them.

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

@swolchok swolchok marked this pull request as ready for review February 5, 2025 16:35
As of #7746, we build with exceptions by default, so we just need to use them.

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

As of #7746, we build with exceptions by default, so we just need to use them.

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

As of #7746, we build with exceptions by default, so we just need to use them.

Differential Revision: [D67904052](https://our.internmc.facebook.com/intern/diff/D67904052/)

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D67904052

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported release notes: build Changes related to build, including dependency upgrades, build flags, optimizations, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants