diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-05-14 10:03:56 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-05-14 15:22:54 +0000 |
commit | 090502887d87f52d28e98e90c0e17c582b9e63d6 (patch) | |
tree | ec90250ef4c240c55d3c5da6a6d945ad7a29505f /src/graph/backends | |
parent | a8a7c1d2691fc688dabc275d8b68e5a1267f00af (diff) | |
download | ComputeLibrary-090502887d87f52d28e98e90c0e17c582b9e63d6.tar.gz |
COMPMID-3069: Align graph convolution implementation for CL and NEON.
Enables fast-math on Neon backend for convolution
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ia072f0fd2db1f0814562049b290cffc91cbbd9a8
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3201
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/graph/backends')
-rw-r--r-- | src/graph/backends/NEON/NEFunctionFactory.cpp | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/src/graph/backends/NEON/NEFunctionFactory.cpp b/src/graph/backends/NEON/NEFunctionFactory.cpp index 0aea15d941..454215e7ec 100644 --- a/src/graph/backends/NEON/NEFunctionFactory.cpp +++ b/src/graph/backends/NEON/NEFunctionFactory.cpp @@ -80,78 +80,6 @@ struct NEFusedLayerTypes namespace detail { -// Specialized functions -template <> -std::unique_ptr<IFunction> create_convolution_layer<NEConvolutionLayerFunctions, NETargetInfo>(ConvolutionLayerNode &node, - GraphContext &ctx) -{ - validate_node<NETargetInfo>(node, 3 /* expected inputs */, 1 /* expected outputs */); - - // Extract IO and info - NETargetInfo::TensorType *input = get_backing_tensor<NETargetInfo>(node.input(0)); - NETargetInfo::TensorType *weights = get_backing_tensor<NETargetInfo>(node.input(1)); - NETargetInfo::TensorType *biases = get_backing_tensor<NETargetInfo>(node.input(2)); - NETargetInfo::TensorType *output = get_backing_tensor<NETargetInfo>(node.output(0)); - - const bool is_quantized = is_data_type_quantized_asymmetric(input->info()->data_type()); - - if(is_quantized) - { - biases->info()->set_data_type(DataType::S32); - } - - const PadStrideInfo conv_info = node.convolution_info(); - const ConvolutionMethod conv_algorithm = node.convolution_method(); - const ActivationLayerInfo fused_act = node.fused_activation(); - - // Create and configure function (we assume that functions have been validated before creation) - std::shared_ptr<IMemoryManager> mm = get_memory_manager(ctx, Target::NEON); - std::unique_ptr<IFunction> func; - std::string func_name; - - if(conv_algorithm == ConvolutionMethod::Direct) - { - std::tie(func, func_name) = create_named_memory_managed_function<NEDirectConvolutionLayer>( - std::string("DirectConvolutionLayer"), mm, input, weights, biases, output, conv_info, fused_act); - } - else if(conv_algorithm == ConvolutionMethod::GEMM) - { - std::tie(func, func_name) = create_named_memory_managed_function<NEGEMMConvolutionLayer>( - std::string("GEMMConvolutionLayer"), mm, input, weights, biases, output, conv_info, WeightsInfo(), Size2D(1, 1), fused_act); - } - else if(conv_algorithm == ConvolutionMethod::Winograd) - { - std::tie(func, func_name) = create_named_memory_managed_function<NEWinogradConvolutionLayer>( - std::string("WinogradConvolutionLayer"), mm, input, weights, biases, output, conv_info, fused_act); - } - else - { - std::tie(func, func_name) = create_named_memory_managed_function<NEConvolutionLayer>( - std::string("ConvolutionLayer"), mm, input, weights, biases, output, conv_info, WeightsInfo(), Size2D(1, 1), fused_act); - } - - // Log info - std::ostringstream qss; - if(is_quantized) - { - qss << " Input QuantInfo: " << input->info()->quantization_info() - << " Weights QuantInfo: " << weights->info()->quantization_info() - << " Output QuantInfo: " << output->info()->quantization_info(); - } - ARM_COMPUTE_LOG_GRAPH_INFO("Instantiated " - << node.name() - << " Type: " << func_name - << " Target: " << NETargetInfo::TargetType - << " Data Type: " << input->info()->data_type() - << qss.str() - << " Input shape: " << input->info()->tensor_shape() - << " Weights shape: " << weights->info()->tensor_shape() - << " Output shape: " << output->info()->tensor_shape() - << (fused_act.enabled() ? " " + to_string(fused_act.activation()) : "") - << std::endl); - return func; -} - template <> std::unique_ptr<IFunction> create_normalization_layer<NENormalizationLayer, NETargetInfo>(NormalizationLayerNode &node, GraphContext &ctx) { |