Enable multiplier of depthwise_conv2d (#2322)
author남궁석/동작제어Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Fri, 17 Aug 2018 04:13:16 +0000 (13:13 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Fri, 17 Aug 2018 04:13:16 +0000 (13:13 +0900)
Since arm compute library 18.05, multiplier of depthwise_conv2d is enabled.
By applying this feature, below tests pass
`GeneratedTests.depthwise_conv2d_float_2`
`GeneratedTests.depthwise_conv2d_float_large_2_weights_as_inputs`
`GeneratedTests.depthwise_conv2d_float`
`GeneratedTests.depthwise_conv2d_float_weights_as_inputs`
`GeneratedTests.depthwise_conv2d_quant8_2`

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 09beb35..1ebcd2b 100644 (file)
@@ -971,8 +971,6 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Implicit::Nod
 
   auto multiplier = _ctx.at(multipler_index).asScalar<int>();
 
-  // Multiplier in CLDepthwiseConvolutionLayer is supported after ARMCompute 18.05
-  assert(multiplier == 1);
   assert(ker_shape.C == bias_size);
   assert(ker_shape.C == ifm_shape.C * multiplier);
 
@@ -1065,7 +1063,7 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Implicit::Nod
 
     auto fn = nnfw::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>();
 
-    fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info);
+    fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler);
 
     builder.append("DepthwiseConv2D", std::move(fn));
 
@@ -1102,8 +1100,6 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Explicit::Nod
 
   auto multiplier = _ctx.at(multipler_index).asScalar<int>();
 
-  // Multiplier in CLDepthwiseConvolutionLayer is supported after ARMCompute 18.05
-  assert(multiplier == 1);
   assert(ker_shape.C == bias_size);
   assert(ker_shape.C == ifm_shape.C * multiplier);
 
@@ -1189,7 +1185,7 @@ void Planner::visit(const ::internal::tflite::op::DepthwiseConv2D::Explicit::Nod
 
     auto fn = nnfw::make_unique<::arm_compute::CLDepthwiseConvolutionLayer>();
 
-    fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info);
+    fn->configure(ifm_alloc, ker_alloc, bias_alloc, ofm_alloc, conv_info, param.multipler);
 
     builder.append("DepthwiseConv2D", std::move(fn));