aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/graph
diff options
context:
space:
mode:
authorSheri Zhang <sheri.zhang@arm.com>2021-11-03 21:24:00 +0000
committerSheri Zhang <sheri.zhang@arm.com>2021-11-04 15:35:58 +0000
commitc65023e01d8e5c8f5af15dd8e2ca4fae3c4889f9 (patch)
tree313c5c0786971986d92c2e59073eb06406f43990 /arm_compute/graph
parentcc859158faff318a81dd9aafcc5b609d7dd5d4a9 (diff)
downloadComputeLibrary-c65023e01d8e5c8f5af15dd8e2ca4fae3c4889f9.tar.gz
Refine code for graph level fusion
Partially resolves: COMPMID-4701 Signed-off-by: Sheri Zhang <sheri.zhang@arm.com> Change-Id: I11fb89bd31ef5a98ad9a2d6bb5fd0c1e8371b52f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6572 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/graph')
-rw-r--r--arm_compute/graph/INode.h28
-rw-r--r--arm_compute/graph/backends/FunctionHelpers.h1
-rw-r--r--arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h23
-rw-r--r--arm_compute/graph/printers/DotGraphPrinter.h23
4 files changed, 27 insertions, 48 deletions
diff --git a/arm_compute/graph/INode.h b/arm_compute/graph/INode.h
index b92003464c..becd672d90 100644
--- a/arm_compute/graph/INode.h
+++ b/arm_compute/graph/INode.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Arm Limited.
+ * Copyright (c) 2018-2019,2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -29,6 +29,7 @@
#include "arm_compute/graph/TensorDescriptor.h"
#include "arm_compute/graph/Types.h"
+#include <list>
#include <set>
namespace arm_compute
@@ -240,18 +241,29 @@ public:
* @return Assigned target of this node
*/
Target assigned_target() const;
+ /** Post operator info list
+ *
+ * @return Post operator info list
+ */
+ const std::list<std::unique_ptr<ConvPostOpInfo>> &post_op_info_list() const;
+ /** Post operator info list
+ *
+ * @return Post operator info list
+ */
+ std::list<std::unique_ptr<ConvPostOpInfo>> &post_op_info_list();
protected:
friend class Graph;
protected:
- Graph *_graph; /**< Backward reference to graph owning the node */
- NodeID _id; /**< Node ID */
- NodeParams _common_params; /**< Node common params */
- std::vector<TensorID> _outputs; /**< Output of the node */
- std::vector<EdgeID> _input_edges; /**< Inputs edge set */
- std::set<EdgeID> _output_edges; /**< Output edge set */
- Target _assigned_target; /**< Assigned target by the Graph executor */
+ Graph *_graph; /**< Backward reference to graph owning the node */
+ NodeID _id; /**< Node ID */
+ NodeParams _common_params; /**< Node common params */
+ std::vector<TensorID> _outputs; /**< Output of the node */
+ std::vector<EdgeID> _input_edges; /**< Inputs edge set */
+ std::set<EdgeID> _output_edges; /**< Output edge set */
+ Target _assigned_target; /**< Assigned target by the Graph executor */
+ std::list<std::unique_ptr<ConvPostOpInfo>> _post_op_info_list; /**< Post operator info list */
};
} // namespace graph
} // namespace arm_compute
diff --git a/arm_compute/graph/backends/FunctionHelpers.h b/arm_compute/graph/backends/FunctionHelpers.h
index 6bec66a6ff..6aec3f6590 100644
--- a/arm_compute/graph/backends/FunctionHelpers.h
+++ b/arm_compute/graph/backends/FunctionHelpers.h
@@ -602,6 +602,7 @@ std::unique_ptr<IFunction> create_fused_convolution_with_post_op(FusedConvolutio
std::unique_ptr<IFunction> func;
std::string func_name;
+ // Fuse convolution with post ops is only supported for conv1x1, which is only implemented as gemmconv2d
std::tie(func, func_name) = create_named_memory_managed_function<typename ConvolutionLayerFunctions::GEMMConvolutionLayer>(
std::string("GEMMConvolutionLayer"), mm,
input, weights, biases, output, conv_info,
diff --git a/arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h b/arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h
index 0bb3d1b7ef..6048994b02 100644
--- a/arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h
+++ b/arm_compute/graph/nodes/FusedConvolutionWithPostOpNode.h
@@ -72,16 +72,6 @@ public:
* @return Fast math hint to be used by the node
*/
FastMathHint fast_math_hint() const;
- /** Post operator info list
- *
- * @return Post operator info list
- */
- const std::list<std::unique_ptr<ConvPostOpInfo>> &post_op_info_list() const;
- /** Post operator info list
- *
- * @return Post operator info list
- */
- std::list<std::unique_ptr<ConvPostOpInfo>> &post_op_info_list();
/** Convolution metadata accessor
*
* @return Convolution information
@@ -129,13 +119,12 @@ public:
static constexpr NodeType node_type = NodeType::FusedConvolutionWithPostOp;
private:
- PadStrideInfo _info;
- unsigned int _num_groups;
- ConvolutionMethod _method;
- FastMathHint _fast_math_hint;
- QuantizationInfo _out_quant_info;
- ActivationLayerInfo _fused_activation;
- std::list<std::unique_ptr<ConvPostOpInfo>> _post_op_info_list;
+ PadStrideInfo _info;
+ unsigned int _num_groups;
+ ConvolutionMethod _method;
+ FastMathHint _fast_math_hint;
+ QuantizationInfo _out_quant_info;
+ ActivationLayerInfo _fused_activation;
};
} // namespace graph
} // namespace arm_compute
diff --git a/arm_compute/graph/printers/DotGraphPrinter.h b/arm_compute/graph/printers/DotGraphPrinter.h
index 41607e831a..42a20678fe 100644
--- a/arm_compute/graph/printers/DotGraphPrinter.h
+++ b/arm_compute/graph/printers/DotGraphPrinter.h
@@ -1,27 +1,4 @@
/*
- * Copyright (c) 2021 Arm Limited.
- *
- * SPDX-License-Identifier: MIT
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-/*
* Copyright (c) 2018-2019,2021 Arm Limited.
*
* SPDX-License-Identifier: MIT