You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/12/25 16:14:07 UTC

[GitHub] [tvm] FrozenGene commented on a change in pull request #7168: [AutoScheduler] Enable winograd for conv2d and layout rewrite for conv3d

FrozenGene commented on a change in pull request #7168:
URL: https://github.com/apache/tvm/pull/7168#discussion_r548888569



##########
File path: python/tvm/relay/op/strategy/x86.py
##########
@@ -476,3 +522,30 @@ def scatter_nd_strategy_cpu(attrs, inputs, out_type, target):
         plevel=10,
     )
     return strategy
+
+
+@conv2d_winograd_without_weight_transfrom_strategy.register("cpu")
+def conv2d_winograd_without_weight_transfrom_strategy_cpu(attrs, inputs, out_type, target):
+    """conv2d_winograd_without_weight_transfrom arm cpu strategy"""

Review comment:
       "arm cpu" -> "cpu"

##########
File path: python/tvm/relay/op/strategy/x86.py
##########
@@ -125,6 +126,32 @@ def conv2d_strategy_cpu(attrs, inputs, out_type, target):
                 wrap_topi_schedule(topi.x86.schedule_conv2d_nhwc),
                 name="conv2d_nhwc.x86",
             )
+
+            judge_winograd_auto_scheduler = False
+            if len(kernel.shape) == 4:
+                kernel_h, kernel_w, _, co = get_const_tuple(kernel.shape)
+                judge_winograd_auto_scheduler = (
+                    "float" in data.dtype
+                    and "float" in kernel.dtype
+                    and kernel_h == 3
+                    and kernel_w == 3
+                    and stride_h == 1
+                    and stride_w == 1
+                    and dilation_h == 1
+                    and dilation_w == 1
+                    and 64 < co < 512

Review comment:
       I think we could add one comment that we find we only work more effective for `64 < co < 512` of resnet18 network on our skylake machine. But this could prompt others maybe you could adjust this condition on your target machine. Otherwise this will bring in some confuse why there is such one condition here.




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