shidong-ai / DNNMark

Benchmarks of Deep Neural Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

composed_model fails for MIOpen because dnn_params.h has missing case

mattsinc opened this issue · comments

The composed_model test fails on any AMD hardware I run it on (i.e., with MIOpen) because the code in dnn_params.h does not have an equivalent MIOpen case for CUDNN_CROSS_CORRELATION. I changed this locally to use miopenConvolution, and found that it resolves the issue. However, although this seems like the right solution, since there is no code here I'm wondering if this case was ever tested on AMD HW (maybe I have the wrong branch?)? Currently I'm using the develop branch, if that helps.

Additionally, there is a typo for the miopenTranspose case -- it checks for MIOPEN instead of AMD_MIOPEN.

Here is the diff of my changes:

-#ifdef NVIDIA_CUDNN
       else if (!val.compare("cross_correlation"))
+#ifdef NVIDIA_CUDNN
         conv_param->mode_ = CUDNN_CROSS_CORRELATION;
 #endif
-#ifdef MIOPEN
+#ifdef AMD_MIOPEN
+        conv_param->mode_ = miopenConvolution;
+#endif
+#ifdef AMD_MIOPEN
       else if (!val.compare("transpose"))
         conv_param->mode_ = miopenTranspose;
 #endif
       else
-        LOG(FATAL) << "Invalid conv mode" << std::endl;
+        LOG(FATAL) << "Invalid conv mode: " << val << std::endl;

I'm happy to push a patch if this makes sense, let me know.

Matt

@mattsinc Hi Matt, thanks for pointing this out. I only tested the convolution mode miopenConvolution on AMD HW, since there is no cross_correlation mode in MIOpen.
I think this is a good fix for now, so could you please start a pull request?

@doody1986, pull request submitted.

Matt

@mattsinc Thanks, Matt! The pull request has been merged to the develop branch