From 704c1148b6bd419cf785b209aa261c5a5494cea8 Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Tue, 23 Oct 2018 12:27:13 +0000 Subject: [PATCH] Refine: use im2col+gemm to implement int8 3x3 and 5x5 conv, this will get higher performance --- .../kernel/central-arm-func/conv_arm_func.h | 13 +++++++++---- src/operators/math/conv_arm_int8.h | 4 ---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/operators/kernel/central-arm-func/conv_arm_func.h b/src/operators/kernel/central-arm-func/conv_arm_func.h index f80a8f9441..62296fa631 100644 --- a/src/operators/kernel/central-arm-func/conv_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_arm_func.h @@ -120,10 +120,15 @@ inline void ConvCompute_int8(const ConvParam ¶m) { typedef void (*ConvFunc)(const Tensor &input, const Tensor &kernel, Tensor *output); static ConvFunc conv_funcs_table[7][5] = { - {0, 0, 0, 0, 0}, // k = 1 - {0, 0, 0, 0, 0}, {conv3x3s1_int8, 0, 0, 0, 0}, // k = 3 - {0, 0, 0, 0, 0}, {conv5x5s1_int8, 0, 0, 0, 0}, // k = 5 - {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, // k = 7 + {0, 0, 0, 0, 0}, // k = 1 + // {0, 0, 0, 0, 0}, {conv3x3s1_int8, 0, 0, 0, 0}, // k = 3 + // {0, 0, 0, 0, 0}, {conv5x5s1_int8, 0, 0, 0, 0}, // k = 5 + {0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0}, // k = 3 + {0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0}, // k = 5 + {0, 0, 0, 0, 0}, + {0, 0, 0, 0, 0}, // k = 7 }; const Tensor *input = param.Input(); Tensor *filter = param.Filter(); diff --git a/src/operators/math/conv_arm_int8.h b/src/operators/math/conv_arm_int8.h index 98843e6158..4e59307158 100644 --- a/src/operators/math/conv_arm_int8.h +++ b/src/operators/math/conv_arm_int8.h @@ -24,10 +24,6 @@ namespace operators { void conv3x3s1_int8(const framework::Tensor& input, const framework::Tensor& weight, framework::Tensor* output); -void conv3x3s1_int8_4c(const framework::Tensor& input, - const framework::Tensor& weight, - framework::Tensor* output); - void conv5x5s1_int8(const framework::Tensor& input, const framework::Tensor& weight, framework::Tensor* output); -- GitLab