-
Notifications
You must be signed in to change notification settings - Fork 622
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
Fix Transpose operator when data shape has irrelevant dimensions (i.e. dimension of size 1) #1244
Conversation
6cce67d
to
f229c16
Compare
!build |
CI MESSAGE: [893930]: BUILD STARTED |
CI MESSAGE: [893930]: BUILD FAILED |
f229c16
to
6162a06
Compare
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.
Please factor out the logic and add it also to the non-batched kernel
6162a06
to
65e744c
Compare
!build |
CI MESSAGE: [894085]: BUILD STARTED |
CI MESSAGE: [894085]: BUILD PASSED |
65e744c
to
ffccbd7
Compare
!build |
CI MESSAGE: [895257]: BUILD STARTED |
…400, 1), (1, 200, 400, 3)) Signed-off-by: Joaquin Anton <janton@nvidia.com>
ffccbd7
to
cfd1eec
Compare
!build |
CI MESSAGE: [895306]: BUILD STARTED |
CI MESSAGE: [895306]: BUILD PASSED |
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 👍
for (int i = 0; i < rank; ++i) { | ||
new_dims[i] = dims[rank - 1 - i]; | ||
new_perm[i] = rank - 1 - perm[rank - 1 - i]; | ||
dims[i] = dims_copy[rank - 1 - i]; |
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 can be done in place.
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.
will do
!build |
CI MESSAGE: [895771]: BUILD STARTED |
} | ||
return {std::move(new_dims), std::move(new_perm)}; | ||
|
||
std::unordered_map<int, int> idx_map; |
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.
Possible improvement: this could be just a vector.
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.
done
a2fd67e
to
c0f71bf
Compare
Signed-off-by: Joaquin Anton <janton@nvidia.com>
c0f71bf
to
e1c34d9
Compare
!build |
CI MESSAGE: [895806]: BUILD STARTED |
CI MESSAGE: [895806]: BUILD PASSED |
…IA#1244) * Fix Transpose operator to accept data shapes including 1 (e.g. (200, 400, 1), (1, 200, 400, 3)) Signed-off-by: Joaquin Anton <janton@nvidia.com> Signed-off-by: Jianjun Liu <00liujj@163.com>
Signed-off-by: Joaquin Anton janton@nvidia.com
Why we need this PR?
Fixes a bug in Transpose operator when the shape of the input contains a 1 (e.g.
[800, 600, 1]
,[1, 500, 400, 3]
)What happened in this PR?
Add changes to detect a special case and remove any dimension that is equal to 1 before invoking cuTT. The permutation order is also adjusted to reflect the flattened shape.
JIRA TASK: N/A