-
Notifications
You must be signed in to change notification settings - Fork 26.3k
forward c10 registrations to aten #25969
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
Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
Pull Request resolved: #25969 When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. ghstack-source-id: 89860596 Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
Pull Request resolved: #25969 When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. ghstack-source-id: 89873100 Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch(). This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API. Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there. Differential Revision: [D17301917](https://our.internmc.facebook.com/intern/diff/D17301917/)
|
merged into #23667 |
| .op("aten::empty.memory_format(int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor", torch::RegisterOperators::options() | ||
| .impl_unboxedOnlyKernel<decltype(empty_override), &empty_override>( | ||
| "aten::empty.memory_format(int[] size, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None, MemoryFormat? memory_format=None) -> Tensor", | ||
| TensorTypeId::MSNPUTensorId) |
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.
This registration looks WAY worse than the old one. A big problem is that the schema string shows up twice. Why does the schema string show up twice?
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 like this API either but it's the only way to implement the forwarding to ATen without serious refactorings and probably bc breaking changes to the custom op API. This is only needed for the forwarding of registrations to ATen, it won't be needed anymore once everything is on c10. I'm planning to fix the API then and deprecate the one taking an additional string.
ezyang
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.
But I think the registration API is really bad and needs to be improved.
Stack from ghstack:
When an op is registered with the c10 dispatcher but the op is actually one of the ops that still lives on globalATenDispatch(), the c10 dispatcher will forward the registration call to globalATenDispatch().
This will allow backend extensions like XLA to immediately move to the new c10 registration API, while we are moving ops from globalATenDispatch to the c10 dispatcher behind the scenes without breaking their API.
Note that for consistency, this also changes all op registrations in TypeDefault/CPUType/... They now also directly go to the c10 dispatcher, and will be rerouted to globalATenDispatch from there.
Differential Revision: D17301917