Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[`intel_npu`] [`ov::hint::model`] [`MODEL_PTR`] Remove `MODEL_PTR` from internal `intel_npu` configs (#31135)

Mircea-Aurelian Danf5d71b2c905a
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.hpp
index 0e17eab3c58..68966c98ff5 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
@@ -1334,41 +1334,6 @@ struct BATCH_COMPILER_MODE_SETTINGS final : OptionBase<BATCH_COMPILER_MODE_SETTI
}
};
-struct MODEL_PTR final : OptionBase<MODEL_PTR, std::shared_ptr<const ov::Model>> {
- static std::string_view key() {
- return ov::hint::model.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "std::shared_ptr<const ov::Model>";
- }
-
- static std::shared_ptr<const ov::Model> defaultValue() {
- return nullptr;
- }
-
- static std::shared_ptr<const ov::Model> parse(std::string_view) {
- // Cannot/shouldn't parse this due to conversion and ownership reasons. The config option is added only to
- // comply with the OV API without inserting multiple workarounds.
- return defaultValue();
- }
- static std::string toString(const std::shared_ptr<const ov::Model>& /* unused m*/) {
- return "";
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-
- static bool isPublic() {
- return true;
- }
-
- static ov::PropertyMutability mutability() {
- return ov::PropertyMutability::RW;
- }
-};
-
struct WEIGHTLESS_BLOB final : OptionBase<WEIGHTLESS_BLOB, bool> {
static std::string_view key() {
return ov::intel_npu::weightless_blob.name();
diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
index 96fbe008f15..539168aad1e 100644
--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
@@ -186,6 +186,25 @@ std::shared_ptr<ov::ICompiledModel> import_model_npuw(std::istream& stream,
return nullptr;
}
+std::shared_ptr<const ov::Model> exclude_model_ptr_from_map(ov::AnyMap& properties) {
+ std::shared_ptr<const ov::Model> modelPtr = nullptr;
+ if (properties.count(ov::hint::model.name())) {
+ try {
+ modelPtr = properties.at(ov::hint::model.name()).as<std::shared_ptr<const ov::Model>>();
+ } catch (const ov::Exception&) {
+ try {
+ modelPtr = std::const_pointer_cast<const ov::Model>(
+ properties.at(ov::hint::model.name()).as<std::shared_ptr<ov::Model>>());
+ } catch (const ov::Exception&) {
+ OPENVINO_THROW("The value of the \"ov::hint::model\" configuration option (\"MODEL_PTR\") has the "
+ "wrong data type. Expected: std::shared_ptr<const ov::Model>.");
+ }
+ }
+ properties.erase(ov::hint::model.name());
+ }
+ return modelPtr;
+}
+
} // namespace
namespace intel_npu {
@@ -274,7 +293,6 @@ void Plugin::init_options() {
REGISTER_OPTION(STEPPING);
REGISTER_OPTION(MAX_TILES);
REGISTER_OPTION(DISABLE_VERSION_CHECK);
- REGISTER_OPTION(MODEL_PTR);
REGISTER_OPTION(BATCH_COMPILER_MODE_SETTINGS);
REGISTER_OPTION(TURBO);
REGISTER_OPTION(WEIGHTLESS_BLOB);
@@ -513,7 +531,9 @@ void Plugin::set_property(const ov::AnyMap& properties) {
}
ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& arguments) const {
- return _properties->get_property(name, arguments);
+ auto npu_plugin_properties = arguments;
+ exclude_model_ptr_from_map(npu_plugin_properties);
+ return _properties->get_property(name, npu_plugin_properties);
}
std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<const ov::Model>& model,
@@ -535,6 +555,12 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
}
}
+ // ov::hint::model has no corresponding "Config" implementation thus we need to remove it from the
+ // list of properties
+ if (exclude_model_ptr_from_map(localProperties)) {
+ _logger.warning("Model received in config will be ignored as it was already provided by parameter.");
+ }
+
const std::map<std::string, std::string> localPropertiesMap = any_copy(localProperties);
update_log_level(localPropertiesMap);
@@ -664,10 +690,14 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
}
ov::SoPtr<ov::IRemoteContext> Plugin::create_context(const ov::AnyMap& remoteProperties) const {
- return std::make_shared<RemoteContextImpl>(_backend, remoteProperties);
+ auto npu_plugin_properties = remoteProperties;
+ exclude_model_ptr_from_map(npu_plugin_properties);
+ return std::make_shared<RemoteContextImpl>(_backend, npu_plugin_properties);
}
-ov::SoPtr<ov::IRemoteContext> Plugin::get_default_context(const ov::AnyMap&) const {
+ov::SoPtr<ov::IRemoteContext> Plugin::get_default_context(const ov::AnyMap& remoteProperties) const {
+ auto npu_plugin_properties = remoteProperties;
+ exclude_model_ptr_from_map(npu_plugin_properties);
return std::make_shared<RemoteContextImpl>(_backend);
}
@@ -779,9 +809,12 @@ ov::SupportedOpsMap Plugin::query_model(const std::shared_ptr<const ov::Model>&
const ov::AnyMap& properties) const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::query_model");
CompilerAdapterFactory compilerAdapterFactory;
- const std::map<std::string, std::string> propertiesMap = any_copy(properties);
+ auto npu_plugin_properties = properties;
+ exclude_model_ptr_from_map(npu_plugin_properties);
+ const std::map<std::string, std::string> propertiesMap = any_copy(npu_plugin_properties);
update_log_level(propertiesMap);
- auto compiler = compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, properties));
+ auto compiler =
+ compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, npu_plugin_properties));
auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::CompileTime);
_logger.setLevel(localConfig.get<LOG_LEVEL>());
const auto platform =
@@ -806,10 +839,18 @@ std::shared_ptr<ov::ICompiledModel> Plugin::parse(const ov::Tensor& tensorBig,
std::unique_ptr<MetadataBase> metadata,
const ov::AnyMap& properties) const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::parse");
+
+ auto npu_plugin_properties = properties;
+
+ // ov::hint::model has no corresponding "Config" implementation thus we need to remove it from the
+ // list of properties
+ auto originalModel = exclude_model_ptr_from_map(npu_plugin_properties);
+
CompilerAdapterFactory compilerAdapterFactory;
- const auto propertiesMap = any_copy(properties);
+ const auto propertiesMap = any_copy(npu_plugin_properties);
update_log_level(propertiesMap);
- auto compiler = compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, properties));
+ auto compiler =
+ compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, npu_plugin_properties));
OV_ITT_TASK_CHAIN(PLUGIN_PARSE_MODEL, itt::domains::NPUPlugin, "Plugin::parse", "fork_local_config");
auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::RunTime);
@@ -844,7 +885,6 @@ std::shared_ptr<ov::ICompiledModel> Plugin::parse(const ov::Tensor& tensorBig,
ov::Coordinate{0},
ov::Coordinate{mainSize}); // ROI tensor to skip NPU plugin metadata
- std::shared_ptr<const ov::Model> originalModel;
std::vector<ov::Tensor> tensorsInits;
const bool weightsSeparationEnabled = initSizes.has_value();
@@ -858,42 +898,32 @@ std::shared_ptr<ov::ICompiledModel> Plugin::parse(const ov::Tensor& tensorBig,
}
// Retrieve the ov::Model used for compilation. This is required for extracting and matching the weights
- if (properties.count(ov::hint::model.name())) {
- try {
- originalModel = properties.at(ov::hint::model.name()).as<std::shared_ptr<const ov::Model>>();
- } catch (const ov::AssertFailure&) {
- try {
- originalModel = std::const_pointer_cast<const ov::Model>(
- properties.at(ov::hint::model.name()).as<std::shared_ptr<ov::Model>>());
- } catch (const ov::Exception&) {
- OPENVINO_THROW("The value of the \"ov::hint::model\" configuration option (\"MODEL_PTR\") has the "
- "wrong data type. Expected: std::shared_ptr<const ov::Model>.");
+ if (!originalModel) {
+ if (!localConfig.get<WEIGHTS_PATH>().empty()) {
+ const std::string weightsPath = localConfig.get<WEIGHTS_PATH>();
+ const size_t weightsPathLength = weightsPath.length();
+ std::string xmlPath = weightsPath;
+
+ if (weightsPathLength > WEIGHTS_EXTENSION.length() &&
+ weightsPath.compare(weightsPathLength - WEIGHTS_EXTENSION.length(),
+ WEIGHTS_EXTENSION.length(),
+ WEIGHTS_EXTENSION) == 0) {
+ xmlPath.replace(weightsPathLength - WEIGHTS_EXTENSION.length(),
+ WEIGHTS_EXTENSION.length(),
+ XML_EXTENSION);
+ } else if (weightsPathLength <= ONNX_EXTENSION.length() ||
+ weightsPath.compare(weightsPathLength - ONNX_EXTENSION.length(),
+ ONNX_EXTENSION.length(),
+ ONNX_EXTENSION)) {
+ OPENVINO_THROW("Invalid path to the weights: ",
+ weightsPath,
+ ". A \".bin\" or \".onnx\" extension was expected.");
}
- }
- } else if (!localConfig.get<WEIGHTS_PATH>().empty()) {
- const std::string weightsPath = localConfig.get<WEIGHTS_PATH>();
- const size_t weightsPathLength = weightsPath.length();
- std::string xmlPath = weightsPath;
- if (weightsPathLength > WEIGHTS_EXTENSION.length() &&
- weightsPath.compare(weightsPathLength - WEIGHTS_EXTENSION.length(),
- WEIGHTS_EXTENSION.length(),
- WEIGHTS_EXTENSION) == 0) {
- xmlPath.replace(weightsPathLength - WEIGHTS_EXTENSION.length(),
- WEIGHTS_EXTENSION.length(),
- XML_EXTENSION);
- } else if (weightsPathLength <= ONNX_EXTENSION.length() ||
- weightsPath.compare(weightsPathLength - ONNX_EXTENSION.length(),
- ONNX_EXTENSION.length(),
- ONNX_EXTENSION)) {
- OPENVINO_THROW("Invalid path to the weights: ",
- weightsPath,
- ". A \".bin\" or \".onnx\" extension was expected.");
+ originalModel = get_core()->read_model(xmlPath, weightsPath, properties);
+ } else {
+ OPENVINO_THROW("Attempted to load a weightless compiled model, but no weights have been provided");
}
-
- originalModel = get_core()->read_model(xmlPath, weightsPath, properties);
- } else {
- OPENVINO_THROW("Attempted to load a weightless compiled model, but no weights have been provided");
}
check_weightless_cache_attribute_occurrence(originalModel);
diff --git a/src/plugins/intel_npu/src/plugin/src/properties.cpp b/src/plugins/intel_npu/src/plugin/src/properties.cpp
index 1e44140dd7e..fc6861e29ff 100644
--- a/src/plugins/intel_npu/src/plugin/src/properties.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/properties.cpp
@@ -214,7 +214,7 @@ namespace intel_npu {
} while (0)
/**
- * @brief Macro for defining properties which have simmple single value returning metrics
+ * @brief Macro for defining properties which have simple single value returning metrics
*
* The key differentiator for Metrics (from configs) is that they don't have an entry in the config map, nor an
* OptionBase descriptor. Metrics are static, Read-Only properties returning fixed characteristics of the device, plugin
@@ -348,7 +348,6 @@ void Properties::registerPluginProperties() {
TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::performance_mode, PERFORMANCE_HINT);
TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::execution_mode, EXECUTION_MODE_HINT);
TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::num_requests, PERFORMANCE_HINT_NUM_REQUESTS);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::model, MODEL_PTR);
TRY_REGISTER_SIMPLE_PROPERTY(ov::compilation_num_threads, COMPILATION_NUM_THREADS);
TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::inference_precision, INFERENCE_PRECISION_HINT);
TRY_REGISTER_SIMPLE_PROPERTY(ov::log::level, LOG_LEVEL);
@@ -411,6 +410,14 @@ void Properties::registerPluginProperties() {
}());
TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::enable_cpu_pinning, ENABLE_CPU_PINNING);
+ FORCE_REGISTER_CUSTOM_PROPERTY(ov::hint::model,
+ MODEL_PTR,
+ true,
+ ov::PropertyMutability::RO,
+ [](const Config& /* unusedConfig */) {
+ return std::shared_ptr<const ov::Model>(nullptr);
+ });
+
// 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.
TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::use_npuw, NPU_USE_NPUW);
@@ -576,7 +583,6 @@ void Properties::registerCompiledModelProperties() {
TRY_REGISTER_SIMPLE_PROPERTY(ov::cache_mode, CACHE_MODE);
// Properties we shall only enable if they were set prior-to-compilation
- TRY_REGISTER_COMPILEDMODEL_PROPERTY_IFSET(ov::hint::model, MODEL_PTR);
TRY_REGISTER_COMPILEDMODEL_PROPERTY_IFSET(ov::weights_path, WEIGHTS_PATH);
TRY_REGISTER_COMPILEDMODEL_PROPERTY_IFSET(ov::cache_dir, CACHE_DIR);
TRY_REGISTER_COMPILEDMODEL_PROPERTY_IFSET(ov::enable_profiling, PERF_COUNT);
@@ -613,6 +619,14 @@ void Properties::registerCompiledModelProperties() {
return config.get<WORKLOAD_TYPE>();
});
+ FORCE_REGISTER_CUSTOM_PROPERTY(ov::hint::model,
+ MODEL_PTR,
+ true,
+ ov::PropertyMutability::RO,
+ [](const Config& /* unusedConfig */) {
+ return std::shared_ptr<const ov::Model>(nullptr);
+ });
+
// 2. Metrics (static device and enviroment properties)
// ========
// REGISTER_SIMPLE_METRIC format: (property, public true/false, return value)
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.cpp
index 92a9af9c2a4..db0b0d37a08 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
@@ -29,7 +29,11 @@ std::vector<std::pair<std::string, ov::Any>> exe_network_immutable_properties =
{std::make_pair(ov::optimal_number_of_infer_requests.name(), ov::Any(2))},
{std::make_pair(ov::hint::enable_cpu_pinning.name(), ov::Any(false))},
{std::make_pair(ov::supported_properties.name(), ov::Any("deadbeef"))},
- {std::make_pair(ov::model_name.name(), ov::Any("deadbeef"))}};
+ {std::make_pair(ov::model_name.name(), ov::Any("deadbeef"))},
+ {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 constness
+};
std::vector<std::pair<std::string, ov::Any>> plugin_public_mutable_properties = {
{ov::hint::num_requests.name(), ov::Any(5)},
diff --git a/src/plugins/intel_npu/tests/functional/common/utils.hpp b/src/plugins/intel_npu/tests/functional/common/utils.hpp
index 7fbb09339d9..245f50b974a 100644
--- a/src/plugins/intel_npu/tests/functional/common/utils.hpp
+++ b/src/plugins/intel_npu/tests/functional/common/utils.hpp
@@ -89,9 +89,13 @@ namespace test {
namespace utils {
-template <typename T>
+template <typename T, bool COUNTER = false>
std::string appendPlatformTypeTestName(testing::TestParamInfo<typename T::ParamType> obj) {
- const std::string& test_name = GenericTestCaseNameClass::getTestCaseName<T>(obj);
+ std::string test_name = GenericTestCaseNameClass::getTestCaseName<T>(obj);
+ if constexpr (COUNTER == true) { // used only when test name duplication has justification
+ static size_t testCounter = 0;
+ test_name += "_testCounter=" + std::to_string(testCounter++);
+ }
return test_name + "_targetPlatform=" + getTestsPlatformFromEnvironmentOr(ov::test::utils::DEVICE_NPU);
}
diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.hpp
index 8df1706c23d..dd8bd11b679 100644
--- a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.hpp
+++ b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.hpp
@@ -10,6 +10,7 @@
#include "common/utils.hpp"
#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp"
#include "intel_npu/config/options.hpp"
+#include "openvino/util/log.hpp"
using namespace ov::test::behavior;
@@ -41,6 +42,9 @@ public:
std::tie(targetDevice, configuration) = obj.param;
std::replace(targetDevice.begin(), targetDevice.end(), ':', '_');
std::ostringstream result;
+ static uint8_t testCounter = 0;
+ result << "_testCounter=" << std::to_string(testCounter++)
+ << "_"; // used to avoid same names for different tests
result << "targetDevice=" << ov::test::utils::getDeviceNameTestCase(targetDevice) << "_";
result << "config=(" << configuration.first << "=" << configuration.second.as<std::string>() << ")";
result << "_targetPlatform=" + ov::test::utils::getTestsPlatformFromEnvironmentOr(ov::test::utils::DEVICE_NPU);
@@ -73,6 +77,9 @@ public:
std::tie(targetDevice, configuration) = obj.param;
std::replace(targetDevice.begin(), targetDevice.end(), ':', '_');
std::ostringstream result;
+ static uint8_t testCounter = 0;
+ result << "_testCounter="
+ << std::to_string(testCounter++) + "_"; // used to avoid same names for different tests
result << "targetDevice=" << ov::test::utils::getDeviceNameTestCase(targetDevice) << "_";
result << "config=(" << configuration.first << "=" << configuration.second.as<std::string>() << ")";
result << "_targetPlatform=" + ov::test::utils::getTestsPlatformFromEnvironmentOr(ov::test::utils::DEVICE_NPU);
diff --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.cpp
index 48f5e4c4f18..c7bb57e5a59 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
@@ -44,6 +44,9 @@ const std::vector<std::pair<std::string, ov::Any>> compiledModelProperties = {
{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 constness
{ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::HIGH)},
{ov::intel_npu::tiles.name(), ov::Any(2)},
{ov::intel_npu::profiling_type.name(), ov::Any(ov::intel_npu::ProfilingType::INFER)},
@@ -154,27 +157,28 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(compiledModelConfigs)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesTests>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesTests, true>));
INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVClassCompiledModelPropertiesTests,
::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(heteroCompiledModelConfigs)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesTests>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesTests, true>));
-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
- OVClassCompileModelWithCorrectPropertiesTest,
- ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(compiledModelConfigs)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompileModelWithCorrectPropertiesTest>);
+INSTANTIATE_TEST_SUITE_P(
+ smoke_BehaviorTests,
+ OVClassCompileModelWithCorrectPropertiesTest,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(compiledModelConfigs)),
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompileModelWithCorrectPropertiesTest, true>));
-INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
- OVClassCompileModelWithCorrectPropertiesTest,
- ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
- ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(heteroCompiledModelConfigs)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompileModelWithCorrectPropertiesTest>);
+INSTANTIATE_TEST_SUITE_P(
+ smoke_Hetero_BehaviorTests,
+ OVClassCompileModelWithCorrectPropertiesTest,
+ ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
+ ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(heteroCompiledModelConfigs)),
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompileModelWithCorrectPropertiesTest, true>));
const std::vector<ov::AnyMap> configsWithSecondaryProperties = {
{ov::device::properties(ov::test::utils::DEVICE_NPU,
@@ -250,10 +254,11 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
::testing::Values(ov::test::utils::DEVICE_NPU),
ov::test::utils::appendPlatformTypeTestName<OVCompiledModelIncorrectDevice>);
-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
- OVCompiledModelPropertiesDefaultSupportedTests,
- ::testing::Values(ov::test::utils::DEVICE_NPU),
- ov::test::utils::appendPlatformTypeTestName<OVCompiledModelPropertiesDefaultSupportedTests>);
+INSTANTIATE_TEST_SUITE_P(
+ smoke_BehaviorTests,
+ OVCompiledModelPropertiesDefaultSupportedTests,
+ ::testing::Values(ov::test::utils::DEVICE_NPU),
+ (ov::test::utils::appendPlatformTypeTestName<OVCompiledModelPropertiesDefaultSupportedTests, true>));
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
OVClassCompiledModelPropertiesDefaultTests,
@@ -271,14 +276,14 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVClassCompiledModelSetCorrectConfigTest,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(compiledModelPropertiesAnyToString)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelSetCorrectConfigTest>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelSetCorrectConfigTest, true>));
INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVClassCompiledModelSetCorrectConfigTest,
::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(compiledModelPropertiesAnyToString)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelSetCorrectConfigTest>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelSetCorrectConfigTest, true>));
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
OVClassCompiledModelSetIncorrectConfigTest,
@@ -296,7 +301,7 @@ INSTANTIATE_TEST_SUITE_P(
OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(compiledModelConfigs + allModelPriorities)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_MODEL_PRIORITY, true>));
INSTANTIATE_TEST_SUITE_P(
smoke_Hetero_BehaviorTests,
@@ -304,32 +309,33 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(heteroCompiledModelConfigs)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_DEVICE_PRIORITY>);
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_DEVICE_PRIORITY, true>));
-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
- OVClassCompiledModelGetPropertyTest_EXEC_DEVICES,
- ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(combineParamsExecDevices)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_EXEC_DEVICES>);
+INSTANTIATE_TEST_SUITE_P(
+ smoke_BehaviorTests,
+ OVClassCompiledModelGetPropertyTest_EXEC_DEVICES,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn(combineParamsExecDevices)),
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, true>));
-INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
- OVClassCompiledModelGetPropertyTest_EXEC_DEVICES,
- ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
- ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(combineHeteroParamsExecDevices)),
- ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_EXEC_DEVICES>);
+INSTANTIATE_TEST_SUITE_P(
+ smoke_Hetero_BehaviorTests,
+ OVClassCompiledModelGetPropertyTest_EXEC_DEVICES,
+ ::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
+ ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(combineHeteroParamsExecDevices)),
+ (ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelGetPropertyTest_EXEC_DEVICES, true>));
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVCompileModelGetExecutionDeviceTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(combineParamsExecDevices)),
- ov::test::utils::appendPlatformTypeTestName<OVCompileModelGetExecutionDeviceTests>);
+ (ov::test::utils::appendPlatformTypeTestName<OVCompileModelGetExecutionDeviceTests, true>));
INSTANTIATE_TEST_SUITE_P(smoke_Hetero_BehaviorTests,
OVCompileModelGetExecutionDeviceTests,
::testing::Combine(::testing::Values(std::string(ov::test::utils::DEVICE_HETERO) + ":" +
ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(combineHeteroParamsExecDevices)),
- ov::test::utils::appendPlatformTypeTestName<OVCompileModelGetExecutionDeviceTests>);
+ (ov::test::utils::appendPlatformTypeTestName<OVCompileModelGetExecutionDeviceTests, true>));
} // namespace
diff --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.cpp
index b99ff95e1c0..67b36da3a78 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
@@ -91,6 +91,8 @@ const std::vector<ov::AnyMap> CorrectCompiledModelProperties = {
{{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
};
const std::vector<ov::AnyMap> IncorrectImmutableProperties = {
@@ -217,20 +219,21 @@ INSTANTIATE_TEST_SUITE_P(
OVCheckChangePropComplieModleGetPropTests_DEVICE_ID,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(CorrectCompiledModelProperties)),
- (ov::test::utils::appendPlatformTypeTestName<OVCheckChangePropComplieModleGetPropTests_DEVICE_ID>));
+ (ov::test::utils::appendPlatformTypeTestName<OVCheckChangePropComplieModleGetPropTests_DEVICE_ID, true>));
INSTANTIATE_TEST_SUITE_P(
smoke_BehaviorTests_OVCheckChangePropComplieModleGetPropTests_InferencePrecision,
OVCheckChangePropComplieModleGetPropTests_InferencePrecision,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(CorrectCompiledModelProperties)),
- (ov::test::utils::appendPlatformTypeTestName<OVCheckChangePropComplieModleGetPropTests_InferencePrecision>));
+ (ov::test::utils::appendPlatformTypeTestName<OVCheckChangePropComplieModleGetPropTests_InferencePrecision, true>));
-INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_OVCheckMetricsPropsTests_ModelDependceProps,
- OVCheckMetricsPropsTests_ModelDependceProps,
- ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(CorrectCompiledModelProperties)),
- (ov::test::utils::appendPlatformTypeTestName<OVCheckMetricsPropsTests_ModelDependceProps>));
+INSTANTIATE_TEST_SUITE_P(
+ smoke_BehaviorTests_OVCheckMetricsPropsTests_ModelDependceProps,
+ OVCheckMetricsPropsTests_ModelDependceProps,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(CorrectCompiledModelProperties)),
+ (ov::test::utils::appendPlatformTypeTestName<OVCheckMetricsPropsTests_ModelDependceProps, true>));
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_OVClassSetDefaultDeviceIDPropTest,
OVClassSetDefaultDeviceIDPropTest,