Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU] add u8 weights support in convolution mmad fsv32 kernels (#31353)

Wilson Seok049ff1c61c19
diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_b_fs_yx_fsv32.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_b_fs_yx_fsv32.cl
index 9692edf8872..0620115cfab 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_b_fs_yx_fsv32.cl
+++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_b_fs_yx_fsv32.cl
@@ -40,6 +40,16 @@
#error "convolution_gpu_mmad_b_fs_yx_fsv32: Unsupported block size"
#endif
+#ifdef FILTER_TYPE_UCHAR
+ #define PACKED_WEIGHTS_TYPE uint
+ #define AS_PACKED_WEIGHTS_TYPE_VEC8(x) as_uint8(x)
+#elif defined(FILTER_TYPE_CHAR)
+ #define PACKED_WEIGHTS_TYPE int
+ #define AS_PACKED_WEIGHTS_TYPE_VEC8(x) as_int8(x)
+#else
+ #error "convolution_gpu_mmad_b_fs_yx_fsv32: Unsupported FILTER_TYPE"
+#endif
+
__attribute__((reqd_work_group_size(8, OW_GROUP, 1)))
REQD_SUB_GROUP_SIZE(SUB_GROUP_SIZE)
KERNEL(convolution_mmad_b_fs_yx_fsv32)(
@@ -165,10 +175,10 @@ KERNEL(convolution_mmad_b_fs_yx_fsv32)(
+ kh * ISV_SIZE * OSV_SIZE * FILTER_SIZE_X
+ kw * ISV_SIZE * OSV_SIZE;
- int8 weights_data0 = as_int8(_sub_group_block_read8((const __global uint*)(weights + f_off + 0*8*ISV_SIZE)));
- int8 weights_data1 = as_int8(_sub_group_block_read8((const __global uint*)(weights + f_off + 1*8*ISV_SIZE)));
- int8 weights_data2 = as_int8(_sub_group_block_read8((const __global uint*)(weights + f_off + 2*8*ISV_SIZE)));
- int8 weights_data3 = as_int8(_sub_group_block_read8((const __global uint*)(weights + f_off + 3*8*ISV_SIZE)));
+ MAKE_VECTOR_TYPE(PACKED_WEIGHTS_TYPE, 8) weights_data0 = AS_PACKED_WEIGHTS_TYPE_VEC8(_sub_group_block_read8((const __global uint*)(weights + f_off + 0*8*ISV_SIZE)));
+ MAKE_VECTOR_TYPE(PACKED_WEIGHTS_TYPE, 8) weights_data1 = AS_PACKED_WEIGHTS_TYPE_VEC8(_sub_group_block_read8((const __global uint*)(weights + f_off + 1*8*ISV_SIZE)));
+ MAKE_VECTOR_TYPE(PACKED_WEIGHTS_TYPE, 8) weights_data2 = AS_PACKED_WEIGHTS_TYPE_VEC8(_sub_group_block_read8((const __global uint*)(weights + f_off + 2*8*ISV_SIZE)));
+ MAKE_VECTOR_TYPE(PACKED_WEIGHTS_TYPE, 8) weights_data3 = AS_PACKED_WEIGHTS_TYPE_VEC8(_sub_group_block_read8((const __global uint*)(weights + f_off + 3*8*ISV_SIZE)));
acc[0] = MMAD(src, weights_data0, acc[0]); // 8 elements in 4*lid+0 out channel
acc[1] = MMAD(src, weights_data1, acc[1]); // 8 elements in 4*lid+1 out channel
diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv32.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv32.cl
index 75bd3c6d986..2c7fbfa7bd9 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv32.cl
+++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv32.cl
@@ -48,6 +48,18 @@
#error "convolution_gpu_mmad_bfyx_b_fs_yx_fsv32: Unsupported block size"
#endif
+#ifdef FILTER_TYPE_UCHAR
+ #define PACKED_WEIGHTS_TYPE uint
+ #define AS_PACKED_WEIGHTS_TYPE(x) as_uint(x)
+ #define AS_UNPACK_WEIGHTS_TYPE(x) as_uchar4(x)
+#elif defined(FILTER_TYPE_CHAR)
+ #define PACKED_WEIGHTS_TYPE int
+ #define AS_PACKED_WEIGHTS_TYPE(x) as_int(x)
+ #define AS_UNPACK_WEIGHTS_TYPE(x) as_char4(x)
+#else
+ #error "convolution_gpu_mmad_b_fs_yx_fsv32: Unsupported FILTER_TYPE"
+#endif
+
#define AS_TYPE_N_(type, n, x) as_##type##n(x)
#define AS_TYPE_N(type, n, x) AS_TYPE_N_(type, n, x)
#define AS_INPUT0_TYPE_4(x) AS_TYPE_N(INPUT0_TYPE, 4, x)
@@ -263,9 +275,9 @@ KERNEL(convolution_mmad_bfyx_to_b_fs_yx_fsv32)(
+ kh * OSV * ISV * FILTER_SIZE_X
+ kw * OSV * ISV;
- int weights_data0 = as_int(_sub_group_block_read((const __global uint*)(weights + f_off)));
+ PACKED_WEIGHTS_TYPE weights_data0 = AS_PACKED_WEIGHTS_TYPE(_sub_group_block_read((const __global uint*)(weights + f_off)));
#if OUTPUT_FEATURE_NUM > 16
- int weights_data1 = as_int(_sub_group_block_read((const __global uint*)(weights + f_off + SUB_GROUP_SIZE*ISV)));
+ PACKED_WEIGHTS_TYPE weights_data1 = AS_PACKED_WEIGHTS_TYPE(_sub_group_block_read((const __global uint*)(weights + f_off + SUB_GROUP_SIZE*ISV)));
#endif
PACKED_TYPE_VEC src;
@@ -278,9 +290,9 @@ KERNEL(convolution_mmad_bfyx_to_b_fs_yx_fsv32)(
__attribute__((opencl_unroll_hint(OUTPUT_X_BLOCK_SIZE)))
for (int i = 0; i < OUTPUT_X_BLOCK_SIZE; i++) {
src[i] = line_cache[yb*INPUT_LINE_SIZE + kw*DILATION_SIZE_X + STRIDE_SIZE_X*i];
- acc[yb * 2 + 0][i] = IMAD(acc[yb * 2 + 0][i], AS_INPUT0_TYPE_4(src[i]), as_char4(weights_data0));
+ acc[yb * 2 + 0][i] = IMAD(acc[yb * 2 + 0][i], AS_INPUT0_TYPE_4(src[i]), AS_UNPACK_WEIGHTS_TYPE(weights_data0));
#if OUTPUT_FEATURE_NUM > 16
- acc[yb * 2 + 1][i] = IMAD(acc[yb * 2 + 1][i], AS_INPUT0_TYPE_4(src[i]), as_char4(weights_data1));
+ acc[yb * 2 + 1][i] = IMAD(acc[yb * 2 + 1][i], AS_INPUT0_TYPE_4(src[i]), AS_UNPACK_WEIGHTS_TYPE(weights_data1));
#endif
#if ASYMMETRIC_WEIGHTS_QUANTIZATION
acc_assym_weights[i] = IMAD(acc_assym_weights[i], AS_INPUT0_TYPE_4(src[i]), multiplier);
diff --git a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv4.cl b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv4.cl
index bf5daae2618..74fe71ed124 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv4.cl
+++ b/src/plugins/intel_gpu/src/kernel_selector/cl_kernels/convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv4.cl
@@ -38,6 +38,18 @@
#error "convolution_gpu_mmad_bfyx_to_b_fs_yx_fsv4: Unsupported block size"
#endif
+#ifdef FILTER_TYPE_UCHAR
+ #define PACKED_WEIGHTS_TYPE uint
+ #define AS_PACKED_WEIGHTS_TYPE(x) as_uint(x)
+ #define AS_UNPACK_WEIGHTS_TYPE(x) as_uchar4(x)
+#elif defined(FILTER_TYPE_CHAR)
+ #define PACKED_WEIGHTS_TYPE int
+ #define AS_PACKED_WEIGHTS_TYPE(x) as_int(x)
+ #define AS_UNPACK_WEIGHTS_TYPE(x) as_char4(x)
+#else
+ #error "convolution_gpu_mmad_b_fs_yx_fsv4: Unsupported FILTER_TYPE"
+#endif
+
#define AS_TYPE_N_(type, n, x) as_##type##n(x)
#define AS_TYPE_N(type, n, x) AS_TYPE_N_(type, n, x)
#define AS_INPUT0_TYPE_4(x) AS_TYPE_N(INPUT0_TYPE, 4, x)
@@ -126,16 +138,16 @@ KERNEL(convolution_mmad_bfyx_b_fs_yx_fsv32)(
+ kh * OSV * 4 * FILTER_SIZE_X
+ kw * OSV * 4;
- int weights_data0 = as_int(_sub_group_block_read((const __global uint*)(weights + f_off)));
- int weights_data1 = as_int(_sub_group_block_read((const __global uint*)(weights + f_off + 16*4)));
+ PACKED_WEIGHTS_TYPE weights_data0 = AS_PACKED_WEIGHTS_TYPE(_sub_group_block_read((const __global uint*)(weights + f_off)));
+ PACKED_WEIGHTS_TYPE weights_data1 = AS_PACKED_WEIGHTS_TYPE(_sub_group_block_read((const __global uint*)(weights + f_off + 16*4)));
PACKED_TYPE_VEC src;
__attribute__((opencl_unroll_hint(OUTPUT_X_BLOCK_SIZE)))
for (int i = 0; i < OUTPUT_X_BLOCK_SIZE; i++) {
src[i] = line_cache[kw*DILATION_SIZE_X + STRIDE_SIZE_X*i];
- acc[0][i] = IMAD(acc[0][i], AS_INPUT0_TYPE_4(src[i]), as_char4(weights_data0));
- acc[1][i] = IMAD(acc[1][i], AS_INPUT0_TYPE_4(src[i]), as_char4(weights_data1));
+ acc[0][i] = IMAD(acc[0][i], AS_INPUT0_TYPE_4(src[i]), AS_UNPACK_WEIGHTS_TYPE(weights_data0));
+ acc[1][i] = IMAD(acc[1][i], AS_INPUT0_TYPE_4(src[i]), AS_UNPACK_WEIGHTS_TYPE(weights_data1));
}
}
}
diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_b_fs_yx_fsv32.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_b_fs_yx_fsv32.cpp
index 4222643215d..4627336aad8 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_b_fs_yx_fsv32.cpp
+++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_b_fs_yx_fsv32.cpp
@@ -22,6 +22,7 @@ ParamsKey ConvolutionKernel_mmad_b_fs_yx_fsv32::GetSupportedKey() const {
k.EnableOutputDataType(Datatype::F16);
k.EnableInputWeightsType(WeightsType::INT8);
+ k.EnableInputWeightsType(WeightsType::UINT8);
k.EnableInputLayout(DataLayout::b_fs_yx_fsv32);
k.EnableInputLayout(DataLayout::b_fs_zyx_fsv32);
@@ -144,6 +145,11 @@ JitConstants ConvolutionKernel_mmad_b_fs_yx_fsv32::GetJitConstants(const convolu
jit.Merge(MakeTypeJitConstants(GetPackedInputType(params), "PACKED_IN"));
jit.Merge(MakeTypeJitConstants(GetPackedOutputType(params), "PACKED_OUT"));
+ if (params.weights.GetDType() == WeightsType::INT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_CHAR", 1));
+ } else if (params.weights.GetDType() == WeightsType::UINT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_UCHAR", 1));
+ }
if (!params.fused_ops.empty()) {
auto input_dt = GetActivationType(params);
diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv32.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv32.cpp
index e92e8b7aaea..52dc42fee17 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv32.cpp
+++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv32.cpp
@@ -24,6 +24,7 @@ ParamsKey ConvolutionKernel_mmad_bfyx_to_b_fs_yx_fsv32::GetSupportedKey() const
k.EnableOutputDataType(Datatype::F16);
k.EnableInputWeightsType(WeightsType::INT8);
+ k.EnableInputWeightsType(WeightsType::UINT8);
k.EnableInputLayout(DataLayout::bfyx);
k.EnableInputLayout(DataLayout::bfzyx);
@@ -210,6 +211,12 @@ JitConstants ConvolutionKernel_mmad_bfyx_to_b_fs_yx_fsv32::GetJitConstants(const
jit.Merge(MakeTypeJitConstants(GetPackedInputType(params), "PACKED_IN"));
jit.Merge(MakeTypeJitConstants(GetPackedType(params.outputs[0].GetDType(), 2), "PACKED_OUT"));
+ if (params.weights.GetDType() == WeightsType::INT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_CHAR", 1));
+ } else if (params.weights.GetDType() == WeightsType::UINT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_UCHAR", 1));
+ }
+
if (!params.fused_ops.empty()) {
auto input_dt = GetActivationType(params);
if (WeightsTensor::ChannelsCount(GetPreferredWeightsLayout(params)) == 5) {
diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv4.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv4.cpp
index c0dfe6caa40..903acdd8c82 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv4.cpp
+++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/convolution/convolution_kernel_mmad_bfyx_to_b_fs_yx_fsv4.cpp
@@ -22,6 +22,7 @@ ParamsKey ConvolutionKernel_mmad_bfyx_to_b_fs_yx_fsv4::GetSupportedKey() const {
k.EnableOutputDataType(Datatype::F16);
k.EnableInputWeightsType(WeightsType::INT8);
+ k.EnableInputWeightsType(WeightsType::UINT8);
k.EnableInputLayout(DataLayout::bfyx);
k.EnableOutputLayout(DataLayout::b_fs_yx_fsv4);
@@ -128,6 +129,12 @@ JitConstants ConvolutionKernel_mmad_bfyx_to_b_fs_yx_fsv4::GetJitConstants(const
jit.Merge(MakeTypeJitConstants(GetPackedInputType(params), "PACKED_IN"));
jit.Merge(MakeTypeJitConstants(GetPackedType(params.outputs[0].GetDType(), 2), "PACKED_OUT"));
+ if (params.weights.GetDType() == WeightsType::INT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_CHAR", 1));
+ } else if (params.weights.GetDType() == WeightsType::UINT8) {
+ jit.AddConstant(MakeJitConstant("FILTER_TYPE_UCHAR", 1));
+ }
+
if (!params.fused_ops.empty()) {
auto input_dt = GetActivationType(params);
FusedOpsConfiguration conf0 = {"_0", {"b", "(fg*32 + 2*lid+0)", "y", "(x+i)"}, "res0", input_dt, 1};
diff --git a/src/plugins/intel_gpu/tests/unit/test_cases/convolution_gpu_test.cpp b/src/plugins/intel_gpu/tests/unit/test_cases/convolution_gpu_test.cpp
index 2cc4aef8aa0..dd734a13132 100644
--- a/src/plugins/intel_gpu/tests/unit/test_cases/convolution_gpu_test.cpp
+++ b/src/plugins/intel_gpu/tests/unit/test_cases/convolution_gpu_test.cpp
@@ -8534,6 +8534,7 @@ public:
auto result = net.execute();
auto out_mem = result.at(output_primitive_id()).get_memory();
auto out_lay = out_mem->get_layout();
+ bool is_output_fp = (out_lay.data_type == data_types::f32 || out_lay.data_type == data_types::f16);
cldnn::mem_lock<OutputT> out_ptr(out_mem, get_test_stream());
std::stringstream description;
@@ -8560,10 +8561,15 @@ public:
for (size_t xi = 0; xi < expected[0][0][0].size(); ++xi) {
tensor coords = tensor(batch(bi), feature(fi), spatial(xi, yi, 0, 0));
size_t offset = out_lay.get_linear_offset(coords);
-
- ASSERT_EQ(out_ptr[offset], expected[bi][fi][yi][xi])
- << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
- << description.str();
+ if (is_output_fp) {
+ ASSERT_NEAR(out_ptr[offset], expected[bi][fi][yi][xi], 1e-5f)
+ << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
+ << description.str();
+ } else {
+ ASSERT_EQ(out_ptr[offset], expected[bi][fi][yi][xi])
+ << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
+ << description.str();
+ }
}
}
@@ -8718,6 +8724,18 @@ struct convolution_random_test_all_params {
bool grouped_weights_shape;
};
+template <typename T>
+void get_rng_params(int& min, int& max, int& k, bool is_conv_input = false) {
+ if constexpr (std::is_same<T, int8_t>::value) {
+ min = -128; max = 127;
+ k = is_conv_input ? 8 : 4;
+ } else if constexpr (std::is_same<T, uint8_t>::value) {
+ min = 0; max = 255; k = 1;
+ k = is_conv_input ? 8 : 1;
+ } else {
+ min = -256; max = 256; k = 8;
+ }
+}
template <typename InputT, typename WeightsT, typename OutputT>
class convolution_random_test_base : public convolution_test_base<InputT, WeightsT, OutputT> {
public:
@@ -8759,20 +8777,25 @@ public:
rg.set_seed(GET_SUITE_NAME);
auto wei_in_f = params.input_features / params.groups;
+ int input_min, input_max, input_k;
+ get_rng_params<InputT>(input_min, input_max, input_k, true);
auto input_data = rg.template generate_random_4d<InputT>(
- params.batch, params.input_features, params.input_xy[1], params.input_xy[0], -256, 256);
+ params.batch, params.input_features, params.input_xy[1], params.input_xy[0], input_min, input_max, input_k);
+
+ int weights_min, weights_max, weights_k;
+ get_rng_params<WeightsT>(weights_min, weights_max, weights_k);
if (params.grouped_weights_shape) {
auto weights_data = rg.template generate_random_5d<WeightsT>(
- params.groups, (params.output_features / params.groups), wei_in_f, params.filter_xy[1], params.filter_xy[0], -256, 256);
+ params.groups, (params.output_features / params.groups), wei_in_f, params.filter_xy[1], params.filter_xy[0], weights_min, weights_max, weights_k);
this->set_grouped_weights(std::move(weights_data));
} else {
auto weights_data = rg.template generate_random_4d<WeightsT>(
- params.output_features, wei_in_f, params.filter_xy[1], params.filter_xy[0], -256, 256);
+ params.output_features, wei_in_f, params.filter_xy[1], params.filter_xy[0], weights_min, weights_max, weights_k);
this->set_weights(std::move(weights_data));
}
auto bias_data = params.with_bias ? rg.template generate_random_1d<OutputT>(params.output_features, -256, 256) : VF<OutputT>();
- auto weights_zp_data = params.asymmetric_weights ? rg.template generate_random_1d<WeightsT>(params.output_features, -256, 256) : VF<WeightsT>();
- auto input_zp_data = params.asymmetric_data ? rg.template generate_random_1d<InputT>(params.input_features, -256, 256) : VF<InputT>();
+ auto weights_zp_data = params.asymmetric_weights ? rg.template generate_random_1d<WeightsT>(params.output_features, weights_min, weights_max, weights_k) : VF<WeightsT>();
+ auto input_zp_data = params.asymmetric_data ? rg.template generate_random_1d<InputT>(params.input_features, input_min, input_max, input_k) : VF<InputT>();
this->set_input(params.input_format, std::move(input_data));
this->set_bias(std::move(bias_data));
@@ -8984,6 +9007,7 @@ public:
auto result = net.execute();
auto out_mem = result.at(this->output_primitive_id()).get_memory();
auto out_lay = out_mem->get_layout();
+ bool is_output_fp = (out_lay.data_type == data_types::f32 || out_lay.data_type == data_types::f16);
cldnn::mem_lock<OutputT> out_ptr(out_mem, get_test_stream());
std::stringstream description;
@@ -9010,10 +9034,15 @@ public:
for (size_t xi = 0; xi < expected[0][0][0].size(); ++xi) {
tensor coords = tensor(batch(bi), feature(fi), spatial(xi, yi, 0, 0));
size_t offset = out_lay.get_linear_offset(coords);
-
- ASSERT_EQ(out_ptr[offset], expected[bi][fi][yi][xi])
- << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
- << description.str();
+ if (is_output_fp) {
+ ASSERT_NEAR(out_ptr[offset], expected[bi][fi][yi][xi], 1e-5f)
+ << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
+ << description.str();
+ } else {
+ ASSERT_EQ(out_ptr[offset], expected[bi][fi][yi][xi])
+ << "at b= " << bi << ", f= " << fi << ", y= " << yi << ", x= " << xi << std::endl
+ << description.str();
+ }
}
}
};
@@ -9182,6 +9211,21 @@ struct params_generator : std::vector<convolution_random_test_all_params> {
return *this;
}
+ params_generator& mmad_test_params(format::type input_format,
+ bool asymm_weights = false,
+ bool asymm_data = false,
+ bool padded_input = false,
+ bool bigger_pad = false) {
+ std::vector<size_t> batches = { 1 };
+ for (auto b : batches) {
+ push_back(convolution_random_test_all_params{
+ b, 3, 32, { 224, 224 }, { 3, 3 }, { 2, 2 }, { 0, 0 }, { 1, 1 }, true, 1, input_format, asymm_weights, asymm_data, padded_input, bigger_pad, false });
+ push_back(convolution_random_test_all_params{
+ b, 32, 64, { 112, 112 }, { 1, 1 }, { 1, 1 }, { 0, 0 }, { 1, 1 }, true, 1, input_format, asymm_weights, asymm_data, padded_input, bigger_pad, false });
+ }
+ return *this;
+ }
+
params_generator& all_test_params(format::type input_format,
bool asymm_weights = false,
bool asymm_data = false,
@@ -9286,6 +9330,32 @@ INSTANTIATE_TEST_SUITE_P(
to_string_convolution_all_params
);
+class convolution_random_mmad_test : public testing::TestWithParam<convolution_random_test_all_params> {};
+using convolution_random_test_mmad_u8u8f32 = convolution_random_test_base<uint8_t, uint8_t, float>;
+using convolution_random_test_mmad_s8u8f32 = convolution_random_test_base<int8_t, uint8_t, float>;
+
+TEST_P(convolution_random_mmad_test, s8u8f32) {
+ convolution_random_test_mmad_s8u8f32 test;
+ ASSERT_NO_FATAL_FAILURE(test.run_random(GetParam()));
+}
+
+TEST_P(convolution_random_mmad_test, u8u8f32) {
+ convolution_random_test_mmad_u8u8f32 test;
+ ASSERT_NO_FATAL_FAILURE(test.run_random(GetParam()));
+}
+
+INSTANTIATE_TEST_SUITE_P(
+ basic,
+ convolution_random_mmad_test,
+ testing::ValuesIn(
+ params_generator()
+ .mmad_test_params(format::b_fs_yx_fsv4)
+ .mmad_test_params(format::b_fs_yx_fsv32, true, false)
+ .mmad_test_params(format::b_fs_yx_fsv32, false, false, true)
+ ),
+ to_string_convolution_all_params
+);
+
class convolution_test : public tests::generic_test {
public:
tests::random_generator rg;