-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[pytorch][mobile] gate static aten registerer with USE_STATIC_DISPATCH #25815
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
Conversation
Summary: Don't need call these global registerers when USE_STATIC_DISPATCH is set as they will keep all aten functions at link time. Should solely rely on jit/generated/register_aten_ops* to keep "interface" aten functions (which are directly called from JIT), and rely on STATIC_DISPATCH + linker to keep all other aten functions that are transitively needed by the "interface" functions. Test Plan: - build and run in the demo app; - with stacked diff to shrink registered "interface" functions, linker can strip out unused aten implementations;
…TIC_DISPATCH" Summary: Don't need call these global registerers when USE_STATIC_DISPATCH is set as they will keep all aten functions at link time. Should solely rely on jit/generated/register_aten_ops* to keep "interface" aten functions (which are directly called from JIT), and rely on STATIC_DISPATCH + linker to keep all other aten functions that are transitively needed by the "interface" functions. Test Plan: - build and run in the demo app; - with stacked diff to shrink registered "interface" functions, linker can strip out unused aten implementations; Pull Request resolved: #25815 Differential Revision: [D17247236](https://our.internmc.facebook.com/intern/diff/D17247236)
smessmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think relying on jit/generated/register_aten_ops* will work. Let's talk about this offline.
smessmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-accepting, this diff by itself is fine, but we should talk about the registration thing ^^
…TIC_DISPATCH" Summary: Don't need call these global registerers when USE_STATIC_DISPATCH is set as they will keep all aten functions at link time. Should solely rely on jit/generated/register_aten_ops* to keep "interface" aten functions (which are directly called from JIT), and rely on STATIC_DISPATCH + linker to keep all other aten functions that are transitively needed by the "interface" functions. Test Plan: - build and run in the demo app; - with stacked diff to shrink registered "interface" functions, linker can strip out unused aten implementations; Pull Request resolved: #25815 Differential Revision: [D17247236](https://our.internmc.facebook.com/intern/diff/D17247236)
…TIC_DISPATCH" Summary: Don't need call these global registerers when USE_STATIC_DISPATCH is set as they will keep all aten functions at link time. Should solely rely on jit/generated/register_aten_ops* to keep "interface" aten functions (which are directly called from JIT), and rely on STATIC_DISPATCH + linker to keep all other aten functions that are transitively needed by the "interface" functions. Test Plan: - build and run in the demo app; - with stacked diff to shrink registered "interface" functions, linker can strip out unused aten implementations; Pull Request resolved: #25815 Differential Revision: [D17247236](https://our.internmc.facebook.com/intern/diff/D17247236)
Summary: Pull Request resolved: pytorch/pytorch#25815 Don't need call these global registerers when USE_STATIC_DISPATCH is set as they will keep all aten functions at link time. Should solely rely on jit/generated/register_aten_ops* to keep "interface" aten functions (which are directly called from JIT), and rely on STATIC_DISPATCH + linker to keep all other aten functions that are transitively needed by the "interface" functions. Test Plan: - build and run in the demo app; - with stacked diff to shrink registered "interface" functions, linker can strip out unused aten implementations; Differential Revision: D17247236 Pulled By: ljk53 fbshipit-source-id: 1feb5fbb8b9cfa057b9ba8bf3f2967f40980c917
Stack from ghstack:
Summary:
Don't need call these global registerers when USE_STATIC_DISPATCH is
set as they will keep all aten functions at link time.
Should solely rely on jit/generated/register_aten_ops* to keep "interface"
aten functions (which are directly called from JIT), and rely on
STATIC_DISPATCH + linker to keep all other aten functions that are
transitively needed by the "interface" functions.
Test Plan:
can strip out unused aten implementations;
Pull Request resolved: #25815
Differential Revision: D17247236