You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/10/25 01:18:08 UTC
[GitHub] [incubator-mxnet] blchu commented on issue #16615: Faster general
take
blchu commented on issue #16615: Faster general take
URL: https://github.com/apache/incubator-mxnet/pull/16615#issuecomment-546161257
I've done a check and from what I've found only the take op calls that exact function, so I believe that isn't a problem. In any case `TakeCPU/TakeGPU` gives the same results as `Take` when axis=0, so if now or in the future there are other functions that require `Take` along axis=0, that can be replaced with `TakeCPU/TakeGPU`.
The speedup when using actual values is significantly more than with const reference, nearly the same as opposed to several times slower still. Regardless, the function itself only uses exactly 3 of the 20 elements of `in_strides` and `out_strides`, and so replacing the arrays with those three specific values may be better anyway. Would there be a reason to keep the arrays?
Additionally, while removal of the ternary operators that check for the special case axis==0 does also give some speedup, it is very small (+1-2% speed increase) compared to the other changes. So if there is a reason to keep that option, the function should still see nearly the same speedup.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services