diff --git a/src/common/transformations/src/transformations/common_optimizations/mark_rope_input_to_keep_in_mixed_precision.cpp b/src/common/transformations/src/transformations/common_optimizations/mark_rope_input_to_keep_in_mixed_precision.cpp index 63c7495b28112b..e40aeaa67421a8 100644 --- a/src/common/transformations/src/transformations/common_optimizations/mark_rope_input_to_keep_in_mixed_precision.cpp +++ b/src/common/transformations/src/transformations/common_optimizations/mark_rope_input_to_keep_in_mixed_precision.cpp @@ -31,9 +31,12 @@ ov::pass::MarkRopeInputsToKeepInMixedPrecision::MarkRopeInputsToKeepInMixedPreci auto visit_func = [](ov::Node* node) { ov::disable_fp16_compression(node->shared_from_this()); }; - // skip constant and parameter node + // skip constant, parameter and shapeof + // The inputs of cos_sin table generation are position_ids and a ShapeOf [batch, input_length] + // The parent of ShapeOf may change when IR changes so skip it to avoid unknown precision problem auto skip_node_predicate = [](ov::Node* node) -> bool { - return ov::is_type(node) || ov::is_type(node); + return ov::is_type(node) || ov::is_type(node) || + ov::is_type(node); }; if (!visited.count(cos_input_node)) { ov::op::util::visit_path(cos_input_node, visited, visit_func, skip_node_predicate);