Skip to content

Commit

Permalink
NPUW Deref: clean-up before the NPU plugin changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmatveev committed Nov 27, 2024
1 parent ef5fde0 commit 970fb64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ void ov::npuw::CompiledModel::detach_memory() {
if (proto_comp_model_desc.device_it + 1 == m_dev_list.end()) {
LOG_INFO("No fallback expected - clear the OV model for Subgraph[" << idx << "]");
proto_comp_model_desc.model.reset();
// proto_comp_model_desc.compiled_model = {}; // Shouldn't be here, CPU only
}
}
LOG_INFO("Done");
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/intel_npu/src/plugin/npuw/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ Impl<M> _(std::shared_ptr<M> pM) {

} // namespace at

// Written here to be a drop-in replacement for ov::parallel_for for the debug purposes
template<typename F>
void non_parallel_for(std::size_t count, F &&f) {
for (std::size_t idx = 0u; idx < count; idx++) {
f(idx);
}
}

} // namespace util
} // namespace npuw
} // namespace ov
9 changes: 0 additions & 9 deletions src/plugins/intel_npu/src/plugin/npuw/weights_bank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "openvino/core/parallel.hpp"
#include "util.hpp"

#include <iostream>

using ov::npuw::weights::Bank;
using ov::npuw::weights::LazyTensor;

Expand Down Expand Up @@ -68,13 +66,6 @@ void Bank::registerLT(const LazyTensor& tensor, const std::string& device) {
}
}

template<typename F>
void non_parallel_for(std::size_t count, F &&f) {
for (std::size_t idx = 0u; idx < count; idx++) {
f(idx);
}
}

void Bank::evaluate_and_allocate() {
std::lock_guard<std::mutex> guard(m_mutex);

Expand Down

0 comments on commit 970fb64

Please sign in to comment.