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 2021/04/15 14:51:45 UTC

[GitHub] [incubator-mxnet] PawelGlomski-Intel commented on a change in pull request #20129: [BUGFIX][BACKPORT] Impose a plain format on padded concat output

PawelGlomski-Intel commented on a change in pull request #20129:
URL: https://github.com/apache/incubator-mxnet/pull/20129#discussion_r614140568



##########
File path: tests/python/mkl/test_mkldnn.py
##########
@@ -618,6 +618,35 @@ def check_concat_training(stype):
     for stype in stypes:
         check_concat_training(stype)
 
+def test_concat_blocked():
+    ctx = mx.cpu()
+    axis = 1
+    filters = 32  # must be a multiple of 16
+    kernel = (3, 3)
+    for in_dim_size in range(1, 17):  # check cases with and without padding
+        in_shape = (1, in_dim_size, 64, 64)
+        in_data = mx.nd.random.uniform(-1, 1, in_shape, ctx=ctx)
+        conv_weights = mx.nd.random.uniform(-1, 1, (filters, in_shape[1], kernel[0], kernel[1]), ctx=ctx)
+
+        def calc_output_of_layer(layer):
+            ex = layer._simple_bind(ctx, x=in_shape)
+            in_data.copyto(ex.arg_arrays[0])
+            conv_weights.copyto(ex.arg_arrays[1])
+            return ex.forward()[0].asnumpy()
+
+        x = mx.sym.Variable('x')
+        w = mx.sym.Variable('w')
+        # convolution, so a blocked format is selected
+        conv = mx.sym.Convolution(data=x, weight=w, num_filter=filters, kernel=kernel, pad=(1, 1), no_bias=True)

Review comment:
       AFAIK numpy concatenate does not use oneDNN. I believe this implementation is used: https://github.com/apache/incubator-mxnet/blob/master/src/operator/numpy/np_matrix_op.cc#L681. 
   Should we add oneDNN support?




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