From a1cba6cc27fed6f8ec78b09b48ef9b98ce162f41 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Wed, 3 Nov 2021 20:02:46 +0800 Subject: [PATCH] fix(dnn): fix convbias crash on X86 GitOrigin-RevId: 3b33c83d0317475dc1105146a4a9d62fd99b5506 --- dnn/src/fallback/conv_bias/im2col/algos.cpp | 9 +++++++++ dnn/test/x86/conv_bias.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dnn/src/fallback/conv_bias/im2col/algos.cpp b/dnn/src/fallback/conv_bias/im2col/algos.cpp index 30cde32f2..7bb81af5a 100644 --- a/dnn/src/fallback/conv_bias/im2col/algos.cpp +++ b/dnn/src/fallback/conv_bias/im2col/algos.cpp @@ -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 diff --git a/dnn/test/x86/conv_bias.cpp b/dnn/test/x86/conv_bias.cpp index 61bf26475..333ac6e8f 100644 --- a/dnn/test/x86/conv_bias.cpp +++ b/dnn/test/x86/conv_bias.cpp @@ -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 -- GitLab