-
Notifications
You must be signed in to change notification settings - Fork 26.3k
implement transpose operator for MKLDNN #19955
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
|
@bddppq We have upgrade the ideep transpose so handle more than just 4d mkl-dnn tensor. We were not sure where we should use it to support torch.transpose. torch.transpose(tensor, dim0, dim1) doesn't change the data buffer layout until contiguous() is called. But mkl-dnn tensor is not supposed to be contiguous tensor. So this PR only contain the Caffe2 transpose op for your reference. Do you have any suggestion how it can be used to speedup Pytorch op? |
|
rebased. pls help review. |
Matrix multiplication with bias $Y = A * B + Bias$, where `A` has size (M x K) or (Batch_size x M x k), `B` has size (K x N), `Bias` has size (n), and `Y` will have a size (M x N) or (Batch_size x M x N). To transpose `A` or `B` before multiplication, pass 1 to the `trans_a` and/or `trans_b` arguments, which separate the first and second dimensions of the respective matrices using `axis_a` and `axis_b`. This patch depend on pytorch#19955. Change-Id: Iea33d609f814a062d4e2b1b48a96e8a1da9f1072
Signed-off-by: Gu, Jinghui <jinghui.gu@intel.com>
bddppq
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.
LGTM
remove extra parenthesis in transpose_op_test.py
|
@pytorchbot rebase this please |
facebook-github-bot
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.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
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.
@bddppq has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
Could you add transpose aten op in a follow up diff? :-) |
|
Sure. We will work on it. |
implement transpose operator for MKLDNN