diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-12-14 14:49:56 +0000 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-12-23 14:11:34 +0000 |
commit | 04f4620cf999846a44089c81720aa920edec6993 (patch) | |
tree | 1c0080ac59d5b2aa500cd2b2ceffe0575e22a4b6 /src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h | |
parent | 81fdaddaf36cb4c7ff0d2c52a370dd977a13dc72 (diff) | |
download | ComputeLibrary-04f4620cf999846a44089c81720aa920edec6993.tar.gz |
Add multiple output support for dynamic fusion
* The dependency graph now can schedule any acyclic graph into
a sequential list of operators. This is needed as the output
operators now form branches in the graph.
* Fix the definition of input, output and intermediate tensors
in GpuKernelComponentGroup to support non-linear but sequential
list of operators.
* Add constraint on GpuOperatorGroup to enforce strictly linear
fusion style, but allow output operator as the only form of
branch.
Resolves: COMPMID-5771
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I68de3a31a2456145081f0a397e4e61dd66327682
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8823
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h b/src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h index 4c9d940594..386aefdc05 100644 --- a/src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h +++ b/src/dynamic_fusion/sketch/gpu/GpuKernelComponentGroup.h @@ -29,6 +29,7 @@ #include <cstdint> #include <cstdlib> #include <vector> +#include <set> namespace arm_compute { @@ -88,25 +89,16 @@ public: * @return false If the operation fails */ bool add_component(ComponentPtr component); - /** Get source tensors of this group */ - std::vector<const ITensorInfo *> get_src_tensors() const; - /** Get destination tensors of this group */ - std::vector<const ITensorInfo *> get_dst_tensors() const; + /** Optimize and pre-compute information about the component group */ + void finalize(); + /** Get one of the destination tensors of this group */ + const ITensorInfo *get_any_dst_tensor() const; /** Get tensor argument of this group * A tensor is an argument if it is a source or destination tensor to the group */ std::vector<const ITensorInfo *> get_argument_tensors() const; /** Get the root (first) component of this group */ ComponentPtr get_root_component() const; - /** Get the last component of this group */ - ComponentPtr get_last_component() const; - /** Get the previous component to the component with id @p id - * - * @param[in] id Component id of the component whose previous component is of concern - * - * @return ComponentPtr Pointer to the previous component of the one identified by @p id - */ - ComponentPtr get_previous_component(ComponentId id) const; /** Check if a @ref ITensorInfo is an "intermediate" tensor of the group * * An intermediate tensor is any tensor that is not an argument. @@ -131,11 +123,12 @@ public: typename std::vector<ComponentPtr>::const_iterator cend() const; private: - std::vector<const ITensorInfo *> get_interm_tensors() const; - - static bool is_tensor_in(const ITensorInfo *tensor, const std::vector<const ITensorInfo *> tensors); - std::vector<ComponentPtr> _components{}; + + bool _finalized{ false }; + std::vector<const ITensorInfo *> _argument_tensors{}; + std::set<const ITensorInfo *> _interm_tensors{}; + const ITensorInfo *_any_output_tensor{ nullptr }; }; } // namespace dynamic_fusion } // namespace experimental |