Skip to content

Commit

Permalink
[NPUW] Fix bank weak_ptr (openvinotoolkit#27486)
Browse files Browse the repository at this point in the history
After `CompiledModel` object is deleted, `shared_ptr<Bank>` is reset -
thus expiring `weak_ptr` in bank manager class. If we try to create a
`CompiledModel` object again with the same bank name - it was trying to
utilize already empty bank ptr. This PR fixes such case
  • Loading branch information
smirnov-alexey authored Nov 9, 2024
1 parent fdf29e1 commit db64e5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/intel_npu/src/plugin/npuw/weights_bank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ std::shared_ptr<Bank> BankManager::getBank(const std::string& bank_name,
std::lock_guard<std::mutex> guard(m_mutex);

auto iter = m_bank_map.find(bank_name);
if (iter == m_bank_map.end()) {
if (iter == m_bank_map.end() || iter->second.expired()) {
auto bank = std::make_shared<Bank>(core, alloc_device);
m_bank_map[bank_name] = bank;
return bank;
Expand Down

0 comments on commit db64e5c

Please sign in to comment.