[TOPI][Relay][ONNX] Replace scatter_add by scatter_elements(reduction="add")#14008
[TOPI][Relay][ONNX] Replace scatter_add by scatter_elements(reduction="add")#14008AndrewZhaoLuo merged 19 commits intoapache:mainfrom
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.
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.
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
|
Hello @AndrewZhaoLuo! Could you see this PR again? |
f710d79 to
4877b72
Compare
AndrewZhaoLuo
left a comment
There was a problem hiding this comment.
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 <valery.chernov@deelvin.com>
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