Skip to content

Commit

Permalink
fix vuild
Browse files Browse the repository at this point in the history
  • Loading branch information
iefode committed Sep 25, 2023
1 parent aefde07 commit b39d82c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ using namespace ov::tools::subgraph_dumper;

void FusedNamesExtractor::set_target_device(const std::string& _device) {
auto available_devices = core->get_available_devices();
if (std::find(available_devices.begin(), available_devices.end(), _device) ==
available_devices.end()) {
if (_device.empty()) {
device = available_devices.front();
std::cout << "[ WARNING ][ GRAPH CACHE ] " << device <<
" will be used for `fused_names` extractor" << std::endl;
return;
} else if (std::find(available_devices.begin(),
available_devices.end(),
_device) == available_devices.end()) {
std::string message = "Incorrect device ";
message += _device;
message += " to enable `fused_names` extractor! Available devices: ";
message += ov::test::utils::vec2str(available_devices);
throw std::runtime_error(message);
}
device = _device;
std::cout << "[ INFO ][ GRAPH CASE ] " << device << " is using for `fused_names` extractor" << std::endl;
std::cout << "[ INFO ][ GRAPH CACHE ] " << device << " is using for `fused_names` extractor" << std::endl;
}

std::unordered_set<std::string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,19 @@ ExtractorsManager::extract(const std::shared_ptr<ov::Model> &model,
auto delta = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
std::cout << "[ INFO ][ EXTRACTOR DURATION ][ ORIGINAL MODEL ] " << it.first << " " << delta << "ms" << std::endl;

if (!is_dynamic_model(model)) {
// extract patterns from models after `constant_folding` pass
ov::pass::Manager manager;
manager.register_pass<ov::pass::ConstantFolding>();
manager.run_passes(model);
extracted_patterns = it.second->extract(model, is_extract_body, is_copy_constants);
result.insert(result.end(), extracted_patterns.begin(), extracted_patterns.end());
// todo: enable it after validation
// if (!is_dynamic_model(model)) {
// // extract patterns from models after `constant_folding` pass
// ov::pass::Manager manager;
// manager.register_pass<ov::pass::ConstantFolding>();
// manager.run_passes(model);
// extracted_patterns = it.second->extract(model, is_extract_body, is_copy_constants);
// result.insert(result.end(), extracted_patterns.begin(), extracted_patterns.end());

end = std::chrono::high_resolution_clock::now();
delta = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
std::cout << "[ INFO ][ EXTRACTOR DURATION ][ CONSTANT FOLDING ] " << it.first << " " << delta << "ms" << std::endl;
}
// end = std::chrono::high_resolution_clock::now();
// delta = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
// std::cout << "[ INFO ][ EXTRACTOR DURATION ][ CONSTANT FOLDING ] " << it.first << " " << delta << "ms" << std::endl;
// }
}
return result;
}

0 comments on commit b39d82c

Please sign in to comment.