Skip to content

Commit

Permalink
[Snippets] Rebased on the latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Apr 20, 2023
1 parent 28ea6a9 commit 20f85d9
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class SerializationNode : public ngraph::op::Op {
SerializationNode(const Output<Node> &arg, const std::shared_ptr<lowered::Expression>& 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();
Expand Down
4 changes: 2 additions & 2 deletions src/common/snippets/include/snippets/target_machine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TargetMachine {
std::function<std::shared_ptr<Emitter>(const std::shared_ptr<Node>)> 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;
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/snippets/src/lowered/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Expression::Expression(const std::shared_ptr<Node>& n, std::vector<TensorDescrip

std::shared_ptr<Node> 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;
}

Expand Down
16 changes: 8 additions & 8 deletions src/common/snippets/src/lowered/linear_ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ LinearIR::LinearIR(const std::shared_ptr<ov::Model>& model, Config config)

ov::NodeVector LinearIR::get_ordered_ops(const std::shared_ptr<ov::Model>& 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()
Expand Down Expand Up @@ -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 => ";
Expand Down Expand Up @@ -174,14 +174,14 @@ ExpressionPtr LinearIR::get_expr_by_node(const std::shared_ptr<Node>& 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<ExpressionPort>& 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;
}

Expand All @@ -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<ExpressionPort>{expr_port}});
Expand All @@ -221,15 +221,15 @@ 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);
}

void LinearIR::register_regular_expression(const ExpressionPtr& expr) {
if (is_type<ov::op::v0::Result>(expr->get_node()) || is_type<ov::op::v0::Parameter>(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);
}

Expand All @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/common/snippets/src/lowered/pass/allocate_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
Expand All @@ -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");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/snippets/src/lowered/pass/assign_registers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::Buffer>(op)) {
const auto buffer_id = buffer->get_id();
// All buffers have one common data pointer
Expand Down
2 changes: 1 addition & 1 deletion src/common/snippets/src/lowered/pass/indentify_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ std::vector<bool> 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");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/snippets/src/lowered/pass/insert_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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!");
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/common/snippets/src/lowered/pass/propagate_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/snippets/src/tensor_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TensorDescriptor::TensorDescriptor(const Output<const ov::Node>& 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();
}
Expand All @@ -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");
}
}

Expand Down Expand Up @@ -113,7 +113,7 @@ void set_tensor_descriptor_ptr(const Output<ov::Node>& out, const TensorDescript
} else {
auto& value = found->second.as<TensorDescriptorPtrVectorAttribute>().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;
}
}
Expand All @@ -129,7 +129,7 @@ TensorDescriptorPtr get_tensor_descriptor_ptr(const Output<const ov::Node>& out)
}
const auto& td_vector = it->second.as<TensorDescriptorPtrVectorAttribute>().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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ngraph::snippets::TensorDescriptorPtr>{ load_expr->get_inputs().front() };
Expand Down Expand Up @@ -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<ngraph::snippets::TensorDescriptorPtr>{ input_td };
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/thirdparty/onednn_gpu
Submodule onednn_gpu updated 74 files
+34 −0 include/oneapi/dnnl/dnnl.hpp
+32 −0 include/oneapi/dnnl/dnnl_types.h
+32 −0 src/common/c_types_map.hpp
+32 −0 src/common/dnnl_debug_autogenerated.cpp
+17 −0 src/common/memory_desc_wrapper.cpp
+3 −1 src/common/memory_tracking.hpp
+22 −2 src/common/tag_traits.hpp
+5 −2 src/cpu/gemm_convolution.cpp
+23 −6 src/cpu/x64/jit_avx2_1x1_conv_kernel_f32.cpp
+3 −2 src/cpu/x64/jit_avx2_1x1_conv_kernel_f32.hpp
+9 −9 src/cpu/x64/jit_avx2_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_avx2_1x1_convolution.hpp
+34 −12 src/cpu/x64/jit_avx512_common_1x1_conv_kernel.cpp
+7 −5 src/cpu/x64/jit_avx512_common_1x1_conv_kernel.hpp
+6 −5 src/cpu/x64/jit_avx512_common_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_avx512_common_1x1_convolution.hpp
+31 −11 src/cpu/x64/jit_avx512_core_bf16_1x1_conv_kernel.cpp
+6 −3 src/cpu/x64/jit_avx512_core_bf16_1x1_conv_kernel.hpp
+8 −6 src/cpu/x64/jit_avx512_core_bf16_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_avx512_core_bf16_1x1_convolution.hpp
+3 −4 src/cpu/x64/jit_avx512_core_x8s8s32x_1x1_conv_kernel.cpp
+5 −3 src/cpu/x64/jit_avx512_core_x8s8s32x_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_avx512_core_x8s8s32x_1x1_convolution.hpp
+3 −3 src/cpu/x64/jit_brgemm_conv_utils.cpp
+14 −2 src/cpu/x64/jit_brgemm_inner_product_utils.cpp
+3 −5 src/cpu/x64/jit_gemm_x8s8s32x_convolution_utils.cpp
+32 −10 src/cpu/x64/jit_sse41_1x1_conv_kernel_f32.cpp
+5 −3 src/cpu/x64/jit_sse41_1x1_conv_kernel_f32.hpp
+9 −7 src/cpu/x64/jit_sse41_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_sse41_1x1_convolution.hpp
+7 −5 src/cpu/x64/jit_uni_1x1_conv_utils.hpp
+3 −4 src/cpu/x64/jit_uni_x8s8s32x_1x1_conv_kernel.cpp
+4 −3 src/cpu/x64/jit_uni_x8s8s32x_1x1_convolution.cpp
+6 −2 src/cpu/x64/jit_uni_x8s8s32x_1x1_convolution.hpp
+8 −4 src/gpu/compute/device_info.cpp
+2 −1 src/gpu/compute/device_info.hpp
+29 −73 src/gpu/jit/codegen/reorder.hpp
+7 −0 src/gpu/jit/conv/config.cpp
+2 −2 src/gpu/jit/conv/config.hpp
+3 −1 src/gpu/jit/conv/config_plan.cpp
+1 −0 src/gpu/jit/conv/config_plan.hpp
+10 −0 src/gpu/jit/gemm/gen_gemm_kernel.cpp
+1 −1 src/gpu/jit/gemm/kernel.db
+48 −45 src/gpu/jit/gemm/xe_hp_systolic_gemm.cpp
+30 −30 src/gpu/jit/gemm/xe_hp_systolic_gemm.hpp
+30 −13 src/gpu/ocl/gen9_batch_normalization.cpp
+3 −3 src/gpu/ocl/gen9_softmax.hpp
+9 −11 src/gpu/ocl/ocl_post_ops.h
+0 −1 src/gpu/ocl/ref_convolution.cpp
+1 −3 src/gpu/ocl/ref_eltwise.cl
+0 −2 src/gpu/ocl/ref_eltwise.cpp
+0 −7 src/gpu/ocl/ref_eltwise.hpp
+13 −73 src/gpu/ocl/ref_reduction.cl
+20 −35 src/gpu/ocl/ref_reduction.cpp
+2 −0 src/gpu/ocl/rnn/ref_rnn.cpp
+2 −2 src/graph/backend/dnnl/op_executable.hpp
+2 −7 src/sycl/sycl_engine.cpp
+2 −16 src/sycl/sycl_engine.hpp
+29 −9 src/sycl/sycl_utils.cpp
+19 −1 src/sycl/sycl_utils.hpp
+24 −6 tests/benchdnn/conv/conv_dw_fusion.cpp
+4 −1 tests/benchdnn/conv/conv_dw_fusion.hpp
+13 −7 tests/benchdnn/conv/ref_conv.cpp
+8 −1 tests/benchdnn/dnn_types.cpp
+1 −1 tests/benchdnn/dnn_types.hpp
+32 −0 tests/benchdnn/dnnl_debug_autogenerated.cpp
+5 −1 tests/benchdnn/inputs/bnorm/test_bnorm_gpu
+3 −3 tests/benchdnn/inputs/conv/harness_conv_fused_depthwise
+5 −0 tests/benchdnn/inputs/conv/harness_conv_regression_general
+5 −0 tests/benchdnn/inputs/softmax/test_softmax_gpu
+2 −2 tests/gtests/graph/api/CMakeLists.txt
+2 −2 tests/gtests/graph/unit/CMakeLists.txt
+4 −4 tests/gtests/graph/unit/backend/dnnl/test_softmax.cpp
+15 −3 tests/gtests/sycl/api/test_engine.cpp

0 comments on commit 20f85d9

Please sign in to comment.