-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[RELAY]sch and compute for reduce ops #2091
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
|
Looks good to me once CI passes. |
3822b2a to
775fdb0
Compare
Any idea why |
7b96479 to
9775d5d
Compare
9775d5d to
c113712
Compare
fd7f81f to
e178285
Compare
9d8b87c to
204fc60
Compare
204fc60 to
18d772f
Compare
src/relay/op/tensor/reduce.cc
Outdated
| const Target& target) { | ||
| const auto* param = attrs.as<ReduceAttrs>(); | ||
| auto r_axes = GetReduceAxes(inputs[0]->shape.size(), | ||
| param->axis, param->exclude); |
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 certainly the shortest line of addition to implement the feature. But not necessarily the fastest to run. Note that the reduction in topi already supports negative index. So we don't need to handle negative index here, the only thing we need to handle is exclude, we can use another function GetExcludeAxes to get the other axes and return them as Array when there is exclude
python/tvm/relay/op/_reduce.py
Outdated
|
|
||
| def _schedule_reduce(_, outs, target): | ||
| """Generic schedule for reduce""" | ||
| with tvm.target.create(target): |
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 target:
|
see the compute impl in #2163 that reflects the commend, the test-cases are still helpful and we would like to bring it in after 2163 |
18d772f to
82ae617
Compare
82ae617 to
96bdd3d
Compare
|
Thanks @siju-samuel @jroesch this is merged |
#2051
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers.