Skip to content

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Sep 22, 2025

Stack from ghstack (oldest at bottom):

See comment on the macro definition. In short, pybind11 3.x
added py::native_enum, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old py::enum_s as arguments (for example, __eq__).

Differential Revision: D82873169

cc @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @pragupta @ezyang @msaroufim @dcci @EikanWang @jgong5 @wenzhe-nrv @sanchitintel @voznesenskym @penguinwu @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @jiayisunx @chenyang78 @kadeng @chauhang @amjames @Lucaskabela

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Sep 22, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9685224 with merge base 98c4e35 (image):
💚 Looks good so far! There are no failures yet. 💚

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

swolchok added a commit that referenced this pull request Sep 22, 2025
See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

ghstack-source-id: 311049024
Pull Request resolved: #163527
@pytorch-bot pytorch-bot bot added ciflow/inductor module: dynamo oncall: distributed Add this issue/PR to distributed oncall triage queue release notes: distributed (c10d) release notes category labels Sep 22, 2025
@facebook-github-bot
Copy link
Contributor

@swolchok has exported this pull request. If you are a Meta employee, you can view the originating diff in D82873169.

@facebook-github-bot facebook-github-bot added fb-exported meta-exported oncall: jit Add this issue/PR to JIT oncall triage queue labels Sep 22, 2025
See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci EikanWang jgong5 wenzhe-nrv sanchitintel voznesenskym penguinwu Guobing-Chen XiaobingSuper zhuhaozhe blzheng jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 22, 2025
Pull Request resolved: #163527

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).
ghstack-source-id: 311290067
@exported-using-ghexport

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

@swolchok has exported this pull request. If you are a Meta employee, you can view the originating diff in D82873169.

@Skylion007
Copy link
Collaborator

Skylion007 commented Sep 22, 2025

Add a link to the pybind11 issue so we can remove this when it's resolved over there

@swolchok
Copy link
Contributor Author

Add a link to the pybind11 issue so we can remove this when it's resolved over there

I haven't filed an issue and I don't see a particular reason to think it's structurally fixable. type_casters are keyed on the type they are casting, not on whether the pybind11 user registered the type with py::enum_ vs py::native_enum. Their clear recommendation is for new code to use py::native_enum.

@Skylion007
Copy link
Collaborator

I maintain pybind11 so happy to discuss if there is a better way to optimize the casters or refactor it better in the long term

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci EikanWang jgong5 wenzhe-nrv sanchitintel voznesenskym penguinwu Guobing-Chen XiaobingSuper zhuhaozhe blzheng jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 22, 2025
Pull Request resolved: #163527

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).
ghstack-source-id: 311326172
@exported-using-ghexport

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

@swolchok has exported this pull request. If you are a Meta employee, you can view the originating diff in D82873169.

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci EikanWang jgong5 wenzhe-nrv sanchitintel voznesenskym penguinwu Guobing-Chen XiaobingSuper zhuhaozhe blzheng jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 23, 2025
Pull Request resolved: #163527

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).
ghstack-source-id: 311521197
@exported-using-ghexport

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

@swolchok has exported this pull request. If you are a Meta employee, you can view the originating diff in D82873169.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Approving, but this will be annoyingly difficult to get people to remember to do lol

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 24, 2025
@swolchok
Copy link
Contributor Author

this will be annoyingly difficult to get people to remember to do lol

I think it's straightforward to cause py::enum_ to break builds if this macro has not been used. Upstreaming something like this, together with optional support for said build breaks, is a possibility.

@swolchok
Copy link
Contributor Author

will be bypassing test failures since the only new failure is actually a resource download error

@swolchok
Copy link
Contributor Author

giving pull / linux-jammy-py3.13-clang12 a chance to rerun first

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

cc H-Huang awgu wanchaol fegin fduwjj wz337 wconstab d4l3k pragupta ezyang msaroufim dcci EikanWang jgong5 wenzhe-nrv sanchitintel voznesenskym penguinwu Guobing-Chen XiaobingSuper zhuhaozhe blzheng jiayisunx chenyang78 kadeng chauhang amjames Lucaskabela

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Sep 26, 2025
Pull Request resolved: #163527

See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).
ghstack-source-id: 312288551
@exported-using-ghexport

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

@swolchok has exported this pull request. If you are a Meta employee, you can view the originating diff in D82873169.

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

jainapurva pushed a commit that referenced this pull request Sep 29, 2025
See comment on the macro definition. In short, pybind11 3.x
added `py::native_enum`, and also had to add overhead for that new way
to bind enums on the critical path for calling functions that take
regular old `py::enum_`s as arguments (for example, `__eq__`).

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

Pull Request resolved: #163527
Approved by: https://github.com/ezyang
@swolchok
Copy link
Contributor Author

swolchok commented Oct 2, 2025

@pytorchbot revert

Copy link

pytorch-bot bot commented Oct 2, 2025

❌ 🤖 pytorchbot command failed:

@pytorchbot revert: error: the following arguments are required: -m/--message, -c/--classification

usage: @pytorchbot revert -m MESSAGE -c
                          {nosignal,ignoredsignal,landrace,weird,ghfirst,autorevert}

Try @pytorchbot --help for more info.

@swolchok
Copy link
Contributor Author

swolchok commented Oct 2, 2025

@pytorchbot revert -m "breaking import torch in debug builds, see #164297" -c nosignal

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

@swolchok your PR has been successfully reverted.
⚠️ This PR might contain internal changes
cc: @pytorch/pytorch-dev-infra

pytorchmergebot added a commit that referenced this pull request Oct 2, 2025
This reverts commit 50c0550.

Reverted #163527 on behalf of https://github.com/swolchok due to breaking import torch in debug builds, see #164297 ([comment](#163527 (comment)))
@pytorchmergebot pytorchmergebot added Reverted ci-no-td Do not run TD on this PR labels Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-no-td Do not run TD on this PR ciflow/inductor ciflow/trunk Trigger trunk jobs on your pull request fb-exported Merged meta-exported module: dynamo oncall: distributed Add this issue/PR to distributed oncall triage queue oncall: jit Add this issue/PR to JIT oncall triage queue release notes: distributed (c10d) release notes category Reverted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants