masahi commented on a change in pull request #9600:
URL: https://github.com/apache/tvm/pull/9600#discussion_r757974858



##########
File path: src/runtime/contrib/cudnn/conv_forward.cc
##########
@@ -206,23 +206,53 @@ void FindAlgo(int format, int dims, int groups, const int 
pad[], const int strid
 
   // conv desc
   CUDNN_CALL(cudnnSetConvolutionGroupCount(entry_ptr->conv_entry.conv_desc, 
groups));
-  CUDNN_CALL(cudnnSetConvolutionNdDescriptor(entry_ptr->conv_entry.conv_desc, 
dims, pad, stride,
-                                             dilation, CUDNN_CROSS_CORRELATION,
-                                             entry_ptr->conv_entry.data_type));
 
-  std::vector<int> tensor_stride(full_dims);
-  // input desc
-  GetCudnnStride(full_dims, x_dim, tensor_stride.data());
-  CUDNN_CALL(cudnnSetTensorNdDescriptor(entry_ptr->conv_entry.input_desc, 
data_type, full_dims,
-                                        x_dim, tensor_stride.data()));
-  // filter desc
-  CUDNN_CALL(cudnnSetFilterNdDescriptor(entry_ptr->conv_entry.filter_desc, 
data_type,
-                                        entry_ptr->conv_entry.tensor_format, 
full_dims, w_dim));
-
-  // output desc
-  GetCudnnStride(full_dims, y_dim, tensor_stride.data());
-  CUDNN_CALL(cudnnSetTensorNdDescriptor(entry_ptr->conv_entry.output_desc, 
data_type, full_dims,
-                                        y_dim, tensor_stride.data()));
+  if (format == 1) {
+    ICHECK_EQ(full_dims, 4) << "Use of layout CUDNN_TENSOR_NHWC is only 
supported for 4d tensors";

Review comment:
       For NHWC layout, only `cudnnSetTensor4dDescriptor` seems to work. So we 
don't support `NHDWC` conv3d.
   
   Note that there is already the same assert at L160 above.




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