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 2020/04/22 12:09:58 UTC

[GitHub] [incubator-mxnet] bartekkuncer commented on issue #17884: [MKL-DNN] Integrate Conv3d and Pool3d/1d

bartekkuncer commented on issue #17884:
URL: https://github.com/apache/incubator-mxnet/pull/17884#issuecomment-617739799


   **Some more performance numbers for Conv3d:**
   | Shape | Kernel shape  | w/o mkldnn | w/mkldnn |
   | ------------- | ------------- | ------- | --- |
   | (3, 3, 12, 128, 64)  | (2, 2, 2) | 0.56526 sec | 0.00332 sec |
   | (3, 3, 12, 128, 128)  | (2, 2, 2) | 1.06378 sec | 0.00453 sec |
   | (3, 3, 128, 128, 128)  | (2, 2, 2) | 10.53919 sec | 0.04117 sec |
   | (5, 5, 12, 128, 128)  | (2, 2, 2) | 2.76165 sec | 0.00688 sec |
   | (5, 5, 128, 128, 128)  | (2, 2, 2) | 29.06880 sec | 0.07062 sec |
   | (3, 3, 12, 128, 64)  | (3, 3, 3) | 1.48476 sec | 0.00172 sec |
   | (3, 3, 12, 128, 128)  | (3, 3, 3) | 2.87235 sec | 0.00424 sec |
   | (3, 3, 128, 128, 128)  | (3, 3, 3) | 34.26913 sec | 0.04124 sec |
   | (5, 5, 12, 128, 128)  | (3, 3, 3)  | 7.77486 sec | 0.00697 sec |
   | (5, 5, 128, 128, 128)  | (3, 3, 3)  | 141.04758 sec | 0.07259 sec |
   
   **Test I used:**
   ```
   import mxnet as mx
   import time
   
   def perf_conv3d():
       shapes = [(3, 3, 12, 128, 64), (3, 3, 12, 128, 128), (3, 3, 128, 128, 128), (5, 5, 16, 128, 128), (5, 5, 128, 128, 128)]
       kernel_shapes = [(2, 2, 2), (3, 3, 3)]
       num_filter = 32
   
       warmup = 10
       runs = 40
   
       for shape in shapes:
           for kernel_shape in kernel_shapes:
               a = mx.random.uniform(shape=shape)
               w = mx.random.uniform(shape=(num_filter, shape[1], kernel_shape[0], kernel_shape[1], kernel_shape[2]))
   
               tic = 0
               for i in range(runs + warmup):
                   if i == warmup:
                       tic = time.time()
                   _ = mx.nd.Convolution(data=a, weight=w, kernel=kernel_shape, num_filter=num_filter, stride=(1,1,1), pad=(0,0,0), no_bias=True, cudnn_off=True)
                   mx.nd.waitall()
   
               toc = time.time()
               print('conv3d benchmark, shape={}, kernel_shape={} time={} ms/iter'.format(shape, kernel_shape, (toc-tic)*1000/(runs-warmup)))
   
   
   if __name__ == '__main__':
       perf_conv3d()
   ```
   
   Sorry for the delay.


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