apeforest commented on issue #15429: Operator Performance Regression on CPU
URL: 
https://github.com/apache/incubator-mxnet/issues/15429#issuecomment-508831324
 
 
   https://github.com/apache/incubator-mxnet/pull/15240 may introduced extra 
runtime in profiler in mxnet 1.5. Using timeit module, `broadcast_add` between 
mxnet1.4 and mxnet1.5-int64 does not show significant difference:
   ```
   import timeit
   SETUP_CODE = '''
   import mxnet as mx
   from mxnet import nd
   mx.random.seed(10)
   def binary_op(lhs, rhs):
       return nd.broadcast_add(lhs=lhs, rhs=rhs,  dtype='float32', ctx=mx.cpu())
   
   lhs = nd.random.uniform(shape=(1024, 1024), dtype='float32', ctx=mx.cpu())
   rhs = nd.random.uniform(shape=(1, 1024), dtype='float32', ctx=mx.cpu())
   res = binary_op(lhs, rhs)
   '''
   
   TEST_CODE = '''
   res.wait_to_read()
   '''
   # timeit.repeat statement
   times = timeit.repeat(setup = SETUP_CODE,
                         stmt = TEST_CODE,
                         repeat = 3,
                         number = 10000)
   
   # priniting minimum exec. time
   print('time: {}'.format(min(times)))
   ```
   
   mxnet 1.4:  time: 0.007329841988394037
   mxnet 1.5 (with int64 flag): time: 0.007355470006586984
   mxnet 1.5 (default):  time: 0.007073252985719591

----------------------------------------------------------------
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