From 20f85d915a98af7a863293c249459fc653d9e8ba Mon Sep 17 00:00:00 2001 From: Alexandra Sidorova Date: Wed, 19 Apr 2023 12:38:14 +0400 Subject: [PATCH] [Snippets] Rebased on the latest master --- .../include/snippets/op/serialization_node.hpp | 2 +- .../snippets/include/snippets/target_machine.hpp | 4 ++-- src/common/snippets/src/lowered/expression.cpp | 2 +- src/common/snippets/src/lowered/linear_ir.cpp | 16 ++++++++-------- .../src/lowered/pass/allocate_buffers.cpp | 4 ++-- .../src/lowered/pass/assign_registers.cpp | 2 +- .../src/lowered/pass/indentify_buffers.cpp | 2 +- .../snippets/src/lowered/pass/insert_buffers.cpp | 4 ++-- .../src/lowered/pass/propagate_layout.cpp | 4 ++-- src/common/snippets/src/tensor_descriptor.cpp | 8 ++++---- .../pass/lowered/fuse_load_store_and_convert.cpp | 4 ++-- src/plugins/intel_cpu/thirdparty/onednn | 2 +- src/plugins/intel_gpu/thirdparty/onednn_gpu | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/common/snippets/include/snippets/op/serialization_node.hpp b/src/common/snippets/include/snippets/op/serialization_node.hpp index a3f7f7a9b3ff1a..229aa649189111 100644 --- a/src/common/snippets/include/snippets/op/serialization_node.hpp +++ b/src/common/snippets/include/snippets/op/serialization_node.hpp @@ -25,7 +25,7 @@ class SerializationNode : public ngraph::op::Op { SerializationNode(const Output &arg, const std::shared_ptr& expr) : Op({arg}), m_expr(expr) { if (!m_expr || !m_expr->get_node()) - throw ngraph_error("SerializationNode requires a valid expression with non-null node pointer"); + OPENVINO_THROW("SerializationNode requires a valid expression with non-null node pointer"); const auto& node = expr->get_node(); std::string type = node->get_type_name(); std::string name = node->get_friendly_name(); diff --git a/src/common/snippets/include/snippets/target_machine.hpp b/src/common/snippets/include/snippets/target_machine.hpp index 606ba6b9d3265a..db1a8c25665c83 100644 --- a/src/common/snippets/include/snippets/target_machine.hpp +++ b/src/common/snippets/include/snippets/target_machine.hpp @@ -49,7 +49,7 @@ class TargetMachine { std::function(const std::shared_ptr)> get(const ngraph::DiscreteTypeInfo& type) const { auto jitter = jitters.find(type); if (jitter == jitters.end()) { - throw ngraph_error(std::string("Target code emitter is not available for ") + type.name + " operation."); + OPENVINO_THROW(std::string("Target code emitter is not available for ") + type.name + " operation."); } return jitter->second.first; } @@ -58,7 +58,7 @@ class TargetMachine { get_supported_precisions(const ngraph::DiscreteTypeInfo type) const { auto jitter = jitters.find(type); if (jitter == jitters.end()) { - throw ngraph_error(std::string("Target code emitter is not available for ") + type.name + " operation."); + OPENVINO_THROW(std::string("Target code emitter is not available for ") + type.name + " operation."); } return jitter->second.second; } diff --git a/src/common/snippets/src/lowered/expression.cpp b/src/common/snippets/src/lowered/expression.cpp index bc254fcd7869fc..e543e211d57b7f 100644 --- a/src/common/snippets/src/lowered/expression.cpp +++ b/src/common/snippets/src/lowered/expression.cpp @@ -44,7 +44,7 @@ Expression::Expression(const std::shared_ptr& n, std::vector Expression::get_node() const { if (!m_source_node) - throw ngraph_error("An attempt to get uninitialized node from lowered expression"); + OPENVINO_THROW("An attempt to get uninitialized node from lowered expression"); return m_source_node; } diff --git a/src/common/snippets/src/lowered/linear_ir.cpp b/src/common/snippets/src/lowered/linear_ir.cpp index d3887fda6a02fb..976efd62e7f639 100644 --- a/src/common/snippets/src/lowered/linear_ir.cpp +++ b/src/common/snippets/src/lowered/linear_ir.cpp @@ -61,7 +61,7 @@ LinearIR::LinearIR(const std::shared_ptr& model, Config config) ov::NodeVector LinearIR::get_ordered_ops(const std::shared_ptr& m) { if (!m->get_sinks().empty()) - throw ngraph_error("Linear IR is not supposed to work for model with sinks. Check your transformation pipeline."); + OPENVINO_THROW("Linear IR is not supposed to work for model with sinks. Check your transformation pipeline."); // Note that an important difference between this impl and Model::get_ordered_ops is that Results and Parameters // are added in REVERSE order, so they will be visited in DIRECT order compared to get_parameters() and get_results() @@ -135,7 +135,7 @@ void LinearIR::debug_print(bool tds_as_pointers) const { if (tds_as_pointers) { for (const auto& in : expr->get_inputs()) { if (td2int.count(in) == 0) - throw ngraph_error("Undefined input descriptor for op"); + OPENVINO_THROW("Undefined input descriptor for op"); std::cerr << td2int.at(in) << ", "; } std::cerr << "\b\b => "; @@ -174,14 +174,14 @@ ExpressionPtr LinearIR::get_expr_by_node(const std::shared_ptr& n) const { ExpressionPort LinearIR::get_expr_by_output(const TensorDescriptorPtr& td) const { auto found = m_output2expression_map.find(td); if (found == m_output2expression_map.end()) - throw ngraph_error("Failed to find expression by output tensor descriptor"); + OPENVINO_THROW("Failed to find expression by output tensor descriptor"); return found->second; } const std::set& LinearIR::get_exprs_by_input(const TensorDescriptorPtr& td) const { auto found = m_input2expression_map.find(td); if (found == m_input2expression_map.end()) - throw ngraph_error("Failed to find expression by input tensor descriptor"); + OPENVINO_THROW("Failed to find expression by input tensor descriptor"); return found->second; } @@ -197,7 +197,7 @@ void LinearIR::replace_input(const ExpressionPort& expr_port, const TensorDescri const auto from = expr->m_inputs[port]; auto found = m_input2expression_map.find(from); if (found == m_input2expression_map.end() || found->second.count(expr_port) == 0) - throw ngraph_error("Invalid expression of input was provided to replace_input"); + OPENVINO_THROW("Invalid expression of input was provided to replace_input"); found->second.erase(expr_port); { const auto& res = m_input2expression_map.insert({to, std::set{expr_port}}); @@ -221,7 +221,7 @@ void LinearIR::replace_output(const ExpressionPort& expr_port, const TensorDescr const auto from = expr->m_outputs[port]; auto found = m_output2expression_map.find(from); if (found == m_output2expression_map.end() || found->second != expr_port) - throw ngraph_error("Invalid expression of output was provided to replace_output"); + OPENVINO_THROW("Invalid expression of output was provided to replace_output"); m_output2expression_map.erase(found); m_output2expression_map[to] = expr_port; expr->replace_output(port, to); @@ -229,7 +229,7 @@ void LinearIR::replace_output(const ExpressionPort& expr_port, const TensorDescr void LinearIR::register_regular_expression(const ExpressionPtr& expr) { if (is_type(expr->get_node()) || is_type(expr->get_node())) - throw ngraph_error("LinearIR::insert can't be used to add Parameters or Results to IR"); + OPENVINO_THROW("LinearIR::insert can't be used to add Parameters or Results to IR"); register_expression(expr); } @@ -238,7 +238,7 @@ void LinearIR::register_expression(const ExpressionPtr& expr) { { const auto& res = m_node2expression_map.insert({node, expr}); if (!res.second) - throw ngraph_error("Duplicate node is detected in linear IR: " + std::string(node->get_friendly_name())); + OPENVINO_THROW("Duplicate node is detected in linear IR: " + std::string(node->get_friendly_name())); } for (size_t i = 0; i < expr->m_outputs.size(); ++i) { const auto& out = expr->m_outputs[i]; diff --git a/src/common/snippets/src/lowered/pass/allocate_buffers.cpp b/src/common/snippets/src/lowered/pass/allocate_buffers.cpp index 79f5d79fad09ab..9e17b573aa274e 100644 --- a/src/common/snippets/src/lowered/pass/allocate_buffers.cpp +++ b/src/common/snippets/src/lowered/pass/allocate_buffers.cpp @@ -30,7 +30,7 @@ void AllocateBuffers::propagate_offset(const LinearIR& linear_ir, const Expressi if (memory_access && memory_access->is_memory_access_output_port(port)) { memory_access->set_output_offset(offset, port); } else { - throw ngraph_error( + OPENVINO_THROW( "Buffer::set_offset() was called when Buffer didn't have the corresponding MemoryAccess op for offset propagation"); } } @@ -48,7 +48,7 @@ void AllocateBuffers::propagate_offset(const LinearIR& linear_ir, const Expressi // After Loop initialization, Buffer can be connected to LoopEnd - it's ok continue; } else { - throw ngraph_error( + OPENVINO_THROW( "Buffer::set_offset() was called when Buffer didn't have the corresponding MemoryAccess op for offset propagation"); } } diff --git a/src/common/snippets/src/lowered/pass/assign_registers.cpp b/src/common/snippets/src/lowered/pass/assign_registers.cpp index 79263c06a93d62..1d770d1b5e6c5e 100644 --- a/src/common/snippets/src/lowered/pass/assign_registers.cpp +++ b/src/common/snippets/src/lowered/pass/assign_registers.cpp @@ -51,7 +51,7 @@ bool AssignRegisters::run(LinearIR& linear_ir) { else if (io_expr->get_type() == IOExpression::io_type::OUTPUT) manually_assigned_gprs[expr->get_inputs()[0]] = num_parameters + io_expr->get_index(); else - throw ngraph_error("Unsupported io_type detected"); + OPENVINO_THROW("Unsupported io_type detected"); } else if (const auto& buffer = ov::as_type_ptr(op)) { const auto buffer_id = buffer->get_id(); // All buffers have one common data pointer diff --git a/src/common/snippets/src/lowered/pass/indentify_buffers.cpp b/src/common/snippets/src/lowered/pass/indentify_buffers.cpp index 1a2b11d63a780a..769454c36aded2 100644 --- a/src/common/snippets/src/lowered/pass/indentify_buffers.cpp +++ b/src/common/snippets/src/lowered/pass/indentify_buffers.cpp @@ -103,7 +103,7 @@ std::vector IdentifyBuffers::create_adjacency_matrix(const LinearIR& linea } } } else { - throw ov::Exception("Buffer has incorrect siblings! There can be only LoopEnds"); + OPENVINO_THROW("Buffer has incorrect siblings! There can be only LoopEnds"); } } } diff --git a/src/common/snippets/src/lowered/pass/insert_buffers.cpp b/src/common/snippets/src/lowered/pass/insert_buffers.cpp index e1e795d13555e1..09efcf3e4b47da 100644 --- a/src/common/snippets/src/lowered/pass/insert_buffers.cpp +++ b/src/common/snippets/src/lowered/pass/insert_buffers.cpp @@ -31,7 +31,7 @@ LinearIR::constExprIt InsertBuffers::insertion_position(const LinearIR& linear_i // If loop_ids of expressions are equal and don't contain LOOP_NULL_ID, it's attempt to insert Buffer between expressions from the same Loop! if (loop_idx == up_loops.size() && std::none_of(up_loops.begin(), up_loops.end(), [](const size_t id) { return id == Expression::LOOP_NULL_ID; })) - throw ov::Exception("Buffer isn't supported in Inner Loop at the moment!"); + OPENVINO_THROW("Buffer isn't supported in Inner Loop at the moment!"); // If the both expressions are outside Loops, insert Buffer explicitly after first Expression if (loop_idx == up_loops.size()) { @@ -53,7 +53,7 @@ LinearIR::constExprIt InsertBuffers::insertion_position(const LinearIR& linear_i loop_manager->get_loop_bounds(linear_ir, down_loop_id, loop_begin_pos, loop_end_pos); return loop_begin_pos; } else { - throw ov::Exception("Incorrect configuration for Buffer insertion!"); + OPENVINO_THROW("Incorrect configuration for Buffer insertion!"); } } diff --git a/src/common/snippets/src/lowered/pass/propagate_layout.cpp b/src/common/snippets/src/lowered/pass/propagate_layout.cpp index fa3de373f0e23a..85c3facb9e7d2a 100644 --- a/src/common/snippets/src/lowered/pass/propagate_layout.cpp +++ b/src/common/snippets/src/lowered/pass/propagate_layout.cpp @@ -25,7 +25,7 @@ bool PropagateLayout::run(LinearIR& linear_ir) { const bool is_input = expr->get_type() == IOExpression::io_type::INPUT; const auto& tds = is_input ? expr->get_outputs() : expr->get_inputs(); if (tds.size() != 1) - throw ngraph_error("Parameter/Results should have exactly one output/input"); + OPENVINO_THROW("Parameter/Results should have exactly one output/input"); const auto& target_td = tds[0]; // If input - we should be looking downstream, if output - upstream if (is_input) { @@ -40,7 +40,7 @@ bool PropagateLayout::run(LinearIR& linear_ir) { // Note: this limitation could be relaxed to multiple ops, // but all of them must have the same shape and layout if (!child_layout.empty() && child->get_outputs().front()->get_layout() != child_layout) - throw ngraph_error("All children of an input expression must have the same layout"); + OPENVINO_THROW("All children of an input expression must have the same layout"); child_layout = child->get_outputs().front()->get_layout(); } } diff --git a/src/common/snippets/src/tensor_descriptor.cpp b/src/common/snippets/src/tensor_descriptor.cpp index 947266a2b7c5ac..a3182686c80c2a 100644 --- a/src/common/snippets/src/tensor_descriptor.cpp +++ b/src/common/snippets/src/tensor_descriptor.cpp @@ -23,7 +23,7 @@ TensorDescriptor::TensorDescriptor(const Output& out, const auto& pshape = out.get_partial_shape(); // Note: this limitation could be relaxed if necessary if (pshape.is_dynamic()) - throw ngraph_error("Snippets tensor descriptor can be created only for static shapes"); + OPENVINO_THROW("Snippets tensor descriptor can be created only for static shapes"); m_tensor_shape = pshape.get_shape(); validate_arguments(); } @@ -41,7 +41,7 @@ void TensorDescriptor::validate_arguments() { // NCHW layout by default std::iota(m_layout.begin(), m_layout.end(), 0); } else if (m_layout.size() != m_tensor_shape.size()) { - throw ngraph_error("Snippets tensor descriptor: Layout size must be equal to the shape size"); + OPENVINO_THROW("Snippets tensor descriptor: Layout size must be equal to the shape size"); } } @@ -113,7 +113,7 @@ void set_tensor_descriptor_ptr(const Output& out, const TensorDescript } else { auto& value = found->second.as().m_value; if (value.size() != node->get_output_size()) - throw ngraph_error("Either all or none of Tensor descriptors should be stored in rt_info (set)"); + OPENVINO_THROW("Either all or none of Tensor descriptors should be stored in rt_info (set)"); value[out.get_index()] = desc; } } @@ -129,7 +129,7 @@ TensorDescriptorPtr get_tensor_descriptor_ptr(const Output& out) } const auto& td_vector = it->second.as().m_value; if (td_vector.size() != node->get_output_size()) - throw ngraph_error("Either all or none of Tensor descriptors should be stored in rt_info (get)"); + OPENVINO_THROW("Either all or none of Tensor descriptors should be stored in rt_info (get)"); return td_vector[out.get_index()]; } } // namespace snippets diff --git a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/fuse_load_store_and_convert.cpp b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/fuse_load_store_and_convert.cpp index 5b7b61ad7089a8..066d3758e74f22 100644 --- a/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/fuse_load_store_and_convert.cpp +++ b/src/plugins/intel_cpu/src/transformations/snippets/x64/pass/lowered/fuse_load_store_and_convert.cpp @@ -42,7 +42,7 @@ bool ov::intel_cpu::pass::FuseLoadStoreConvert::fuse_load_convert(ngraph::snippe convert_truncation->get_destination_type(), load->get_count(), load->get_offset()); } else { - throw ov::Exception("Type of Convert op is undefined. Supports only fusing Load and ConvertTruncation or ConvertSaturation ops"); + OPENVINO_THROW("Type of Convert op is undefined. Supports only fusing Load and ConvertTruncation or ConvertSaturation ops"); } const auto in_td = std::vector{ load_expr->get_inputs().front() }; @@ -84,7 +84,7 @@ bool ov::intel_cpu::pass::FuseLoadStoreConvert::fuse_store_convert(ngraph::snipp convert_truncation->get_destination_type(), store->get_count(), store->get_offset()); } else { - throw ov::Exception("Type of Convert op is undefined. Supports only fusing Store and ConvertTruncation or ConvertSaturation ops"); + OPENVINO_THROW("Type of Convert op is undefined. Supports only fusing Store and ConvertTruncation or ConvertSaturation ops"); } const auto in_td = std::vector{ input_td }; diff --git a/src/plugins/intel_cpu/thirdparty/onednn b/src/plugins/intel_cpu/thirdparty/onednn index 02857209960e9d..cd01f845f89844 160000 --- a/src/plugins/intel_cpu/thirdparty/onednn +++ b/src/plugins/intel_cpu/thirdparty/onednn @@ -1 +1 @@ -Subproject commit 02857209960e9d91c1b3df90ab4c7ac359bf0973 +Subproject commit cd01f845f89844184f2e45982a12b4e327e573d5 diff --git a/src/plugins/intel_gpu/thirdparty/onednn_gpu b/src/plugins/intel_gpu/thirdparty/onednn_gpu index b52e9cd54df5af..f27dedbfc093f5 160000 --- a/src/plugins/intel_gpu/thirdparty/onednn_gpu +++ b/src/plugins/intel_gpu/thirdparty/onednn_gpu @@ -1 +1 @@ -Subproject commit b52e9cd54df5af92d1d586d435cdd514dd7617fe +Subproject commit f27dedbfc093f51032a4580198bb80579440dc15