Browse Source

fix(dnn): fix convbias crash on X86

GitOrigin-RevId: 3b33c83d03
release-1.7
Megvii Engine Team 3 years ago
parent
commit
a1cba6cc27
2 changed files with 10 additions and 1 deletions
  1. +9
    -0
      dnn/src/fallback/conv_bias/im2col/algos.cpp
  2. +1
    -1
      dnn/test/x86/conv_bias.cpp

+ 9
- 0
dnn/src/fallback/conv_bias/im2col/algos.cpp View File

@@ -377,6 +377,15 @@ bool ConvBiasImpl::AlgoIm2col::usable(
}
#endif

//! 8x8x32 and 8x8x8 and NO_PACK is not supported
if (matmul_desc.packmode == Pack_Mode::NO_PACK &&
param.src_type.enumv() == DTypeEnum::QuantizedS8 &&
param.bias_type.enumv() == DTypeEnum::QuantizedS32 &&
(param.dst_type.enumv() == DTypeEnum::QuantizedS8 ||
param.dst_type.enumv() == DTypeEnum::QuantizedS32)) {
return false;
}

//! make sure 8x8x16 and 8x8x32 biasmode is nobias and nonlineMode is
//! identity otherwise return false mean that 8x8x32 and 8x8x16 not
//! support PostProcess


+ 1
- 1
dnn/test/x86/conv_bias.cpp View File

@@ -963,7 +963,7 @@ TEST_F(X86_MULTI_THREADS, CONV_BIAS_IM2COLMATMUL_INT8X8X32_FILTER_PREPROCESS) {

#if MEGDNN_X86_WITH_MKL_DNN
if (megdnn::x86::is_supported(x86::SIMDType::VNNI)) {
cb("IM2COLMATMUL:X86_INT8X8X32_MKLDNN");
cb("IM2COLMATMUL");
}
#endif
#if MEGDNN_X86_WITH_VNNI


Loading…
Cancel
Save