bgawrych opened a new pull request #20757:
URL: https://github.com/apache/incubator-mxnet/pull/20757


   ## Description ##
   Split operation can be done by multiple reorder primitives with properly set 
strides
   
   
![image](https://user-images.githubusercontent.com/59644968/143453189-571cf36f-2532-47ae-ab43-64fe9d1b8139.png)
   
   Benchmark script:
   ```
   import gc
   import mxnet
   import mxnet.gluon.nn as nn
   import mxnet.numpy as np
   import time
   
   
   dims = [128, 512, 1024]
   print("shape;axis;time")
   for ndim in range(2):
      for dim1 in dims:
        for dim2 in dims:
           shape = (dim1, dim2) if ndim == 0 else (8, dim1, dim2)
           a = np.random.uniform(-1.0, 1.0, shape).astype(np.float32)
           for axis in range(2 + ndim):
               for section in (2, 4, 8):
                   tic = time.time()
                   for i in range(100):
                       out = np.array_split(a, axis=axis, 
indices_or_sections=section)
                       [o.wait_to_read() for o in out]
                   toc = time.time()
                   gc.collect()
                   print(f"{shape};{axis};{section};{toc-tic}")
   
   ```


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to