drivanov commented on issue #16218: Improving performance of argmax operator
URL: https://github.com/apache/incubator-mxnet/pull/16218#issuecomment-534757291
 
 
   @access2rohit: OK, I know what is wrong with your test launching my 
`argmax`. Everything is fine, when axis is specified by it's value (0<=axis < 
dimension): 
   ```
   print(run_performance_test(nd.argmax, run_backward=True, dtype='float32', 
ctx=mx.cpu(),inputs=[{"data":(1024,1024), "axis":0}],warmup=10, runs=25, 
profiler='python'))
   ```
   OR as "-1" (which is equivalent to `axis = lastDimension = dimension - 1` 
   ```
   print(run_performance_test(nd.argmax, run_backward=True, dtype='float32', 
ctx=mx.cpu(),inputs=[{"data":(1024,1024), "axis":-1}],warmup=10, runs=25, 
profiler='python'))
   ```
   But when `axis` is **not directly specified**: 
   ```
   print(run_performance_test(nd.argmax, run_backward=True, dtype='float32', 
ctx=mx.cpu(),inputs=[{"data":(1024,1024)}],warmup=10, runs=25, 
profiler='python')
   ```
   we are getting crash with the error message:
   ```
   mxnet.base.MXNetError: [21:07:34] 
src/operator/tensor/./broadcast_reduce_op.h:683: Global reduction not supported 
yet
   ```
   When I was implementing new version of `argmax`, I left everything which was 
in previously used interface, including following two lines: 
   ```
     const ReduceAxisParam& param = nnvm::get<ReduceAxisParam>(attrs.parsed);
     if (!param.axis) LOG(FATAL) << "Global reduction not supported yet";
   ```
   If you don't see this problem in your implementation of `argmax`, it means 
that you in some way implemented  **"Global reduction"**. I will investigate 
your code and I will try to do something similar.
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to