Skip to content

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Jul 26, 2019

Stack from ghstack:

The c10 dispatcher now also stores a void* pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: D16521939

The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
@pytorchbot pytorchbot added the module: internals Related to internal abstractions in c10 and ATen label Jul 26, 2019
smessmer added a commit that referenced this pull request Jul 26, 2019
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

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

ghstack-source-id: 87262377
Pull Request resolved: #23447
@smessmer smessmer requested review from dzhulgakov and li-roy July 26, 2019 18:59
}

template<class Result, class... Args>
inline Result callOpUnboxed(const c10::OperatorHandle& op, c10::TensorTypeId dispatchKey, Args... args) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I though the whole point of unboxed call was to figure out the dispatch key from arguments. Do you think it's doable with template magic to collect keys of arguemnts (I recall you had this code somewhere). If not - we can codegen it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is planned but a future PR. There's a mismatch between c10 and aten currently because c10 chooses "the first tensor argument" to dispatch on while aten looks for "the tensor argument named 'self'". The plan is to add this 'self' functionality to c10 and then use it.

@smessmer smessmer requested a review from dzhulgakov July 29, 2019 23:30
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
@smessmer smessmer requested a review from dzhulgakov July 31, 2019 00:26
smessmer added a commit that referenced this pull request Jul 31, 2019
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Pull Request resolved: #23447
ghstack-source-id: 87461228

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
smessmer added a commit that referenced this pull request Jul 31, 2019
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Pull Request resolved: #23447
ghstack-source-id: 87508550

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
smessmer added a commit that referenced this pull request Aug 1, 2019
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Pull Request resolved: #23447
ghstack-source-id: 87539686

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
Copy link
Collaborator

@dzhulgakov dzhulgakov left a comment

Choose a reason for hiding this comment

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

Stamping it as a standalone change. But it'd be nice to see how it'd connect end-to-end (including boxing/unboxing and figuring out the dispatch keys) and what's the plan going forward

The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Differential Revision: [D16521939](https://our.internmc.facebook.com/intern/diff/D16521939/)
@zou3519 zou3519 deleted the gh/smessmer/11/head branch August 9, 2019 22:13
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9dbee5f.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 9, 2019
Summary:
The c10 dispatcher now also stores a `void*` pointer to the unboxed kernel function and this kernel function can be called if the call site knows the exact kernel signature.

It is not clear if this API will survive in the long term, but in the short term this allows an easier migration from ATen to c10 and is supposed to replace ATenDispatch.

Pull Request resolved: pytorch/pytorch#23447
ghstack-source-id: 88050435

Differential Revision: D16521939

fbshipit-source-id: 7e570df5a721defc677c3cc91758651dbe06ce1c
yf225 pushed a commit to yf225/pytorch that referenced this pull request Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: internals Related to internal abstractions in c10 and ATen

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants