Skip to content

Commit

Permalink
Remove overriden_shapes and corr methods from op::Subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNovoselov committed Nov 4, 2022
1 parent a59b187 commit f70e22f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
9 changes: 0 additions & 9 deletions src/common/snippets/include/snippets/op/subgraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ class Subgraph : public ngraph::op::Op {
return config.m_has_domain_sensitive_ops;
}

const std::vector<ov::Shape>& get_overriden_shapes() const {
return overriden_io_shapes;
}

void set_overriden_shapes(std::vector<ov::Shape>);
size_t tileRank = 0; // set by plugin to facilitate scheduling

snippets::Schedule generate(const BlockedShapeVector& output_shapes, const BlockedShapeVector& input_shapes, ngraph::pass::Manager& opt,
Expand Down Expand Up @@ -167,10 +162,6 @@ class Subgraph : public ngraph::op::Op {
} config;

ov::PartialShape master_shape;
// Input and output shapes that will be passed to snippets::pass::InsertLoops.
// overriden_io_shapes are used to propagate scheduling shapes without a proper body reshape in cases when
// body contains domain-sensitive operations that can't be easily reshaped to an arbitrary domain (e.g. Transpose)
std::vector<ov::Shape> overriden_io_shapes;
};

static inline std::ostream& operator<<(std::ostream& os, const op::Subgraph::BlockedShape& blocked_shape) {
Expand Down
13 changes: 3 additions & 10 deletions src/common/snippets/src/op/subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,8 @@ void snippets::op::Subgraph::set_non_scalar_constants_count(const size_t count)
m_non_scalar_constants_count = count;
}

void snippets::op::Subgraph::set_overriden_shapes(std::vector<ov::Shape> new_shapes) {
// OPENVINO_ASSERT(has_domain_sensitive_ops(), "You can override io shapes only if Subgraph body contains domain-sensitive ops");
size_t body_io_size = m_body->get_parameters().size() + m_body->get_results().size();
OPENVINO_ASSERT(new_shapes.size() == body_io_size, "Invalid number of overriden shapes, must be a shape for every result and parameter");
overriden_io_shapes = std::move(new_shapes);
}

snippets::op::Subgraph::Subgraph(const OutputVector& args, std::shared_ptr<ov::Model> body)
: Op(args), m_body(body), m_generator(nullptr), overriden_io_shapes({}) {
: Op(args), m_body(std::move(body)), m_generator(nullptr) {
const auto ops = m_body->get_ops();
for (const auto& op : ops) {
config.m_is_quantized = config.m_is_quantized || ov::is_type<ov::op::v0::FakeQuantize>(op);
Expand All @@ -65,7 +58,7 @@ snippets::op::Subgraph::Subgraph(const OutputVector& args, std::shared_ptr<ov::M
}

snippets::op::Subgraph::Subgraph(const NodeVector& args, std::shared_ptr<ov::Model> body)
: Subgraph(as_output_vector(args), body) {}
: Subgraph(as_output_vector(args), std::move(body)) {}

std::shared_ptr<Node> snippets::op::Subgraph::clone_with_new_inputs(const OutputVector& inputs) const {
INTERNAL_OP_SCOPE(Subgraph);
Expand Down Expand Up @@ -415,7 +408,7 @@ void snippets::op::Subgraph::convert_to_snippet_dialect() {
if (!has_domain_sensitive_ops())
manager.register_pass<snippets::pass::InsertLoops>(master_shape, tileRank,
m_generator->get_target_machine()->get_lanes());
manager.register_pass<ov::pass::Serialize>("transpose_lowered.xml", "transpose_lowered.bin");
// manager.register_pass<ov::pass::Serialize>("transpose_lowered.xml", "transpose_lowered.bin");
}
manager.run_passes(m_body);
}
Expand Down

0 comments on commit f70e22f

Please sign in to comment.