-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[TOPI][Relay][ONNX] Replace scatter_add by scatter_elements(reduction="add") #14008
Conversation
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
55ff794
to
171a8cb
Compare
c9abb97
to
20c1b5e
Compare
4b0d49b
to
ca239fe
Compare
from .nms import atomic_add | ||
|
||
|
||
def gen_scatter_add_1d_atomic(data, indices, updates, out, axis, _): |
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.
Ah this is something I think I might have missed. Within indices along a particular axis, do we expect all indices to be unique? Otherwise I believe something similar must be done with all operators.
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.
Yes, potentially we can. The problem is that quick search did not give me any atomic operation like atomic_add, moreover it is not supported by some architectures ("vulkan", "metal"). I postponed this task due to it requires more time for investigation and implementation but does not have any priority.
@tvm-bot rerun |
e108505
to
f710d79
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.
LGTM
Hello @AndrewZhaoLuo! Could you see this PR again? |
f710d79
to
4877b72
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.
Thanks for the refactor @vvchernov !
…="add") (apache#14008) * update paddlepaddle * update tensorflow * update pytorch * remove scatter_add strategy * remove ScatterAddAttrs registration * remove scatter_add from front-end * remove scatter_add schedule and strategy * remove back-end API of scatter_add * update test_op_level3 * add checks for scatter_add to pytorch front-end * remove cpu topi implementation of scatter_add * remove scatter_add strategy for cuda-gpu * transfer reduction_func definition on higher level * use atomic_add in cude scatter_elements. remove cuda implementation for scatter_add * fix lint * remove ScatterAddAttrs * fix condition for using of atomic_add * last upstream of scatter_add with pytorch description. add test case * upstream scatter_elements for CPU with CUDA approach --------- Co-authored-by: Valery Chernov <[email protected]>
Operation scatter_add duplicates one of functionality of scatter_elements. It was replaced, but useful code was transferred to scatter_elements (particularly cuda implementation for 1d input)
cc @AndrewZhaoLuo