Skip to content

Commit

Permalink
WA for Softmax precision propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sidorova committed Mar 24, 2023
1 parent 9640b85 commit 881d657
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/common/snippets/src/pass/propagate_precision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ bool ngraph::snippets::pass::PropagatePrecision::run_on_model(const std::shared_
bool was_updated = true;
for (const auto& op : f->get_ordered_ops()) {
auto type_info = op->get_type_info();
OPENVINO_ASSERT(
target_machine->has(type_info),
"operation '" + std::string(type_info.version_id) + "::" + std::string(type_info.name) + "' was not found in target machine");
std::set<ov::element::TypeVector> supported_precisions;
// TODO: At the moment Softmax is decomposed on Linear IR level.
// When Softmax will be decomposed on NGraph level, remove it
if (type_info.is_castable(ov::op::v1::Softmax::get_type_info_static())) {
supported_precisions = {{ov::element::f32}};
} else {
OPENVINO_ASSERT(
target_machine->has(type_info),
"operation '" + std::string(type_info.version_id) + "::" + std::string(type_info.name) + "' was not found in target machine");

auto exec = target_machine->get_supported_precisions(type_info);
supported_precisions = exec(op);
}

auto exec = target_machine->get_supported_precisions(type_info);
const auto supported_precisions = exec(op);
if (supported_precisions.empty()) {
continue;
}
Expand Down

0 comments on commit 881d657

Please sign in to comment.