diff --git a/src/common/low_precision_transformations/src/pad.cpp b/src/common/low_precision_transformations/src/pad.cpp index f4f929dc30bdcf..c59949501fe58b 100644 --- a/src/common/low_precision_transformations/src/pad.cpp +++ b/src/common/low_precision_transformations/src/pad.cpp @@ -225,6 +225,10 @@ bool PadTransformation::canBeTransformed(const TransformationContext& context, s } } + if ((beginNonZeroIdx == -1) && (endNonZeroIdx == -1)) { + return true; + } + if ((beginNonZeroIdx != endNonZeroIdx) && (beginNonZeroIdx != -1) && (endNonZeroIdx != -1)) { return false; } diff --git a/src/common/snippets/src/lowered/pass/validate_unified_loops.cpp b/src/common/snippets/src/lowered/pass/validate_unified_loops.cpp index 7b733f1a99e737..5c811518c26301 100644 --- a/src/common/snippets/src/lowered/pass/validate_unified_loops.cpp +++ b/src/common/snippets/src/lowered/pass/validate_unified_loops.cpp @@ -53,11 +53,13 @@ bool ValidateUnifiedLoops::run(LinearIR& linear_ir) { // if the loop has different dimension indexes, it don't have to meet the split loop related requirements if (dim_idx == LoopInfo::UNDEFINED_DIM_IDX) continue; - if (std::find(dim_indexes.cbegin(), dim_indexes.cend(), dim_idx) != dim_indexes.cend()) { - OPENVINO_ASSERT(*dim_indexes.rbegin() == dim_idx, - "Incorrect Loop ID configuration: the Loops with splitted dimension should be successively nested"); - OPENVINO_ASSERT(loop_manager->get_loop_info(loop_ids[i - 1])->get_increment() == loop_manager->get_loop_info(id)->get_work_amount(), - "Incorrect Loop ID configuration: the Loops with splitted dimension should be successively nested"); + if (i > 0) { + if (std::find(dim_indexes.cbegin(), dim_indexes.cend(), dim_idx) != dim_indexes.cend()) { + OPENVINO_ASSERT(*dim_indexes.rbegin() == dim_idx, + "Incorrect Loop ID configuration: the Loops with splitted dimension should be successively nested"); + OPENVINO_ASSERT(loop_manager->get_loop_info(loop_ids[i - 1])->get_increment() == loop_manager->get_loop_info(id)->get_work_amount(), + "Incorrect Loop ID configuration: the Loops with splitted dimension should be successively nested"); + } } dim_indexes.push_back(dim_idx); } diff --git a/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp b/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp index 2e47110a5acd74..08954d4e125fc4 100644 --- a/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/fuse_rotary_positional_embeddings.cpp @@ -734,8 +734,15 @@ ov::pass::RoPEShareCosSin::RoPEShareCosSin() { if (!validator) { return false; } + auto it = pattern_map.find(const_inv_freq); + if (it == pattern_map.end()) { + return false; + } auto cur_inv_freq = std::dynamic_pointer_cast(it->second.get_node_shared_ptr()); + if (!cur_inv_freq) { + return false; + } // the first match is the one to be shared, collect all inputs // and constants into the state capture by lambda diff --git a/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp b/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp index 763f1e57cd1385..4637b43bd23729 100644 --- a/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/lstm_cell_fusion.cpp @@ -328,7 +328,7 @@ ov::pass::LSTMCellFusionWithJointWeights::LSTMCellFusionWithJointWeights() { std::string f_activation_name = ft->get_type_name(); - if (f_activation_name != it->get_type_name() || f_activation_name != ot->get_type_name()) + if (!it || f_activation_name != it->get_type_name() || !ot || f_activation_name != ot->get_type_name()) return false; f_activation_name[0] = std::tolower(f_activation_name[0]); diff --git a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp index fb2abe3f84e2b9..13da1c4d9082fc 100644 --- a/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/nop_elimination.cpp @@ -863,6 +863,9 @@ ov::pass::EliminateSlice::EliminateSlice() { ov::matcher_pass_callback matcher_pass_callback = [=](pattern::Matcher& m) { auto slice = std::dynamic_pointer_cast(m.get_match_root()); + if (!slice) { + return false; + } int64_t max_int = slice->input_value(2).get_element_type() == element::i32 ? std::numeric_limits::max() @@ -891,11 +894,10 @@ ov::pass::EliminateStridedSlice::EliminateStridedSlice() { auto pattern = pattern::wrap_type({input, begin_const, end_const, optional_stride_const}); ov::matcher_pass_callback matcher_pass_callback = [=](pattern::Matcher& m) { - auto node = m.get_match_root(); - if (node == nullptr) { + auto strided_slice_node = std::dynamic_pointer_cast(m.get_match_root()); + if (!strided_slice_node) { return false; } - auto strided_slice_node = std::dynamic_pointer_cast(node); // check that all values of the mask is equal 0 auto check_mask = [](const std::vector& mask_to_check) { auto it = std::find_if(mask_to_check.begin(), mask_to_check.end(), [](const int64_t& value) { @@ -913,7 +915,8 @@ ov::pass::EliminateStridedSlice::EliminateStridedSlice() { return false; } // check that that we will take all values - if (node->get_input_size() == 4 && !op::util::is_constant_and_all_values_equal_int(node->input_value(3), 1)) { + if (strided_slice_node->get_input_size() == 4 && + !op::util::is_constant_and_all_values_equal_int(strided_slice_node->input_value(3), 1)) { return false; }