Browse Source

fix(dnn/opencl): fix some bug for dnn opencl conv bias and relayout format

GitOrigin-RevId: b5bb07d90d
release-1.10
Megvii Engine Team 3 years ago
parent
commit
4cce2480d5
2 changed files with 46 additions and 0 deletions
  1. +3
    -0
      dnn/src/naive/relayout_format/opr_impl.cpp
  2. +43
    -0
      src/gopt/test/cache_data.h

+ 3
- 0
dnn/src/naive/relayout_format/opr_impl.cpp View File

@@ -474,6 +474,8 @@ void RelayoutFormatImpl::exec(
src.layout.dtype.enumv() == DTypeEnum::Int32 || src.layout.dtype.enumv() == DTypeEnum::Int32 ||
(src.layout.dtype.enumv() == DTypeEnum::Uint8 && (src.layout.dtype.enumv() == DTypeEnum::Uint8 &&
dst.layout.dtype.enumv() == DTypeEnum::QuantizedS8) || dst.layout.dtype.enumv() == DTypeEnum::QuantizedS8) ||
(src.layout.dtype.enumv() == DTypeEnum::Uint8 &&
dst.layout.dtype.enumv() == DTypeEnum::Uint8) ||
src.layout.dtype.category() == DTypeCategory::QUANTIZED); src.layout.dtype.category() == DTypeCategory::QUANTIZED);
check_exec(src.layout, dst.layout, workspace.size); check_exec(src.layout, dst.layout, workspace.size);
HandleImpl* m_handle = static_cast<HandleImpl*>(handle()); HandleImpl* m_handle = static_cast<HandleImpl*>(handle());
@@ -516,6 +518,7 @@ void RelayoutFormatImpl::exec(
DNN_INC_FLOAT16(cb(Float16, dt_float16)); DNN_INC_FLOAT16(cb(Float16, dt_float16));
cb(Quantized8Asymm, dt_uint8); cb(Quantized8Asymm, dt_uint8);
cb(QuantizedS8, dt_int8); cb(QuantizedS8, dt_int8);
cb(Uint8, dt_uint8);
#undef cb #undef cb
default: default:
megdnn_assert(0); megdnn_assert(0);


+ 43
- 0
src/gopt/test/cache_data.h View File

@@ -19940,3 +19940,46 @@ static const std::vector<uint8_t> TestLayoutTransform_OPENCL_Resnet18_F32 = {
52, 44, 87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44, 72, 44, 52, 44, 87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44, 72, 44,
87, 125, 59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70, 108, 111, 87, 125, 59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70, 108, 111,
97, 116, 51, 50, 4, 0, 0, 0, 205, 204, 76, 65}; 97, 116, 51, 50, 4, 0, 0, 0, 205, 204, 76, 65};

static const std::vector<uint8_t> TestLayoutTransform_ConvBiasNobias = {
1, 0, 0, 0, 36, 0, 0, 0, 108, 97, 121, 111, 117, 116, 95, 116,
114, 97, 110, 115, 102, 111, 114, 109, 95, 112, 114, 111, 102, 105, 108, 101,
58, 112, 108, 97, 116, 61, 111, 112, 101, 110, 99, 108, 6, 0, 0, 0,
66, 0, 0, 0, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49, 50, 56,
48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 123, 78, 44, 72, 44, 67,
47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44,
72, 44, 87, 125, 59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70,
108, 111, 97, 116, 51, 50, 4, 0, 0, 0, 0, 0, 0, 0, 130, 0,
0, 0, 10, 151, 159, 190, 73, 14, 145, 194, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 255, 255,
255, 255, 255, 255, 255, 255, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49,
50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 50, 44, 51, 44,
51, 44, 51, 59, 70, 108, 111, 97, 116, 51, 50, 124, 49, 54, 44, 50,
44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51,
50, 124, 50, 49, 4, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0,
49, 54, 44, 50, 44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108,
111, 97, 116, 51, 50, 124, 123, 78, 44, 72, 44, 67, 47, 47, 52, 44,
87, 44, 67, 37, 52, 125, 59, 123, 78, 44, 67, 44, 72, 44, 87, 125,
59, 49, 59, 70, 108, 111, 97, 116, 51, 50, 59, 70, 108, 111, 97, 116,
51, 50, 4, 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 10, 151,
159, 190, 73, 14, 145, 194, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255,
255, 255, 49, 54, 44, 51, 44, 55, 51, 54, 44, 49, 50, 56, 48, 59,
70, 108, 111, 97, 116, 51, 50, 124, 50, 44, 51, 44, 51, 44, 51, 59,
70, 108, 111, 97, 116, 51, 50, 124, 49, 54, 44, 50, 44, 55, 51, 54,
44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124, 48, 49,
4, 0, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 49, 54, 44, 51,
44, 55, 51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51,
50, 124, 123, 78, 44, 67, 44, 72, 44, 87, 125, 59, 123, 78, 44, 72,
44, 67, 47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 49, 59, 70,
108, 111, 97, 116, 51, 50, 59, 70, 108, 111, 97, 116, 51, 50, 4, 0,
0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 49, 54, 44, 50, 44, 55,
51, 54, 44, 49, 50, 56, 48, 59, 70, 108, 111, 97, 116, 51, 50, 124,
123, 78, 44, 67, 44, 72, 44, 87, 125, 59, 123, 78, 44, 72, 44, 67,
47, 47, 52, 44, 87, 44, 67, 37, 52, 125, 59, 49, 59, 70, 108, 111,
97, 116, 51, 50, 59, 70, 108, 111, 97, 116, 51, 50, 4, 0, 0, 0,
0, 0, 0, 0};

Loading…
Cancel
Save