Shawn-Inspur commented on a change in pull request #6121:
URL: https://github.com/apache/incubator-tvm/pull/6121#discussion_r467374224



##########
File path: topi/python/topi/cuda/conv2d_alter_op.py
##########
@@ -170,6 +170,36 @@ def _alter_conv2d_layout(attrs, inputs, tinfos, out_type):
             "group_conv2d_NCHWc_int8.cuda")
         dispatch_ctx.update(target, new_workload, cfg)
         return relay.nn.conv2d(*inputs, **new_attrs)
+        
+    if topi_tmpl == "conv2d_HWNCnc_tensorcore.cuda":
+        assert data_layout == "HWNC" and kernel_layout == "HWOI"
+
+        H, W, N, CI = get_const_tuple(data.shape)
+        KH, KW, CO, _ = get_const_tuple(kernel.shape)
+
+        if kernel.dtype in ['int4', 'uint4'] and (CI % 32 != 0 or CO % 8 != 0) 
or \
+            kernel.dtype in ['int8', 'uint8'] and (CI % 16 != 0 or CO % 32 != 
0):
+            return relay.nn.conv2d(*inputs, **new_attrs)

Review comment:
       Because wmma is supported by sm_75 or higher, it is better to have a 
check on the GPU compute capability.




----------------------------------------------------------------
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:
[email protected]


Reply via email to