interface ngraph::snippets::pass::TokenizeSnippets¶
Overview¶
Splits model to subgraphs if possible using rules above This pass tokenizes topology graph into subgraphs. Those subgraphs consists of unary or binary layout-oblivious (LO) opetations found in subset 1. Non-layout-oblivious (NLO) operations operations (called also support in this context) are ignored and become a fullstop in tokenization routine. More…
#include <collapse_subgraph.hpp>
template TokenizeSnippets: public ov::pass::MatcherPass
{
// methods
OPENVINO_RTTI("TokenizeSnippets", "0");
};
Inherited Members¶
public:
// typedefs
typedef DiscreteTypeInfo type_info_t;
// methods
bool get_property(const PassPropertyMask& prop_mask) const;
void set_name(const std::string& name);
std::string get_name() const;
void set_callback(const param_callback& callback);
virtual void set_pass_config(const std::shared_ptr<PassConfig>& pass_config);
std::shared_ptr<PassConfig> get_pass_config();
bool m_transformation_callback(const std::shared_ptr<const Node>& node);
bool transformation_callback(const std::shared_ptr<const Node>& node);
virtual const type_info_t& get_type_info() const = 0;
OPENVINO_RTTI("ov::pass::MatcherPass");
MatcherPass& operator = (const MatcherPass&);
bool apply(std::shared_ptr<ov::Node> node);
template <typename T, class... Args>
std::shared_ptr<T> register_new_node(Args&&... args);
template <typename T>
std::shared_ptr<T> register_new_node(const std::shared_ptr<T>& node);
std::shared_ptr<ov::Node> register_new_node_(const std::shared_ptr<ov::Node>& node);
const std::vector<std::shared_ptr<ov::Node>>& get_new_nodes();
void clear_new_nodes();
std::shared_ptr<pattern::Matcher> get_matcher();
Detailed Documentation¶
Splits model to subgraphs if possible using rules above This pass tokenizes topology graph into subgraphs. Those subgraphs consists of unary or binary layout-oblivious (LO) opetations found in subset 1. Non-layout-oblivious (NLO) operations operations (called also support in this context) are ignored and become a fullstop in tokenization routine.
if a considered LO operation doesn’t have any unput subgraphs -> a new single-op subgraph is introduced
if a considered LO operation is a binary or an unary operation with at least one subgraph as an input -> 1. all inputs from the conput subgraphs are collected together
non-subgraph inputs are wrapped into parameters
all input bodies are merged and
this new operation is added to a body of input subgraph
outputs are collected subgraph (outputs consumed by some other node & subgraph outputs consumed by the node to be merged)
finally current node is replaced with the new subgraph. We cannot use replace_node because multiple nodes are replaced so make the replacement manually by redirecting ports New subgraph is introduced, if there is a loop introduced New subgraph is introduced, if number of inputs and outputs exceeds 7 due to scheduling limitation New subgraph is introduced, if multiple outputs of merged nodes are not broadcastable to each other (equality of all outputs is too much on the other hand) Scalar constants are placed as is into subgraph due to optimization purpose