Skip to content

Commit

Permalink
[CPU]fix rope mark up to skip shapeof (openvinotoolkit#27462)
Browse files Browse the repository at this point in the history
### Details:
 - *Stop markup at ShapeOf*
- *The ShapeOf in the subgraph of Rope's 2nd/3rd input should not be
marked*
- *The parent of ShapeOf may change when IR changes so skip it to avoid
unknown precision problem*

### Tickets:
 - *CVS-155898*
  • Loading branch information
zhangYiIntel authored Nov 14, 2024
1 parent 453ee57 commit a661f0d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<ov::op::v0::Constant>(node) || ov::is_type<ov::op::v0::Parameter>(node);
return ov::is_type<ov::op::v0::Constant>(node) || ov::is_type<ov::op::v0::Parameter>(node) ||
ov::is_type<ov::op::util::ShapeOfBase>(node);
};
if (!visited.count(cos_input_node)) {
ov::op::util::visit_path(cos_input_node, visited, visit_func, skip_node_predicate);
Expand Down

0 comments on commit a661f0d

Please sign in to comment.