-
Notifications
You must be signed in to change notification settings - Fork 25.6k
unflatten isinstance #143664
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
unflatten isinstance #143664
Conversation
Differential Revision: [D67526542](https://our.internmc.facebook.com/intern/diff/D67526542/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/143664
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d88d39d with merge base 2c48af5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D67526542 |
Differential Revision: [D67526542](https://our.internmc.facebook.com/intern/diff/D67526542/) [ghstack-poisoned]
Pull Request resolved: #143664 Differential Revision: [D67526542](https://our.internmc.facebook.com/intern/diff/D67526542/) ghstack-source-id: 259149796
This pull request was exported from Phabricator. Differential Revision: D67526542 |
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour 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 |
Retracing while preserving module call signatures used to be a problem because graph modules don't have submodules at given paths. This led to a number of failing retracebility tests. By not trying to wrap modules with export tracepoints we can pass most of these tests; the only exception is where you do module swapping on retraced programs, which is still not possible. Differential Revision: [D67539304](https://our.internmc.facebook.com/intern/diff/D67539304/) Pull Request resolved: #143676 Approved by: https://github.com/zhxchen17, https://github.com/tugsbayasgalan ghstack dependencies: #143664
Stack from ghstack (oldest at bottom):
When we unflatten, the submodules we generate (
InterpreterModule
orInterpreterModuleDispatcher
) are not related by type to the original submodulesN
. This makesisinstance(mod, N)
checks fail. Since we do not have the original types after export, the best we can do is expose atype_name()
method that carries the original type name, which we do carry innn_module_stack
entries.Differential Revision: D67526542
cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o