Browse Source

fix(dnn/cuda): disable cudnn conv_bias kernels for NCHW4_NCHW tensor format

due to illegal memory access errors caused by the kernels

GitOrigin-RevId: 584cedeeab
tags/v1.3.0
Megvii Engine Team 4 years ago
parent
commit
c69359d00d
2 changed files with 8 additions and 1 deletions
  1. +4
    -1
      dnn/src/cuda/conv_bias/cudnn_conv_bias_activation.cpp
  2. +4
    -0
      dnn/test/cuda/conv_bias.cpp

+ 4
- 1
dnn/src/cuda/conv_bias/cudnn_conv_bias_activation.cpp View File

@@ -34,7 +34,10 @@ bool ConvBiasForwardImpl::AlgoCUDNNConvBiasActivation::is_available(
return false;
}
auto&& param = args.opr->param();
if (param.format == param::ConvBias::Format::NCHW4_NCHW32 ||
//! FIXME: conv kernel of cudnn for NCHW4_NCHW tensor format causes illegal
//! memory access errors, so we have to disable this kernel here.
if (param.format == param::ConvBias::Format::NCHW4_NCHW ||
param.format == param::ConvBias::Format::NCHW4_NCHW32 ||
param.format == param::ConvBias::Format::NCHW32_NCHW4)
return false;
if (param.format == param::ConvBias::Format::NCHW &&


+ 4
- 0
dnn/test/cuda/conv_bias.cpp View File

@@ -456,6 +456,9 @@ TEST_F(CUDA, CONV_BIAS_FORWARD_NCHW4) {
checker.exec({{1, 4, 2, 2, 4}, {16, 4, 3, 3, 4}, {1, 4, 1, 1, 4}, {}, {}});
}

//! FIXME: conv kernel of cudnn for NCHW4_NCHW tensor format causes illegal
//! memory access errors, so we have to disable this test here.
#if 0
TEST_F(CUDA, CONV_BIAS_FORWARD_NCHW4_NCHW) {
require_compute_capability(6, 1);
using namespace conv_bias;
@@ -511,6 +514,7 @@ TEST_F(CUDA, CONV_BIAS_FORWARD_NCHW4_NCHW) {
checker.set_param(param);
checker.exec({{1, 4, 2, 2, 4}, {16, 4, 3, 3, 4}, {1, 16, 1, 1}, {}, {}});
}
#endif

#endif



Loading…
Cancel
Save