10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isinstance(...)
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
Stack from ghstack (oldest at bottom):
Fixes https://github.com/pytorch/pytorch/pull/137398/files#r1951280557
Related:
cc @zou3519 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @amjames
Sorry, something went wrong.
Update
d5d05d0
[ghstack-poisoned]
Note: Links to docs will display an error until the docs builds have been completed.
As of commit 72d44f2 with merge base 1677a31 ():
test_pytree.py::TestCxxPytree::test_pytree_custom_type_serialize
This comment was automatically generated by Dr. CI and updates every 15 minutes.
[Dynamo][pytree] handle isinstance(...) check for polyfilled class
5de9922
ghstack-source-id: dd5897e Pull Request resolved: #146921
tree_flatten
tree_unflatten
tree_structure
9e78423
03846bc
ghstack-source-id: 7f2037a Pull Request resolved: #146921
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
My point is, it is wrong for the compiled function to return an instance of the polyfilled class instead of the original class. The compiled function needs to return an instance of the original class.
We either need Animesh's polyfill infra for classes, or we need to actually make a TreeSpecVariable in Dynamo that has a reconstruct method. I'd prefer hardening the polyfill infra for classes because that is more generically applicable.
The compiled function needs to return an instance of the original class.
That is the ideal solution for polyfilling a class. We need to find a way to batch register the Python version of the polyfill methods of the C++ class. cc @anijain2305 about the class polyfill infra design.
After a second thought, I think polyfilling the methods and using a variable tracker of instance original class during inlining will cause performance issues. Also, it is not easy to polyfill C++ descriptors and support the pybind11 property and read-only property.
We should use the polyfilled class object while inlining the graph and find a way to convert between the original/polyfilled class instances at the graph boundaries.
Yes
468d321
116dc33
ghstack-source-id: f392bfe Pull Request resolved: #146921
eba607c
dcf199d
ghstack-source-id: 35cfbc4 Pull Request resolved: #146921
I agree with @zou3519's comments. Polyfill types should not leak into user code.
c216ea0
ghstack-source-id: 35cfbc4 Pull Request resolved: pytorch#146921
837db58
30761ca
ghstack-source-id: 0246bf1 Pull Request resolved: #146921
f417298
8bbb190
b3497a1
ghstack-source-id: 0246bf1 Pull Request resolved: pytorch#146921
ac62c83
e1741e3
ghstack-source-id: c2486d4 Pull Request resolved: #146921
72d44f2
f231662
ghstack-source-id: f0e34ee Pull Request resolved: #146921
03ac54a
ghstack-source-id: f0e34ee Pull Request resolved: pytorch#146921
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale. Feel free to remove the Stale label if you feel this was a mistake. If you are unable to remove the Stale label please contact a maintainer in order to do so. If you want the bot to never mark this PR stale again, add the no-stale label.Stale pull requests will automatically be closed after 30 days of inactivity.
Stale
no-stale
zou3519 zou3519 left review comments
jansel jansel requested changes
anijain2305 Awaiting requested review from anijain2305
Successfully merging this pull request may close these issues.