Skip to content

Commit

Permalink
Add cpu_reset for stream executor at CompiledModel destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
MirceaDan99 committed Feb 21, 2025
1 parent 587360c commit 19114dc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/plugins/intel_npu/src/plugin/src/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ CompiledModel::CompiledModel(const std::shared_ptr<const ov::Model>& model,

CompiledModel::~CompiledModel() {
_logger.debug("~CompiledModel()");
std::dynamic_pointer_cast<ov::threading::IStreamsExecutor>(get_task_executor())->cpu_reset();
}

std::shared_ptr<ov::IAsyncInferRequest> CompiledModel::create_infer_request() const {
Expand Down Expand Up @@ -128,11 +129,11 @@ void CompiledModel::configure_stream_executors() {
task_executor = ov::threading::executor_manager()->get_executor("NPU");
} else if (get_property(ov::hint::enable_cpu_pinning.name()).as<bool>()) {
auto executor_config = ov::threading::IStreamsExecutor::Config{
"Intel NPU plugin executor",
get_plugin()->get_property(ov::num_streams.name(), {}).as<ov::streams::Num>(),
1,
ov::hint::SchedulingCoreType::PCORE_ONLY,
true};
/* name = */ "Intel NPU plugin executor",
/* streams = */ get_plugin()->get_property(ov::num_streams.name(), {}).as<ov::streams::Num>(),
/* threads_per_stream = */ 1,
/* thread_preferred_core_type = */ ov::hint::SchedulingCoreType::PCORE_ONLY,
/* cpu_reservation = */ true};
task_executor = std::make_shared<ov::threading::CPUStreamsExecutor>(executor_config);
} else {
task_executor = std::make_shared<ov::threading::CPUStreamsExecutor>(
Expand Down

0 comments on commit 19114dc

Please sign in to comment.