OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[NPU] Remove ENABLE_CPU_PINNING from NPU properties (#39680)
Bogdan Pereanu45e8e42e2376
diff --git a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rstindex 34d659fb688..5ad007adf31 100644--- a/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst+++ b/docs/articles_en/openvino-workflow/running-inference/inference-devices-and-modes/npu-device.rst@@ -130,7 +130,6 @@ The NPU device is currently supported by AUTO inference modesov::device::idov::log::level- ov::hint::enable_cpu_pinningov::hint::inference_precisionov::hint::model_priorityov::hint::num_requestsdiff --git a/src/plugins/intel_npu/README.md b/src/plugins/intel_npu/README.mdindex d3139848391..6da9c3e5270 100644--- a/src/plugins/intel_npu/README.md+++ b/src/plugins/intel_npu/README.md@@ -215,7 +215,6 @@ The following properties are supported (may differ based on current system confi| `ov::hint::performance_mode`/</br>`PERFORMANCE_HINT` | RW | Sets the performance profile used to determine default values of Tiles/DMAs/NIREQs.</br>Default values for each profile are documented below. | `THROUGHPUT`/</br>`LATENCY`/</br>`UNDEFINED` | `UNDEFINED` || `ov::hint::num_requests`/</br>`PERFORMANCE_HINT_NUM_REQUESTS` | RW | Sets the number of outstanding inference requests. | `[0-]` | `1` || `ov::hint::model_priority`/</br>`MODEL_PRIORITY` | RW | Assigns a priority for the model execution. | `LOW`/</br>`MEDIUM`/</br>`HIGH` | `MEDIUM` |-| `ov::hint::enable_cpu_pinning`/</br>`ENABLE_CPU_PINNING` | RW | This property is deprecated and has no effect on the NPU Plugin. It will be removed in the OpenVINO 2027.0 release. | `YES`/ `NO` /</br>`NO`| `ov::log::level`/</br>`LOG_LEVEL` | RW | Sets the log level for NPU Plugin. An environment variable is also made available to expose logs from early initialization phase: OV_NPU_LOG_LEVEL. | `LOG_NONE`/</br>`LOG_ERROR`/</br>`LOG_WARNING`/</br>`LOG_INFO`/</br>`LOG_DEBUG`/</br>`LOG_TRACE` | `LOG_NONE` || `ov::cache_dir`/</br>`CACHE_DIR` | RW | Folder path to be used by the OpenVINO cache. | Any string pointing towards a valid directory path | empty || `ov::cache_encryption_callbacks`/</br>`CACHE_ENCRYPTION_CALLBACKS` | WO | Encryption/Decryption functions called when exporting or reading the blob. | ov::EncryptionCallbacks structures populated with any function respecting signature `std::string(const std::string&)` for both encryption and decryption callbacks | ov::EncryptionCallbacks{nullptr, nullptr} |diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hppindex c5a5a1e4617..6eeb04242d9 100644--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp@@ -432,29 +432,6 @@ struct NUM_STREAMS final : OptionBase<NUM_STREAMS, ov::streams::Num> {}};-OPENVINO_SUPPRESS_DEPRECATED_START-struct OPENVINO_DEPRECATED("This property is deprecated and has no effect on the NPU Plugin. It will be removed in "- "the OpenVINO 2027.0 release.") ENABLE_CPU_PINNING final- : OptionBase<ENABLE_CPU_PINNING, bool> {- static std::string_view key() {- return ov::hint::enable_cpu_pinning.name();- }-- static bool defaultValue() {- return false;- }-- static constexpr const char* deprecationMessage() {- return "The \"ENABLE_CPU_PINNING\" property is deprecated and has no effect on the NPU Plugin. It will "- "be removed in the OpenVINO 2027.0 release.";- }-- static OptionMode mode() {- return OptionMode::RunTime;- }-};-OPENVINO_SUPPRESS_DEPRECATED_END-struct WORKLOAD_TYPE final : OptionBase<WORKLOAD_TYPE, ov::WorkloadType> {static std::string_view key() {return ov::workload_type.name();diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cppindex effe480848f..f03d7a72207 100644--- a/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp+++ b/src/plugins/intel_npu/src/compiler_adapter/src/model_serializer.cpp@@ -766,8 +766,7 @@ std::string serializeConfig(const Config& originalConfig,}// As a consequence of complying to the conventions established in the 2.0 OV API, the set of values- // corresponding to the "model priority" key has been modified cpu_pinning property is not supported in- // compilers < v5.2 - need to remove it+ // corresponding to the "model priority" key has been modifiedif ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 2)) {const auto& getTargetRegex = [](const ov::hint::Priority& priorityValue) -> std::regex {std::ostringstream result;diff --git a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cppindex 57909a36b07..12a8ef01a39 100644--- a/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp@@ -3101,10 +3101,20 @@ void ov::npuw::CompiledModel::implement_properties() {[&](const ::intel_npu::Config&) {GET_PLUGIN_PROP(ov::hint::inference_precision);}}},+ // The NPU plugin no longer exposes enable_cpu_pinning, so it cannot be queried from there. NPUW still accepts+ // it (it is forwarded to the submodels on devices which support it, e.g. CPU), so report the value given by+ // the user and fall back to the property default otherwise.{ov::hint::enable_cpu_pinning.name(),{ov::PropertyMutability::RO,- [&](const ::intel_npu::Config&) {- GET_PLUGIN_PROP(ov::hint::enable_cpu_pinning);+ [&](const ::intel_npu::Config&) -> ov::Any {+ {+ std::lock_guard<std::mutex> lock(m_props_mutex);+ if (auto it = m_non_npuw_props.find(ov::hint::enable_cpu_pinning.name());+ it != m_non_npuw_props.end()) {+ return it->second.as<bool>();+ }+ }+ return false;}}},// clang-format off{ov::hint::model_priority.name(),diff --git a/src/plugins/intel_npu/src/plugin/src/compiled_model_property_manager.cpp b/src/plugins/intel_npu/src/plugin/src/compiled_model_property_manager.cppindex 027bfb36d31..c48e606f279 100644--- a/src/plugins/intel_npu/src/plugin/src/compiled_model_property_manager.cpp+++ b/src/plugins/intel_npu/src/plugin/src/compiled_model_property_manager.cpp@@ -12,12 +12,6 @@namespace {-inline void logCpuPinningDeprecationWarning(intel_npu::Logger& logger) {- OPENVINO_SUPPRESS_DEPRECATED_START- logger.warning(intel_npu::ENABLE_CPU_PINNING::deprecationMessage());- OPENVINO_SUPPRESS_DEPRECATED_END-}-std::string buildRuntimeRequirements(const std::shared_ptr<intel_npu::IGraph>& graph,const std::optional<int64_t>& batchSize,intel_npu::Logger& logger) {@@ -102,10 +96,6 @@ void CompiledModelPropertyManager::setProperty(const ov::AnyMap& properties) {ov::Any CompiledModelPropertyManager::getProperty(const std::string& name) const {std::lock_guard<std::mutex> lock(_mutex);- if (name == ov::hint::enable_cpu_pinning.name()) {- logCpuPinningDeprecationWarning(_logger);- }-const auto propertyIt = _properties.find(name);if (propertyIt != _properties.end()) {OPENVINO_ASSERT(propertyIt->second.isSupported(ov::AnyMap{}), "Unsupported configuration key: ", name);@@ -198,10 +188,6 @@ void CompiledModelPropertyManager::registerProperties() {registerConfigProperty(BATCH_MODE{}, false, false);- OPENVINO_SUPPRESS_DEPRECATED_START- registerConfigProperty(ENABLE_CPU_PINNING{}, false, false);- OPENVINO_SUPPRESS_DEPRECATED_END-// clang-format off// INFERENCE_PRECISION_HINT and EXECUTION_MODE_HINT are used by the compiler, but their values aren't guaranteed to// be correct if the user doesn't set it explicitly when compiling a model. Even if it is set when compiling adiff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cppindex 1e560d84c95..f725ca929da 100644--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp@@ -150,10 +150,6 @@ void register_options(const ov::SoPtr<intel_npu::IEngineBackend>& backend, intel}}- OPENVINO_SUPPRESS_DEPRECATED_START- REGISTER_OPTION(ENABLE_CPU_PINNING);- OPENVINO_SUPPRESS_DEPRECATED_END-// NPUW properties are requested by OV Core during caching and// have no effect on the NPU plugin. But we still need to enable// those for OV Core to query. Note: do this last to not filter@@ -310,9 +306,9 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<// Read the default or explicit compilation mode so automatic and user-selected HostCompile take the same path.// HostCompile dynamic models retain their dynamic dimensions for the VM runtime instead of plugin debatching.- const bool useDynamicGraphForDynamicModel = model->is_dynamic() &&- compilerType == ov::intel_npu::CompilerType::PLUGIN &&- localConfig.get<COMPILATION_MODE>().find("HostCompile_Interpreter") == 0;+ const bool useDynamicGraphForDynamicModel =+ model->is_dynamic() && compilerType == ov::intel_npu::CompilerType::PLUGIN &&+ localConfig.get<COMPILATION_MODE>().find("HostCompile_Interpreter") == 0;// Handle batch mode configurationstd::optional<ov::Dimension> originalBatch = std::nullopt;@@ -419,7 +415,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<adapterDesc.bypassCache = !localConfig.get<CACHE_DIR>().empty() || localConfig.get<BYPASS_UMD_CACHING>();// Request secure compilation if blob encryption is requestedadapterDesc.secureCompile = localConfig.has(ov::cache_encryption_callbacks.name()) &&- localConfig.get<CACHE_ENCRYPTION_CALLBACKS>().encrypt != nullptr;+ localConfig.get<CACHE_ENCRYPTION_CALLBACKS>().encrypt != nullptr;auto compileWithConfig = [&](auto&& modelToCompile, const auto& config) {if (!localConfig.get<ENABLE_WEIGHTLESS>()) {diff --git a/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp b/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cppindex 28a07c0e82b..4e8e5f6249f 100644--- a/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp+++ b/src/plugins/intel_npu/src/plugin/src/plugin_property_manager.cpp@@ -19,12 +19,6 @@namespace {-void logCpuPinningDeprecationWarning(intel_npu::Logger& logger) {- OPENVINO_SUPPRESS_DEPRECATED_START- logger.warning(intel_npu::ENABLE_CPU_PINNING::deprecationMessage());- OPENVINO_SUPPRESS_DEPRECATED_END-}-bool isCompatibilityCheckSupported(const ov::SoPtr<intel_npu::IEngineBackend>& backend,intel_npu::CompilerOptionSupportHelper& optionSupportHelper) {using namespace intel_npu;@@ -121,10 +115,6 @@ PluginPropertyManager::PluginPropertyManager(const std::shared_ptr<OptionsDesc>&void PluginPropertyManager::setProperty(const ov::AnyMap& properties) {std::lock_guard<std::mutex> lock(_mutex);- if (properties.find(ov::hint::enable_cpu_pinning.name()) != properties.end()) {- logCpuPinningDeprecationWarning(_logger);- }-for (auto&& value : properties) {const auto propertyDescriptorIt = _properties.find(value.first);if (propertyDescriptorIt == _properties.end()) {@@ -163,10 +153,6 @@ void PluginPropertyManager::setProperty(const ov::AnyMap& properties) {ov::Any PluginPropertyManager::getProperty(const std::string& name, const ov::AnyMap& arguments) const {std::lock_guard<std::mutex> lock(_mutex);- if (name == ov::hint::enable_cpu_pinning.name()) {- logCpuPinningDeprecationWarning(_logger);- }-const auto propertyDescriptorIt = _properties.find(name);if (propertyDescriptorIt != _properties.cend()) {OPENVINO_ASSERT(propertyDescriptorIt->second.isSupported(arguments), "Unsupported configuration key: ", name);@@ -192,10 +178,6 @@ ov::Any PluginPropertyManager::getProperty(const std::string& name, const ov::Anbool PluginPropertyManager::isPropertySupported(const std::string& name, const ov::AnyMap& arguments) const {std::lock_guard<std::mutex> lock(_mutex);- if (name == ov::hint::enable_cpu_pinning.name()) {- logCpuPinningDeprecationWarning(_logger);- }-const auto propertyDescriptorIt = _properties.find(name);if (propertyDescriptorIt == _properties.end()) {// Property not found in the known properties list.@@ -218,10 +200,6 @@ std::pair<Config, ov::AnyMap> PluginPropertyManager::getMergedConfigAndUnknownPrstd::lock_guard<std::mutex> lock(_mutex);- if (properties.find(ov::hint::enable_cpu_pinning.name()) != properties.end()) {- logCpuPinningDeprecationWarning(_logger);- }-ov::AnyMap propertyArguments = properties;if (mergeMode == ConfigMergeMode::Import) {// Mark the compiler type as unavailable in the property arguments when importing a model with both@@ -496,10 +474,6 @@ void PluginPropertyManager::registerProperties() {registerConfigProperty(ALLOW_BYTECODE{}, false);registerConfigProperty(PROFILING_TYPE{}, false);- OPENVINO_SUPPRESS_DEPRECATED_START- registerConfigProperty(ENABLE_CPU_PINNING{}, false);- OPENVINO_SUPPRESS_DEPRECATED_END-const auto registerCompilerProperty = [this, isCompilerOptionSupported](const auto optionTag, bool isPublic) {using OptionType = std::decay_t<decltype(optionTag)>;const auto propertyName = std::string(OptionType::key());diff --git a/src/plugins/intel_npu/tests/functional/behavior/compiled_model/property.cpp b/src/plugins/intel_npu/tests/functional/behavior/compiled_model/property.cppindex ab8de686b0c..abc79c5df1a 100644--- a/src/plugins/intel_npu/tests/functional/behavior/compiled_model/property.cpp+++ b/src/plugins/intel_npu/tests/functional/behavior/compiled_model/property.cpp@@ -867,97 +867,6 @@ TEST_P(CheckCompilerPropertyWhenImporting, CheckImportWithCompilerPropertyAfterCov::Exception); // Expect to throw due to unsupported property}-using CheckCpuPinning = ClassExecutableNetworkGetPropertiesTestNPU;--TEST_P(CheckCpuPinning, CheckCompileModelWithCpuPinningFromSetProperty) {- std::string logs;- std::mutex logs_mutex;- ov::Core core;- ov::CompiledModel compiled_model;-- ov::test::utils::LoggerLevelGuard logGuard(ov::log::Level::WARNING);- core.set_property(deviceName, ov::log::level(ov::log::Level::WARNING));-- // Keep this std::function alive while logging is active.- std::function<void(std::string_view)> log_cb = [&](std::string_view msg) {- std::lock_guard<std::mutex> lock(logs_mutex);- logs.append(msg);- logs.push_back('\n');- };-- {- ov::test::utils::LogCallbackGuard log_callback_guard(log_cb);- OV_ASSERT_NO_THROW(core.set_property(deviceName, ov::hint::enable_cpu_pinning(true)));- OV_ASSERT_NO_THROW(compiled_model = core.compile_model(model, deviceName));- }-- bool enable_cpu_pinning = false;- OV_ASSERT_NO_THROW(enable_cpu_pinning = compiled_model.get_property(ov::hint::enable_cpu_pinning));- ASSERT_TRUE(enable_cpu_pinning);-- std::vector<ov::PropertyName> core_supported_properties;- OV_ASSERT_NO_THROW(core_supported_properties = core.get_property(deviceName, ov::supported_properties));- ASSERT_EQ(std::find(core_supported_properties.cbegin(),- core_supported_properties.cend(),- ov::hint::enable_cpu_pinning.name()),- core_supported_properties.cend());-- std::vector<ov::PropertyName> compiled_supported_properties;- OV_ASSERT_NO_THROW(compiled_supported_properties = compiled_model.get_property(ov::supported_properties));- ASSERT_EQ(std::find(compiled_supported_properties.cbegin(),- compiled_supported_properties.cend(),- ov::hint::enable_cpu_pinning.name()),- compiled_supported_properties.cend());-- ASSERT_NE(logs.find("The \"ENABLE_CPU_PINNING\" property is deprecated and has no effect on the NPU Plugin."),- std::string::npos);-}--TEST_P(CheckCpuPinning, CheckCompileModelWithCpuPinningFromCompileProperty) {- std::string logs;- std::mutex logs_mutex;- ov::Core core;- ov::CompiledModel compiled_model;-- ov::test::utils::LoggerLevelGuard logGuard(ov::log::Level::WARNING);-- // Keep this std::function alive while logging is active.- std::function<void(std::string_view)> log_cb = [&](std::string_view msg) {- std::lock_guard<std::mutex> lock(logs_mutex);- logs.append(msg);- logs.push_back('\n');- };-- {- ov::test::utils::LogCallbackGuard log_callback_guard(log_cb);- OV_ASSERT_NO_THROW(compiled_model = core.compile_model(- model,- deviceName,- {ov::hint::enable_cpu_pinning(true), ov::log::level(ov::log::Level::WARNING)}));- }-- bool enable_cpu_pinning = false;- OV_ASSERT_NO_THROW(enable_cpu_pinning = compiled_model.get_property(ov::hint::enable_cpu_pinning));- ASSERT_TRUE(enable_cpu_pinning);-- std::vector<ov::PropertyName> core_supported_properties;- OV_ASSERT_NO_THROW(core_supported_properties = core.get_property(deviceName, ov::supported_properties));- ASSERT_EQ(std::find(core_supported_properties.cbegin(),- core_supported_properties.cend(),- ov::hint::enable_cpu_pinning.name()),- core_supported_properties.cend());-- std::vector<ov::PropertyName> compiled_supported_properties;- OV_ASSERT_NO_THROW(compiled_supported_properties = compiled_model.get_property(ov::supported_properties));- ASSERT_EQ(std::find(compiled_supported_properties.cbegin(),- compiled_supported_properties.cend(),- ov::hint::enable_cpu_pinning.name()),- compiled_supported_properties.cend());-- ASSERT_NE(logs.find("The \"ENABLE_CPU_PINNING\" property is deprecated and has no effect on the NPU Plugin."),- std::string::npos);-}-using CheckSecureCompilationFlag = ClassExecutableNetworkGetPropertiesTestNPU;TEST_P(CheckSecureCompilationFlag, EncryptionCallbacksForOlderDriverThrows) {@@ -1167,12 +1076,6 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CheckCompilerType,::testing::ValuesIn(valid_device_ids)),CheckCompilerPropertyWhenImporting::getTestCaseName);-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CheckCompilerType,- CheckCpuPinning,- ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),- ::testing::ValuesIn(valid_device_ids)),- CheckCpuPinning::getTestCaseName);-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_CheckCompilerVersion,CheckCompilerVersionProperty,::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),diff --git a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cppindex dc897d1cd9c..9b2aade66e5 100644--- a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp+++ b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.cpp@@ -143,10 +143,6 @@ public:}}- OPENVINO_SUPPRESS_DEPRECATED_START- REGISTER_OPTION(ENABLE_CPU_PINNING);- OPENVINO_SUPPRESS_DEPRECATED_END-// NPUW properties are requested by OV Core during caching and// have no effect on the NPU plugin. But we still need to enable// those for OV Core to query. Note: do this last to not filterdiff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cppindex 8b461a9f21d..6d94b18e8a2 100644--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/properties.cpp@@ -45,7 +45,6 @@ const std::vector<std::pair<std::string, ov::Any>> compiledModelProperties = {{ov::hint::performance_mode.name(), ov::Any(ov::hint::PerformanceMode::THROUGHPUT)},{ov::hint::num_requests.name(), ov::Any(4u)},{ov::hint::inference_precision.name(), ov::Any(ov::element::i8)},- {ov::hint::enable_cpu_pinning.name(), ov::Any(true)},{ov::hint::model.name(), ov::Any(std::shared_ptr<const ov::Model>(nullptr))},{ov::hint::model.name(),ov::Any(std::shared_ptr<ov::Model>(nullptr))}, // intentionally copied above to test constnessdiff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cppindex 0526ca8aa5b..1ee397ce45c 100644--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/properties_tests.cpp@@ -110,7 +110,6 @@ const std::vector<ov::AnyMap> CorrectCompiledModelProperties = {{{ov::hint::performance_mode.name(), ov::hint::PerformanceMode::LATENCY}},{{ov::hint::execution_mode.name(), ov::hint::ExecutionMode::PERFORMANCE}},{{ov::hint::num_requests.name(), 4u}},- {{ov::hint::enable_cpu_pinning.name(), true}},{{ov::hint::model.name(), std::shared_ptr<const ov::Model>(nullptr)}},{{ov::hint::model.name(), std::shared_ptr<ov::Model>(nullptr)}} // intentionally copied above to test constness};