Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Added oneDNN reduce_op GRAD kernel #32280
Added oneDNN reduce_op GRAD kernel #32280
Changes from 37 commits
1ecc4cf
d4f9ad4
f85e7a3
5c02f89
7c3b736
4147b25
726846f
6763404
f2555e5
8f80eb5
539fe3c
3dfabd9
895f948
cd9d2f3
87fc5a1
a75ee12
b442889
27dec3a
71089fe
29097ce
164043a
be36f94
424083f
87b5b38
94e4ace
9ae1005
cfa2519
7d3797f
782e25c
bd69270
ffe6156
27f8bb7
2e4ce07
27355d0
1445bd6
aa5dccd
9f9eea9
996b81e
fce4eb4
24af4d3
02dc16d
6464442
7387593
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Since you're not modifying dev_ctx:
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 remove this blank line.
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.
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.
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.
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.
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.
Why 5 dim tensor is a default case?
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 have made a restriction in GetExpectedKernelType that dims must be in range <1,5>. I had to ensure the compiler that there always will be a return value from this function. I can delete the default statement and just leave the instruction outside switch block. What do you think?
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'd add
case 5:
and in default statement throw an error that invalid argument 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.
With this second condition
Attr<std::vector<int>>("dim").size() == dx_dims.size()
you may pass reducing tensor with rank > 5 if one will pass manually reduction of all dims in "dim" attribute. Please first check for 5dim.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.
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.
Here this won't have much impact, but in general this is not the optimal way of adding elements to a vector at the beginning, since right now you'll be copying all vector data a few times. You should rather first allocate appropriate amount of memory and then fill it.
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.
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 is the only change that I haven't implemented. Y tensor is a reduced one, so it has fewer dimensions than X tensor. PaddlePaddle does not keep dims by default, so I have to use x->format(). This operation is safe, because I am checking if the subtensor is on the rightmost part of bigger tensor.