[SUBGRAPHS DUMPER] Fix Application Crash for Subgraphs Dumper (#20698)

* [SUBGRAPHS DUMPER] Fix Application Crash for Subgraphs Dumper

* Update model.hpp
This commit is contained in:
Irina Efode 2023-10-26 17:03:03 +04:00 committed by GitHub
parent 3b9606f217
commit 7720135f58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -52,10 +52,13 @@ protected:
GraphCache(const std::string& device = "") {
ExtractorsManager::ExtractorsMap matchers = {
// temporary disabling according mem leaks in CI and not using swap mem
{ "fused_names", FusedNamesExtractor::Ptr(new FusedNamesExtractor(device)) },
{ "repeat_pattern", RepeatPatternExtractor::Ptr(new RepeatPatternExtractor) },
};
try {
matchers.insert({ "fused_names", FusedNamesExtractor::Ptr(new FusedNamesExtractor(device)) });
} catch(const std::exception& e) {
std::cout << "[ GRAPH CACHE ][ WARNING ] Fused names extractor is disabled according: " << e.what() << std::endl;
}
m_manager.set_extractors(matchers);
m_cache_subdir = "subgraph";
}

View File

@ -82,7 +82,7 @@ RepeatPatternExtractor::update_extractor_cache(
const std::map<std::string, InputInfo>& pattern_in_info) {
for (auto& extracted_pattern : extracted_patterns) {
auto& pattern_structure = extracted_pattern.front();
const auto& cached_pattern = std::get<0>(pattern_structure);
const auto cached_pattern = std::get<0>(pattern_structure);
if (model_comparator->match(pattern, cached_pattern)) {
try {
const auto& cached_in_info = std::get<2>(pattern_structure);
@ -99,17 +99,15 @@ void
RepeatPatternExtractor::update_extractor_cache(
std::list<std::vector<RepeatPatternExtractor::ExtractedRepeatPattern>>& extracted_patterns,
std::list<std::vector<RepeatPatternExtractor::ExtractedRepeatPattern>>& secondary_extracted_patterns) {
auto extern_it = secondary_extracted_patterns.begin();
while (!secondary_extracted_patterns.empty()) {
auto it = extern_it->rbegin();
auto extern_it = secondary_extracted_patterns.begin();
while (!extern_it->empty()) {
auto& pattern_structure = *it;
auto& pattern_structure = *(extern_it->rbegin());
const auto& pattern = std::get<0>(pattern_structure);
const auto& pattern_node_vector = std::get<1>(pattern_structure);
const auto& pattern_in_info = std::get<2>(pattern_structure);
update_extractor_cache(extracted_patterns, pattern, pattern_node_vector, pattern_in_info);
extern_it->pop_back();
it = extern_it->rbegin();
}
secondary_extracted_patterns.pop_front();
}