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 2018/11/28 22:49:43 UTC

[GitHub] anirudh2290 commented on issue #12926: parallelize NDArray::Copy when data size is large

anirudh2290 commented on issue #12926: parallelize NDArray::Copy<cpu, cpu> when data size is large
URL: https://github.com/apache/incubator-mxnet/pull/12926#issuecomment-442635460
 
 
   @XiaotaoChen I tried your benchmark scripts on p2.8xlarge which has 16 cores. I dont see much perf difference. Can we keep the default to -1, and use memcpy when it is set to default . This way we wont impact existing users.
   
   Here are my results:
   ```
   *******************the default copy perf test*******************
   /usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
     from ._conv import register_converters as _register_converters
   <module 'mxnet' from '/home/ubuntu/experimentals/xiataochen_mxnet/python/mxnet/__init__.pyc'>
   size: 20000, shape:(20000, 1)
   mx.nd.copy avg time: 98.951658 (us)
   mx.nd.copyto avg time: 83.843867 (us)
   mx.nd.asnumpy avg time: 28.649966 (us)
   mx.nd.array avg time: 128.841400 (us)
   mx.nd.ones avg time: 86.990992 (us)
   mx.nd.zeros avg time: 87.682406 (us)
   size: 200000, shape:(20000, 10)
   mx.nd.copy avg time: 202.488899 (us)
   mx.nd.copyto avg time: 171.939532 (us)
   mx.nd.asnumpy avg time: 120.393435 (us)
   mx.nd.array avg time: 787.146886 (us)
   mx.nd.ones avg time: 292.460124 (us)
   mx.nd.zeros avg time: 288.883845 (us)
   size: 2000000, shape:(20000, 100)
   mx.nd.copy avg time: 1131.010056 (us)
   mx.nd.copyto avg time: 1066.279411 (us)
   mx.nd.asnumpy avg time: 1369.468371 (us)
   mx.nd.array avg time: 4298.790296 (us)
   mx.nd.ones avg time: 187.500318 (us)
   mx.nd.zeros avg time: 167.926153 (us)
   size: 20000000, shape:(20000, 1000)
   mx.nd.copy avg time: 27297.194799 (us)
   mx.nd.copyto avg time: 9794.155757 (us)
   mx.nd.asnumpy avg time: 27480.689685 (us)
   mx.nd.array avg time: 70762.650172 (us)
   mx.nd.ones avg time: 3512.398402 (us)
   mx.nd.zeros avg time: 2739.222844 (us)
   *******************parallelize copy perf test*******************
   /usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
     from ._conv import register_converters as _register_converters
   <module 'mxnet' from '/home/ubuntu/experimentals/xiataochen_mxnet/python/mxnet/__init__.pyc'>
   size: 20000, shape:(20000, 1)
   mx.nd.copy avg time: 102.551778 (us)
   mx.nd.copyto avg time: 83.732605 (us)
   mx.nd.asnumpy avg time: 28.316180 (us)
   mx.nd.array avg time: 126.830737 (us)
   mx.nd.ones avg time: 93.253454 (us)
   mx.nd.zeros avg time: 93.762080 (us)
   size: 200000, shape:(20000, 10)
   mx.nd.copy avg time: 187.253952 (us)
   mx.nd.copyto avg time: 173.560778 (us)
   mx.nd.asnumpy avg time: 120.075544 (us)
   mx.nd.array avg time: 787.965457 (us)
   mx.nd.ones avg time: 283.519427 (us)
   mx.nd.zeros avg time: 283.678373 (us)
   size: 2000000, shape:(20000, 100)
   mx.nd.copy avg time: 1089.898745 (us)
   mx.nd.copyto avg time: 1079.169909 (us)
   mx.nd.asnumpy avg time: 1450.212797 (us)
   mx.nd.array avg time: 4908.100764 (us)
   mx.nd.ones avg time: 194.748243 (us)
   mx.nd.zeros avg time: 181.714694 (us)
   size: 20000000, shape:(20000, 1000)
   mx.nd.copy avg time: 27326.941490 (us)
   mx.nd.copyto avg time: 9780.820211 (us)
   mx.nd.asnumpy avg time: 27630.313238 (us)
   mx.nd.array avg time: 70585.219065 (us)
   mx.nd.ones avg time: 3420.662880 (us)
   mx.nd.zeros avg time: 3225.604693 (us)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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