Skip to content

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

[intel-npu] Dynamic options and properties and refactoring (#27955)

Attila Csok553d9b934991
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp
deleted file mode 100644
index e194a9edbf5..00000000000
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/common.hpp
+++ /dev/null
@@ -1,274 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#pragma once
-
-#include "intel_npu/config/config.hpp"
-#include "intel_npu/npu_private_properties.hpp"
-#include "openvino/runtime/internal_properties.hpp"
-#include "openvino/runtime/properties.hpp"
-
-namespace intel_npu {
-
-//
-// register
-//
-
-void registerCommonOptions(OptionsDesc& desc);
-
-//
-// PERFORMANCE_HINT
-//
-
-struct PERFORMANCE_HINT final : OptionBase<PERFORMANCE_HINT, ov::hint::PerformanceMode> {
- static std::string_view key() {
- return ov::hint::performance_mode.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::hint::PerformanceMode";
- }
-
- static ov::hint::PerformanceMode defaultValue() {
- return ov::hint::PerformanceMode::LATENCY;
- }
-
- static ov::hint::PerformanceMode parse(std::string_view val);
-};
-
-// PERFORMANCE_HINT_NUM_REQUESTS
-//
-
-struct PERFORMANCE_HINT_NUM_REQUESTS final : OptionBase<PERFORMANCE_HINT_NUM_REQUESTS, uint32_t> {
- static std::string_view key() {
- return ov::hint::num_requests.name();
- }
-
- /**
- * @brief Returns configuration value if it is valid, otherwise throws
- * @details This is the same function as "InferenceEngine::PerfHintsConfig::CheckPerformanceHintRequestValue",
- * slightly modified as to not rely on the legacy API anymore.
- * @param configuration value as string
- * @return configuration value as number
- */
- static uint32_t parse(std::string_view val) {
- int val_i = -1;
- try {
- val_i = std::stoi(val.data());
- if (val_i >= 0)
- return val_i;
- else
- throw std::logic_error("wrong val");
- } catch (const std::exception&) {
- OPENVINO_THROW("Wrong value of ",
- val.data(),
- " for property key ",
- ov::hint::num_requests.name(),
- ". Expected only positive integer numbers");
- }
- }
-
- static uint32_t defaultValue() {
- // Default value depends on PERFORMANCE_HINT, see getOptimalNumberOfInferRequestsInParallel
- // 1 corresponds to LATENCY and default mode (hints not specified)
- return 1u;
- }
-};
-
-//
-// INFERENCE_PRECISION_HINT
-//
-
-struct INFERENCE_PRECISION_HINT final : OptionBase<INFERENCE_PRECISION_HINT, ov::element::Type> {
- static std::string_view key() {
- return ov::hint::inference_precision.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::hint::inference_precision";
- }
-
- static ov::element::Type defaultValue() {
- return ov::element::f16;
- }
-
- static ov::element::Type parse(std::string_view val) {
- if (val.empty() || (val == "f16")) {
- return ov::element::f16;
- } else if (val == "i8") {
- return ov::element::i8;
- } else {
- OPENVINO_THROW("Wrong value ",
- val.data(),
- " for property key ",
- ov::hint::inference_precision.name(),
- ". Supported values: f16, i8");
- }
- };
-};
-
-//
-// PERF_COUNT
-//
-
-struct PERF_COUNT final : OptionBase<PERF_COUNT, bool> {
- static std::string_view key() {
- return ov::enable_profiling.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-};
-
-//
-// LOG_LEVEL
-//
-
-struct LOG_LEVEL final : OptionBase<LOG_LEVEL, ov::log::Level> {
- static std::string_view key() {
- return ov::log::level.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::log::Level";
- }
-
- static std::string_view envVar() {
- return "OV_NPU_LOG_LEVEL";
- }
-
- static ov::log::Level defaultValue() {
-#if defined(NPU_PLUGIN_DEVELOPER_BUILD) || !defined(NDEBUG)
- return ov::log::Level::WARNING;
-#else
- return ov::log::Level::ERR;
-#endif
- }
-};
-
-//
-// PLATFORM
-//
-
-struct PLATFORM final : OptionBase<PLATFORM, std::string> {
- static std::string_view key() {
- return ov::intel_npu::platform.name();
- }
-
- static std::string defaultValue() {
- return std::string(ov::intel_npu::Platform::AUTO_DETECT);
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_PLATFORM";
- }
-#endif
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// DEVICE_ID
-//
-
-struct DEVICE_ID final : OptionBase<DEVICE_ID, std::string> {
- static std::string_view key() {
- return ov::device::id.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-};
-
-//
-// CACHE_DIR
-//
-
-struct CACHE_DIR final : OptionBase<CACHE_DIR, std::string> {
- static std::string_view key() {
- return ov::cache_dir.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-};
-
-//
-// LOADED_FROM_CACHE
-//
-
-struct LOADED_FROM_CACHE final : OptionBase<LOADED_FROM_CACHE, bool> {
- static std::string_view key() {
- return ov::loaded_from_cache.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-};
-
-//
-// CACHING PROPERTIES
-//
-
-struct CACHING_PROPERTIES final : OptionBase<CACHING_PROPERTIES, std::string> {
- static std::string_view key() {
- return ov::internal::caching_properties.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-};
-
-//
-// INTERNAL SUPPORTED PROPERTIES
-//
-
-struct INTERNAL_SUPPORTED_PROPERTIES final : OptionBase<INTERNAL_SUPPORTED_PROPERTIES, std::string> {
- static std::string_view key() {
- return ov::internal::supported_properties.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-};
-
-//
-// BATCH_MODE
-//
-struct BATCH_MODE final : OptionBase<BATCH_MODE, ov::intel_npu::BatchMode> {
- static std::string_view key() {
- return ov::intel_npu::batch_mode.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::intel_npu::BatchMode";
- }
-
- static ov::intel_npu::BatchMode defaultValue() {
- return ov::intel_npu::BatchMode::AUTO;
- }
-
- static ov::intel_npu::BatchMode parse(std::string_view val);
-
- static std::string toString(const ov::intel_npu::BatchMode& val);
-};
-
-} // namespace intel_npu
-
-namespace ov {
-namespace hint {
-
-std::string_view stringifyEnum(PerformanceMode val);
-
-} // namespace hint
-} // namespace ov
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp
deleted file mode 100644
index 56326b78969..00000000000
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/compiler.hpp
+++ /dev/null
@@ -1,425 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#pragma once
-
-#include <thread>
-
-#include "common.hpp"
-#include "intel_npu/config/config.hpp"
-#include "intel_npu/npu_private_properties.hpp"
-#include "openvino/runtime/intel_npu/properties.hpp"
-
-namespace ov {
-
-namespace intel_npu {
-
-std::string_view stringifyEnum(CompilerType val);
-
-} // namespace intel_npu
-
-} // namespace ov
-
-namespace intel_npu {
-
-//
-// register
-//
-
-void registerCompilerOptions(OptionsDesc& desc);
-
-//
-// COMPILER_TYPE
-//
-
-struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerType> {
- static std::string_view key() {
- return ov::intel_npu::compiler_type.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::intel_npu::CompilerType";
- }
-
- static std::string_view envVar();
-
- static ov::intel_npu::CompilerType defaultValue();
-
- static ov::intel_npu::CompilerType parse(std::string_view val);
-
- static std::string toString(const ov::intel_npu::CompilerType& val);
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// COMPILATION_MODE
-//
-
-struct COMPILATION_MODE final : OptionBase<COMPILATION_MODE, std::string> {
- static std::string_view key() {
- return ov::intel_npu::compilation_mode.name();
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_COMPILATION_MODE";
- }
-#endif
-
- static std::string defaultValue() {
- return "";
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// EXECUTION_MODE_HINT
-//
-
-struct EXECUTION_MODE_HINT final : OptionBase<EXECUTION_MODE_HINT, ov::hint::ExecutionMode> {
- static std::string_view key() {
- return ov::hint::execution_mode.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::hint::ExecutionMode";
- }
-
- static ov::hint::ExecutionMode defaultValue() {
- return ov::hint::ExecutionMode::PERFORMANCE;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return true;
- }
-};
-
-//
-// DYNAMIC_SHAPE_TO_STATIC
-//
-
-struct DYNAMIC_SHAPE_TO_STATIC final : OptionBase<DYNAMIC_SHAPE_TO_STATIC, bool> {
- static std::string_view key() {
- return ov::intel_npu::dynamic_shape_to_static.name();
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_DYNAMIC_SHAPE_TO_STATIC";
- }
-#endif
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-};
-
-//
-// COMPILATION_MODE_PARAMS
-//
-
-struct COMPILATION_MODE_PARAMS final : OptionBase<COMPILATION_MODE_PARAMS, std::string> {
- static std::string_view key() {
- return ov::intel_npu::compilation_mode_params.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return true;
- }
-};
-
-//
-// DPU_GROUPS
-//
-
-struct DPU_GROUPS final : OptionBase<DPU_GROUPS, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::dpu_groups.name();
- }
-
- static std::vector<std::string_view> deprecatedKeys() {
- return {};
- }
-
- static int64_t defaultValue() {
- return -1;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_DPU_GROUPS";
- }
-#endif
-};
-
-//
-// SELECTED_TILES
-//
-
-struct TILES final : OptionBase<TILES, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::tiles.name();
- }
-
- static std::vector<std::string_view> deprecatedKeys() {
- return {};
- }
-
- static int64_t defaultValue() {
- return -1;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_TILES";
- }
-#endif
-};
-
-//
-// STEPPING
-//
-
-struct STEPPING final : OptionBase<STEPPING, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::stepping.name();
- }
-
- static std::vector<std::string_view> deprecatedKeys() {
- return {};
- }
-
- static int64_t defaultValue() {
- return -1;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// MAX_TILES
-//
-
-struct MAX_TILES final : OptionBase<MAX_TILES, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::max_tiles.name();
- }
-
- static std::vector<std::string_view> deprecatedKeys() {
- return {};
- }
-
- static int64_t defaultValue() {
- return -1;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// DMA_ENGINES
-//
-
-struct DMA_ENGINES final : OptionBase<DMA_ENGINES, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::dma_engines.name();
- }
-
- static std::vector<std::string_view> deprecatedKeys() {
- return {};
- }
-
- static int64_t defaultValue() {
- return -1;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_DMA_ENGINES";
- }
-#endif
-};
-
-//
-// BACKEND_COMPILATION_PARAMS
-//
-
-struct BACKEND_COMPILATION_PARAMS final : OptionBase<BACKEND_COMPILATION_PARAMS, std::string> {
- static std::string_view key() {
- return ov::intel_npu::backend_compilation_params.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// COMPILATION_NUM_THREADS
-//
-
-struct COMPILATION_NUM_THREADS final : OptionBase<COMPILATION_NUM_THREADS, int32_t> {
- static std::string_view key() {
- return ov::compilation_num_threads.name();
- }
-
- static int32_t defaultValue() {
- return std::max(1, static_cast<int>(std::thread::hardware_concurrency()));
- }
-
- static void validateValue(const int32_t& num) {
- if (num <= 0) {
- OPENVINO_THROW("ov::compilation_num_threads must be positive int32 value");
- }
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-//
-// NPU_COMPILER_DYNAMIC_QUANTIZATION
-//
-
-struct COMPILER_DYNAMIC_QUANTIZATION final : OptionBase<COMPILER_DYNAMIC_QUANTIZATION, bool> {
- static std::string_view key() {
- return ov::intel_npu::compiler_dynamic_quantization.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return true;
- }
-};
-
-//
-// NPU_QDQ_OPTIMIZATION
-//
-
-struct QDQ_OPTIMIZATION final : OptionBase<QDQ_OPTIMIZATION, bool> {
- static std::string_view key() {
- return ov::intel_npu::qdq_optimization.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return true;
- }
-};
-
-//
-// BATCH_COMPILER_MODE_SETTINGS
-//
-
-struct BATCH_COMPILER_MODE_SETTINGS final : OptionBase<BATCH_COMPILER_MODE_SETTINGS, std::string> {
- static std::string_view key() {
- return ov::intel_npu::batch_compiler_mode_settings.name();
- }
-
- static std::string defaultValue() {
- return {};
- }
-
- static OptionMode mode() {
- return OptionMode::CompileTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp
index fd1a8df6cfc..fc527aae3e7 100644
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/config.hpp
@@ -50,6 +50,11 @@ TYPE_PRINTER(double)
TYPE_PRINTER(std::string)
TYPE_PRINTER(std::size_t)
+#ifndef ONEAPI_MAKE_VERSION
+/// @brief Generates generic 'oneAPI' API versions
+# define ONEAPI_MAKE_VERSION(_major, _minor) ((_major << 16) | (_minor & 0x0000ffff))
+#endif // ONEAPI_MAKE_VERSION
+
//
// OptionParser
//
@@ -276,7 +281,17 @@ struct OptionBase {
// Overload this for private options.
static bool isPublic() {
- return true;
+ return false;
+ }
+
+ // Overload this for read-only options (metrics)
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ /// Overload this for options conditioned by compiler version
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(0, 0);
}
static std::string toString(const ValueType& val) {
@@ -341,6 +356,8 @@ struct OptionConcept final {
std::string_view (*envVar)() = nullptr;
OptionMode (*mode)() = nullptr;
bool (*isPublic)() = nullptr;
+ ov::PropertyMutability (*mutability)() = nullptr;
+ uint32_t (*compilerSupportVersion)() = nullptr;
std::shared_ptr<OptionValue> (*validateAndParse)(std::string_view val) = nullptr;
};
@@ -359,7 +376,13 @@ std::shared_ptr<OptionValue> validateAndParse(std::string_view val) {
template <class Opt>
OptionConcept makeOptionModel() {
- return {&Opt::key, &Opt::envVar, &Opt::mode, &Opt::isPublic, &validateAndParse<Opt>};
+ return {&Opt::key,
+ &Opt::envVar,
+ &Opt::mode,
+ &Opt::isPublic,
+ &Opt::mutability,
+ &Opt::compilerSupportVersion,
+ &validateAndParse<Opt>};
}
} // namespace details
@@ -373,9 +396,15 @@ public:
template <class Opt>
void add();
+ bool has(std::string_view key) const;
+
+ void reset();
+
std::vector<std::string> getSupported(bool includePrivate = false) const;
+ std::vector<ov::PropertyName> getSupportedOptions(bool includePrivate = false) const;
+ std::string getSupportedAsString(bool includePrivate = false) const;
- details::OptionConcept get(std::string_view key, OptionMode mode) const;
+ details::OptionConcept get(std::string_view key, OptionMode mode = OptionMode::Both) const;
void walk(std::function<void(const details::OptionConcept&)> cb) const;
private:
@@ -401,31 +430,36 @@ void OptionsDesc::add() {
// Config
//
-class Config final {
+class Config {
public:
using ConfigMap = std::map<std::string, std::string>;
using ImplMap = std::unordered_map<std::string, std::shared_ptr<details::OptionValue>>;
explicit Config(const std::shared_ptr<const OptionsDesc>& desc);
- void update(const ConfigMap& options, OptionMode mode = OptionMode::Both);
+ virtual void update(const ConfigMap& options, OptionMode mode = OptionMode::Both);
void parseEnvVars();
template <class Opt>
bool has() const;
+ bool has(std::string key) const;
+
template <class Opt>
typename Opt::ValueType get() const;
template <class Opt>
typename std::string getString() const;
+ void fromString(const std::string& str);
+
+ // Returns a string with all config keys which have set values
std::string toString() const;
- void fromString(const std::string& str);
+ virtual ~Config() = default;
-private:
+protected:
std::shared_ptr<const OptionsDesc> _desc;
ImplMap _impl;
};
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp
index ab67000980c..643c19851b3 100644
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw.hpp
@@ -6,7 +6,7 @@
#include <thread>
-#include "common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
#include "intel_npu/npuw_private_properties.hpp"
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
new file mode 100644
index 00000000000..4a11ba6d276
--- /dev/null
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/options.hpp
@@ -0,0 +1,1386 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#pragma once
+
+#include <thread>
+
+#include "intel_npu/config/config.hpp"
+#include "intel_npu/npu_private_properties.hpp"
+#include "openvino/runtime/intel_npu/properties.hpp"
+#include "openvino/runtime/internal_properties.hpp"
+#include "openvino/runtime/properties.hpp"
+
+namespace intel_npu {
+
+//
+// PERFORMANCE_HINT
+//
+
+struct PERFORMANCE_HINT final : OptionBase<PERFORMANCE_HINT, ov::hint::PerformanceMode> {
+ static std::string_view key() {
+ return ov::hint::performance_mode.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::hint::PerformanceMode";
+ }
+
+ static ov::hint::PerformanceMode defaultValue() {
+ return ov::hint::PerformanceMode::LATENCY;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+
+ static ov::hint::PerformanceMode parse(std::string_view val) {
+ if (val.empty()) {
+ return ov::hint::PerformanceMode::LATENCY;
+ } else if (val == "LATENCY") {
+ return ov::hint::PerformanceMode::LATENCY;
+ } else if (val == "THROUGHPUT") {
+ return ov::hint::PerformanceMode::THROUGHPUT;
+ } else if (val == "CUMULATIVE_THROUGHPUT") {
+ return ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT;
+ }
+
+ OPENVINO_THROW("Value '", val, "' is not a valid PERFORMANCE_HINT option");
+ }
+
+ static std::string toString(const ov::hint::PerformanceMode& val) {
+ std::stringstream strStream;
+ switch (val) {
+ case ov::hint::PerformanceMode::LATENCY:
+ strStream << "LATENCY";
+ break;
+ case ov::hint::PerformanceMode::THROUGHPUT:
+ strStream << "THROUGHPUT";
+ break;
+ case ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT:
+ strStream << "CUMULATIVE_THROUGHPUT";
+ break;
+ default:
+ OPENVINO_THROW("Invalid ov::hint::PerformanceMode setting");
+ break;
+ }
+ return strStream.str();
+ }
+};
+
+// PERFORMANCE_HINT_NUM_REQUESTS
+//
+
+struct PERFORMANCE_HINT_NUM_REQUESTS final : OptionBase<PERFORMANCE_HINT_NUM_REQUESTS, uint32_t> {
+ static std::string_view key() {
+ return ov::hint::num_requests.name();
+ }
+
+ /**
+ * @brief Returns configuration value if it is valid, otherwise throws
+ * @details This is the same function as "InferenceEngine::PerfHintsConfig::CheckPerformanceHintRequestValue",
+ * slightly modified as to not rely on the legacy API anymore.
+ * @param configuration value as string
+ * @return configuration value as number
+ */
+ static uint32_t parse(std::string_view val) {
+ int val_i = -1;
+ try {
+ val_i = std::stoi(val.data());
+ if (val_i >= 0)
+ return val_i;
+ else
+ throw std::logic_error("wrong val");
+ } catch (const std::exception&) {
+ OPENVINO_THROW("Wrong value of ",
+ val.data(),
+ " for property key ",
+ ov::hint::num_requests.name(),
+ ". Expected only positive integer numbers");
+ }
+ }
+
+ static uint32_t defaultValue() {
+ // Default value depends on PERFORMANCE_HINT, see getOptimalNumberOfInferRequestsInParallel
+ // 1 corresponds to LATENCY and default mode (hints not specified)
+ return 1u;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+};
+
+//
+// INFERENCE_PRECISION_HINT
+//
+
+struct INFERENCE_PRECISION_HINT final : OptionBase<INFERENCE_PRECISION_HINT, ov::element::Type> {
+ static std::string_view key() {
+ return ov::hint::inference_precision.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::hint::inference_precision";
+ }
+
+ static ov::element::Type defaultValue() {
+ return ov::element::f16;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(5, 4);
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+
+ static ov::element::Type parse(std::string_view val) {
+ if (val.empty() || (val == "f16")) {
+ return ov::element::f16;
+ } else if (val == "i8") {
+ return ov::element::i8;
+ } else {
+ OPENVINO_THROW("Wrong value ",
+ val.data(),
+ " for property key ",
+ ov::hint::inference_precision.name(),
+ ". Supported values: f16, i8");
+ }
+ };
+};
+
+//
+// PERF_COUNT
+//
+
+struct PERF_COUNT final : OptionBase<PERF_COUNT, bool> {
+ static std::string_view key() {
+ return ov::enable_profiling.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+};
+
+//
+// LOG_LEVEL
+//
+
+struct LOG_LEVEL final : OptionBase<LOG_LEVEL, ov::log::Level> {
+ static std::string_view key() {
+ return ov::log::level.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::log::Level";
+ }
+
+ static std::string_view envVar() {
+ return "OV_NPU_LOG_LEVEL";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+
+ static ov::log::Level defaultValue() {
+#if defined(NPU_PLUGIN_DEVELOPER_BUILD) || !defined(NDEBUG)
+ return ov::log::Level::WARNING;
+#else
+ return ov::log::Level::ERR;
+#endif
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+};
+
+//
+// PLATFORM
+//
+
+struct PLATFORM final : OptionBase<PLATFORM, std::string> {
+ static std::string_view key() {
+ return ov::intel_npu::platform.name();
+ }
+
+ static std::string defaultValue() {
+ return std::string(ov::intel_npu::Platform::AUTO_DETECT);
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_PLATFORM";
+ }
+#endif
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// DEVICE_ID
+//
+
+struct DEVICE_ID final : OptionBase<DEVICE_ID, std::string> {
+ static std::string_view key() {
+ return ov::device::id.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+};
+
+//
+// CACHE_DIR
+//
+
+struct CACHE_DIR final : OptionBase<CACHE_DIR, std::string> {
+ static std::string_view key() {
+ return ov::cache_dir.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// LOADED_FROM_CACHE
+//
+
+struct LOADED_FROM_CACHE final : OptionBase<LOADED_FROM_CACHE, bool> {
+ static std::string_view key() {
+ return ov::loaded_from_cache.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// CACHING PROPERTIES
+//
+
+struct CACHING_PROPERTIES final : OptionBase<CACHING_PROPERTIES, std::string> {
+ static std::string_view key() {
+ return ov::internal::caching_properties.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// INTERNAL SUPPORTED PROPERTIES
+//
+
+struct INTERNAL_SUPPORTED_PROPERTIES final : OptionBase<INTERNAL_SUPPORTED_PROPERTIES, std::string> {
+ static std::string_view key() {
+ return ov::internal::supported_properties.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+};
+
+//
+// BATCH_MODE
+//
+struct BATCH_MODE final : OptionBase<BATCH_MODE, ov::intel_npu::BatchMode> {
+ static std::string_view key() {
+ return ov::intel_npu::batch_mode.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::intel_npu::BatchMode";
+ }
+
+ static ov::intel_npu::BatchMode defaultValue() {
+ return ov::intel_npu::BatchMode::AUTO;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(5, 5);
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::Both;
+ }
+
+ static ov::intel_npu::BatchMode parse(std::string_view val) {
+ if (val == "AUTO") {
+ return ov::intel_npu::BatchMode::AUTO;
+ } else if (val == "COMPILER") {
+ return ov::intel_npu::BatchMode::COMPILER;
+ } else if (val == "PLUGIN") {
+ return ov::intel_npu::BatchMode::PLUGIN;
+ }
+
+ OPENVINO_THROW("Value '", val, "'is not a valid BATCH_MODE option");
+ }
+
+ static std::string toString(const ov::intel_npu::BatchMode& val) {
+ std::stringstream strStream;
+
+ strStream << val;
+
+ return strStream.str();
+ }
+};
+
+//
+// EXCLUSIVE_ASYNC_REQUESTS
+//
+
+struct EXCLUSIVE_ASYNC_REQUESTS final : OptionBase<EXCLUSIVE_ASYNC_REQUESTS, bool> {
+ static std::string_view key() {
+ return ov::internal::exclusive_async_requests.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "bool";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+///
+/// PROFILING TYPE
+///
+struct PROFILING_TYPE final : OptionBase<PROFILING_TYPE, ov::intel_npu::ProfilingType> {
+ static std::string_view key() {
+ return ov::intel_npu::profiling_type.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::intel_npu::ProfilingType";
+ }
+
+ static ov::intel_npu::ProfilingType defaultValue() {
+ return ov::intel_npu::ProfilingType::MODEL;
+ }
+
+ static ov::intel_npu::ProfilingType parse(std::string_view val) {
+ if (val == "MODEL") {
+ return ov::intel_npu::ProfilingType::MODEL;
+ } else if (val == "INFER") {
+ return ov::intel_npu::ProfilingType::INFER;
+ }
+
+ OPENVINO_THROW("Value '", val, "' is not a valid PROFILING_TYPE option");
+ }
+
+ static std::string toString(const ov::intel_npu::ProfilingType& val) {
+ std::stringstream strStream;
+ if (val == ov::intel_npu::ProfilingType::MODEL) {
+ strStream << "MODEL";
+ } else if (val == ov::intel_npu::ProfilingType::INFER) {
+ strStream << "INFER";
+ } else {
+ OPENVINO_THROW("No valid string for current PROFILING_TYPE option");
+ }
+
+ return strStream.str();
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// MODEL_PRIORITY
+//
+
+struct MODEL_PRIORITY final : OptionBase<MODEL_PRIORITY, ov::hint::Priority> {
+ static std::string_view key() {
+ return ov::hint::model_priority.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::hint::Priority";
+ }
+
+ static ov::hint::Priority defaultValue() {
+ return ov::hint::Priority::MEDIUM;
+ }
+
+ static ov::hint::Priority parse(std::string_view val) {
+ std::istringstream stringStream = std::istringstream(std::string(val));
+ ov::hint::Priority priority;
+
+ stringStream >> priority;
+
+ return priority;
+ }
+
+ static std::string toString(const ov::hint::Priority& val) {
+ std::ostringstream stringStream;
+
+ stringStream << val;
+
+ return stringStream.str();
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// CREATE_EXECUTOR
+//
+
+struct CREATE_EXECUTOR final : OptionBase<CREATE_EXECUTOR, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::create_executor.name();
+ }
+
+ static int64_t defaultValue() {
+ return 1;
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_CREATE_EXECUTOR";
+ }
+#endif
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// DEFER_WEIGHTS_LOAD
+//
+struct DEFER_WEIGHTS_LOAD final : OptionBase<DEFER_WEIGHTS_LOAD, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::defer_weights_load.name();
+ }
+ static int64_t defaultValue() {
+ return false;
+ }
+ static constexpr std::string_view getTypeName() {
+ return "bool";
+ }
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "OV_NPU_DEFER_WEIGHTS_LOAD";
+ }
+#endif
+ static bool isPublic() {
+ return false;
+ }
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// WEIGHTS_PATH
+//
+struct WEIGHTS_PATH final : OptionBase<WEIGHTS_PATH, std::string> {
+ static std::string_view key() {
+ return ov::weights_path.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "std::string";
+ }
+
+ static std::string defaultValue() {
+ return "";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+};
+
+//
+// NUM_STREAMS
+//
+struct NUM_STREAMS final : OptionBase<NUM_STREAMS, ov::streams::Num> {
+ static std::string_view key() {
+ return ov::num_streams.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::streams::Num";
+ }
+
+ // The only supported number for currently supported platforms.
+ // FIXME: update in the future
+ static ov::streams::Num defaultValue() {
+ return ov::streams::Num(1);
+ }
+
+ static ov::streams::Num parse(std::string_view val) {
+ std::istringstream stringStream = std::istringstream(std::string(val));
+ ov::streams::Num numberOfStreams;
+
+ stringStream >> numberOfStreams;
+
+ return numberOfStreams;
+ }
+
+ static std::string itoString(const ov::streams::Num& val) {
+ std::ostringstream stringStream;
+
+ stringStream << val;
+
+ return stringStream.str();
+ }
+
+ static void validateValue(const ov::streams::Num& num) {
+ if (defaultValue() != num && ov::streams::AUTO != num) {
+ throw std::runtime_error("NUM_STREAMS can not be set");
+ }
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RO;
+ }
+};
+
+//
+// ENABLE_CPU_PINNING
+//
+struct 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 bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// WORKLOAD_TYPE
+//
+
+struct WORKLOAD_TYPE final : OptionBase<WORKLOAD_TYPE, ov::WorkloadType> {
+ static std::string_view key() {
+ return ov::workload_type.name();
+ }
+
+ static ov::WorkloadType defaultValue() {
+ return ov::WorkloadType::DEFAULT;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::WorkloadType";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static ov::WorkloadType parse(std::string_view val) {
+ std::istringstream ss = std::istringstream(std::string(val));
+ ov::WorkloadType workloadType;
+
+ ss >> workloadType;
+
+ return workloadType;
+ }
+
+ static std::string toString(const ov::WorkloadType& val) {
+ std::ostringstream ss;
+ ss << val;
+ return ss.str();
+ }
+};
+
+//
+// TURBO
+//
+struct TURBO final : OptionBase<TURBO, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::turbo.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// COMPILER_TYPE
+//
+
+struct COMPILER_TYPE final : OptionBase<COMPILER_TYPE, ov::intel_npu::CompilerType> {
+ static std::string_view key() {
+ return ov::intel_npu::compiler_type.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::intel_npu::CompilerType";
+ }
+
+ static std::string_view envVar() {
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ return "IE_NPU_COMPILER_TYPE";
+#else
+ return "";
+#endif
+ }
+
+ static ov::intel_npu::CompilerType defaultValue() {
+ return ov::intel_npu::CompilerType::DRIVER;
+ }
+
+ static ov::intel_npu::CompilerType parse(std::string_view val) {
+ if (val == "MLIR") {
+ return ov::intel_npu::CompilerType::MLIR;
+ } else if (val == "DRIVER") {
+ return ov::intel_npu::CompilerType::DRIVER;
+ }
+
+ OPENVINO_THROW("Value '", val, "' is not a valid COMPILER_TYPE option");
+ }
+
+ static std::string toString(const ov::intel_npu::CompilerType& val) {
+ std::stringstream strStream;
+ if (val == ov::intel_npu::CompilerType::MLIR) {
+ strStream << "MLIR";
+ } else if (val == ov::intel_npu::CompilerType::DRIVER) {
+ strStream << "DRIVER";
+ } else {
+ OPENVINO_THROW("No valid string for current COMPILER_TYPE option");
+ }
+
+ return strStream.str();
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+};
+
+//
+// COMPILATION_MODE
+//
+
+struct COMPILATION_MODE final : OptionBase<COMPILATION_MODE, std::string> {
+ static std::string_view key() {
+ return ov::intel_npu::compilation_mode.name();
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_COMPILATION_MODE";
+ }
+#endif
+
+ static std::string defaultValue() {
+ return "";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// EXECUTION_MODE_HINT
+//
+
+struct EXECUTION_MODE_HINT final : OptionBase<EXECUTION_MODE_HINT, ov::hint::ExecutionMode> {
+ static std::string_view key() {
+ return ov::hint::execution_mode.name();
+ }
+
+ static constexpr std::string_view getTypeName() {
+ return "ov::hint::ExecutionMode";
+ }
+
+ static ov::hint::ExecutionMode defaultValue() {
+ return ov::hint::ExecutionMode::PERFORMANCE;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(5, 6);
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// DYNAMIC_SHAPE_TO_STATIC
+//
+
+struct DYNAMIC_SHAPE_TO_STATIC final : OptionBase<DYNAMIC_SHAPE_TO_STATIC, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::dynamic_shape_to_static.name();
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_DYNAMIC_SHAPE_TO_STATIC";
+ }
+#endif
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// COMPILATION_MODE_PARAMS
+//
+
+struct COMPILATION_MODE_PARAMS final : OptionBase<COMPILATION_MODE_PARAMS, std::string> {
+ static std::string_view key() {
+ return ov::intel_npu::compilation_mode_params.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// DPU_GROUPS
+//
+
+struct DPU_GROUPS final : OptionBase<DPU_GROUPS, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::dpu_groups.name();
+ }
+
+ static std::vector<std::string_view> deprecatedKeys() {
+ return {};
+ }
+
+ static int64_t defaultValue() {
+ return -1;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_DPU_GROUPS";
+ }
+#endif
+};
+
+//
+// SELECTED_TILES
+//
+
+struct TILES final : OptionBase<TILES, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::tiles.name();
+ }
+
+ static std::vector<std::string_view> deprecatedKeys() {
+ return {};
+ }
+
+ static int64_t defaultValue() {
+ return -1;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_TILES";
+ }
+#endif
+};
+
+//
+// STEPPING
+//
+
+struct STEPPING final : OptionBase<STEPPING, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::stepping.name();
+ }
+
+ static std::vector<std::string_view> deprecatedKeys() {
+ return {};
+ }
+
+ static int64_t defaultValue() {
+ return -1;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(5, 3);
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// MAX_TILES
+//
+
+struct MAX_TILES final : OptionBase<MAX_TILES, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::max_tiles.name();
+ }
+
+ static std::vector<std::string_view> deprecatedKeys() {
+ return {};
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(5, 3);
+ }
+
+ static int64_t defaultValue() {
+ return -1;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// DMA_ENGINES
+//
+
+struct DMA_ENGINES final : OptionBase<DMA_ENGINES, int64_t> {
+ static std::string_view key() {
+ return ov::intel_npu::dma_engines.name();
+ }
+
+ static std::vector<std::string_view> deprecatedKeys() {
+ return {};
+ }
+
+ static int64_t defaultValue() {
+ return -1;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "IE_NPU_DMA_ENGINES";
+ }
+#endif
+};
+
+//
+// BACKEND_COMPILATION_PARAMS
+//
+
+struct BACKEND_COMPILATION_PARAMS final : OptionBase<BACKEND_COMPILATION_PARAMS, std::string> {
+ static std::string_view key() {
+ return ov::intel_npu::backend_compilation_params.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// COMPILATION_NUM_THREADS
+//
+
+struct COMPILATION_NUM_THREADS final : OptionBase<COMPILATION_NUM_THREADS, int32_t> {
+ static std::string_view key() {
+ return ov::compilation_num_threads.name();
+ }
+
+ static int32_t defaultValue() {
+ return std::max(1, static_cast<int>(std::thread::hardware_concurrency()));
+ }
+
+ static void validateValue(const int32_t& num) {
+ if (num <= 0) {
+ OPENVINO_THROW("ov::compilation_num_threads must be positive int32 value");
+ }
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+};
+
+//
+// NPU_COMPILER_DYNAMIC_QUANTIZATION
+//
+
+struct COMPILER_DYNAMIC_QUANTIZATION final : OptionBase<COMPILER_DYNAMIC_QUANTIZATION, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::compiler_dynamic_quantization.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(7, 1);
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+};
+
+//
+// BYPASS_UMD_CACHING
+//
+struct BYPASS_UMD_CACHING final : OptionBase<BYPASS_UMD_CACHING, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::bypass_umd_caching.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+
+ static ov::PropertyMutability mutability() {
+ return ov::PropertyMutability::RW;
+ }
+};
+
+//
+// RUN_INFERENCES_SEQUENTIALLY
+//
+struct RUN_INFERENCES_SEQUENTIALLY final : OptionBase<RUN_INFERENCES_SEQUENTIALLY, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::run_inferences_sequentially.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// NPU_QDQ_OPTIMIZATION
+//
+
+struct QDQ_OPTIMIZATION final : OptionBase<QDQ_OPTIMIZATION, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::qdq_optimization.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static bool isPublic() {
+ return true;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(7, 5);
+ }
+};
+
+//
+// DISABLE_VERSION_CHECK
+//
+
+struct DISABLE_VERSION_CHECK final : OptionBase<DISABLE_VERSION_CHECK, bool> {
+ static std::string_view key() {
+ return ov::intel_npu::disable_version_check.name();
+ }
+
+ static bool defaultValue() {
+ return false;
+ }
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+ static std::string_view envVar() {
+ return "OV_NPU_DISABLE_VERSION_CHECK";
+ }
+#endif
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+//
+// BATCH_COMPILER_MODE_SETTINGS
+//
+
+struct BATCH_COMPILER_MODE_SETTINGS final : OptionBase<BATCH_COMPILER_MODE_SETTINGS, std::string> {
+ static std::string_view key() {
+ return ov::intel_npu::batch_compiler_mode_settings.name();
+ }
+
+ static std::string defaultValue() {
+ return {};
+ }
+
+ static OptionMode mode() {
+ return OptionMode::CompileTime;
+ }
+
+ static uint32_t compilerSupportVersion() {
+ return ONEAPI_MAKE_VERSION(7, 4);
+ }
+
+ static bool isPublic() {
+ return false;
+ }
+};
+
+//
+// MODEL_PTR
+//
+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<ov::Model>";
+ }
+
+ static std::shared_ptr<const ov::Model> defaultValue() {
+ return nullptr;
+ }
+
+ static std::shared_ptr<const ov::Model> parse(std::string_view) {
+ return nullptr;
+ }
+ static std::string toString(const std::shared_ptr<const ov::Model>& /* unused m*/) {
+ return "";
+ }
+
+ static OptionMode mode() {
+ return OptionMode::RunTime;
+ }
+};
+
+} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp
deleted file mode 100644
index 0987b27f85d..00000000000
--- a/src/plugins/intel_npu/src/al/include/intel_npu/config/runtime.hpp
+++ /dev/null
@@ -1,360 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#pragma once
-
-#include "intel_npu/config/config.hpp"
-#include "intel_npu/npu_private_properties.hpp"
-#include "openvino/runtime/intel_npu/properties.hpp"
-#include "openvino/runtime/internal_properties.hpp"
-#include "openvino/runtime/properties.hpp"
-
-namespace ov {
-
-namespace intel_npu {
-
-std::string_view stringifyEnum(ProfilingType val);
-
-} // namespace intel_npu
-
-} // namespace ov
-
-namespace intel_npu {
-
-//
-// register
-//
-
-void registerRunTimeOptions(OptionsDesc& desc);
-
-//
-// EXCLUSIVE_ASYNC_REQUESTS
-//
-
-struct EXCLUSIVE_ASYNC_REQUESTS final : OptionBase<EXCLUSIVE_ASYNC_REQUESTS, bool> {
- static std::string_view key() {
- return ov::internal::exclusive_async_requests.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static constexpr std::string_view getTypeName() {
- return "bool";
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-int64_t getOptimalNumberOfInferRequestsInParallel(const Config& config);
-
-///
-/// PROFILING TYPE
-///
-struct PROFILING_TYPE final : OptionBase<PROFILING_TYPE, ov::intel_npu::ProfilingType> {
- static std::string_view key() {
- return ov::intel_npu::profiling_type.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::intel_npu::ProfilingType";
- }
-
- static ov::intel_npu::ProfilingType defaultValue() {
- return ov::intel_npu::ProfilingType::MODEL;
- }
-
- static ov::intel_npu::ProfilingType parse(std::string_view val);
-
- static std::string toString(const ov::intel_npu::ProfilingType& val);
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// MODEL_PRIORITY
-//
-
-struct MODEL_PRIORITY final : OptionBase<MODEL_PRIORITY, ov::hint::Priority> {
- static std::string_view key() {
- return ov::hint::model_priority.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::hint::Priority";
- }
-
- static ov::hint::Priority defaultValue() {
- return ov::hint::Priority::MEDIUM;
- }
-
- static ov::hint::Priority parse(std::string_view val);
-
- static std::string toString(const ov::hint::Priority& val);
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// CREATE_EXECUTOR
-//
-
-struct CREATE_EXECUTOR final : OptionBase<CREATE_EXECUTOR, int64_t> {
- static std::string_view key() {
- return ov::intel_npu::create_executor.name();
- }
-
- static int64_t defaultValue() {
- return 1;
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "IE_NPU_CREATE_EXECUTOR";
- }
-#endif
-
- static bool isPublic() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// DEFER_WEIGHTS_LOAD
-//
-
-struct DEFER_WEIGHTS_LOAD final : OptionBase<DEFER_WEIGHTS_LOAD, bool> {
- static std::string_view key() {
- return ov::intel_npu::defer_weights_load.name();
- }
-
- static int64_t defaultValue() {
- return false;
- }
-
- static constexpr std::string_view getTypeName() {
- return "bool";
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "OV_NPU_DEFER_WEIGHTS_LOAD";
- }
-#endif
-
- static bool isPublic() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// NUM_STREAMS
-//
-struct NUM_STREAMS final : OptionBase<NUM_STREAMS, ov::streams::Num> {
- static std::string_view key() {
- return ov::num_streams.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::streams::Num";
- }
-
- const static ov::streams::Num defVal;
-
- // The only supported number for currently supported platforms.
- // FIXME: update in the future
- static ov::streams::Num defaultValue() {
- return defVal;
- }
-
- static ov::streams::Num parse(std::string_view val);
-
- static std::string toString(const ov::streams::Num& val);
-
- static void validateValue(const ov::streams::Num& num) {
- if (defVal != num && ov::streams::AUTO != num) {
- throw std::runtime_error("NUM_STREAMS can not be set");
- }
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// WEIGHTS_PATH
-//
-struct WEIGHTS_PATH final : OptionBase<WEIGHTS_PATH, std::string> {
- static std::string_view key() {
- return ov::weights_path.name();
- }
-
- static constexpr std::string_view getTypeName() {
- return "std::string";
- }
-
- static std::string defaultValue() {
- return "";
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// MODEL_PTR
-//
-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<ov::Model>";
- }
-
- static std::shared_ptr<const ov::Model> defaultValue() {
- return nullptr;
- }
-
- static std::shared_ptr<const ov::Model> parse(std::string_view) {
- return nullptr;
- }
- static std::string toString(const std::shared_ptr<const ov::Model>& m) {
- return "";
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// ENABLE_CPU_PINNING
-//
-struct 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 OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// WORKLOAD_TYPE
-//
-
-struct WORKLOAD_TYPE final : OptionBase<WORKLOAD_TYPE, ov::WorkloadType> {
- static std::string_view key() {
- return ov::workload_type.name();
- }
-
- static ov::WorkloadType defaultValue() {
- return ov::WorkloadType::DEFAULT;
- }
-
- static constexpr std::string_view getTypeName() {
- return "ov::WorkloadType";
- }
-
- static ov::WorkloadType parse(std::string_view val);
-
- static std::string toString(const ov::WorkloadType& val);
-};
-
-//
-// TURBO
-//
-struct TURBO final : OptionBase<TURBO, bool> {
- static std::string_view key() {
- return ov::intel_npu::turbo.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// BYPASS_UMD_CACHING
-//
-struct BYPASS_UMD_CACHING final : OptionBase<BYPASS_UMD_CACHING, bool> {
- static std::string_view key() {
- return ov::intel_npu::bypass_umd_caching.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-//
-// RUN_INFERENCES_SEQUENTIALLY
-//
-struct RUN_INFERENCES_SEQUENTIALLY final : OptionBase<RUN_INFERENCES_SEQUENTIALLY, bool> {
- static std::string_view key() {
- return ov::intel_npu::run_inferences_sequentially.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-struct DISABLE_VERSION_CHECK final : OptionBase<DISABLE_VERSION_CHECK, bool> {
- static std::string_view key() {
- return ov::intel_npu::disable_version_check.name();
- }
-
- static bool defaultValue() {
- return false;
- }
-
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- static std::string_view envVar() {
- return "OV_NPU_DISABLE_VERSION_CHECK";
- }
-#endif
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-};
-
-} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/al/src/config/common.cpp b/src/plugins/intel_npu/src/al/src/config/common.cpp
deleted file mode 100644
index 1b93e4880da..00000000000
--- a/src/plugins/intel_npu/src/al/src/config/common.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#include "intel_npu/config/common.hpp"
-
-using namespace intel_npu;
-using namespace ov::intel_npu;
-
-//
-// register
-//
-
-void intel_npu::registerCommonOptions(OptionsDesc& desc) {
- desc.add<PERFORMANCE_HINT>();
- desc.add<PERFORMANCE_HINT_NUM_REQUESTS>();
- desc.add<INFERENCE_PRECISION_HINT>();
- desc.add<PERF_COUNT>();
- desc.add<LOG_LEVEL>();
- desc.add<PLATFORM>();
- desc.add<DEVICE_ID>();
- desc.add<CACHE_DIR>();
- desc.add<LOADED_FROM_CACHE>();
- desc.add<BATCH_MODE>();
-}
-
-//
-// PERFORMANCE_HINT
-//
-
-std::string_view ov::hint::stringifyEnum(PerformanceMode val) {
- switch (val) {
- case PerformanceMode::LATENCY:
- return "LATENCY";
- case PerformanceMode::THROUGHPUT:
- return "THROUGHPUT";
- case PerformanceMode::CUMULATIVE_THROUGHPUT:
- return "CUMULATIVE_THROUGHPUT";
- default:
- return "<UNKNOWN>";
- }
-}
-
-ov::hint::PerformanceMode intel_npu::PERFORMANCE_HINT::parse(std::string_view val) {
- if (val.empty()) {
- return ov::hint::PerformanceMode::LATENCY;
- } else if (val == "LATENCY") {
- return ov::hint::PerformanceMode::LATENCY;
- } else if (val == "THROUGHPUT") {
- return ov::hint::PerformanceMode::THROUGHPUT;
- } else if (val == "CUMULATIVE_THROUGHPUT") {
- return ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT;
- }
-
- OPENVINO_THROW("Value '", val, "' is not a valid PERFORMANCE_HINT option");
-}
-
-//
-// BATCH_MODE
-//
-
-ov::intel_npu::BatchMode intel_npu::BATCH_MODE::parse(std::string_view val) {
- if (val == "AUTO") {
- return ov::intel_npu::BatchMode::AUTO;
- } else if (val == "COMPILER") {
- return ov::intel_npu::BatchMode::COMPILER;
- } else if (val == "PLUGIN") {
- return ov::intel_npu::BatchMode::PLUGIN;
- }
-
- OPENVINO_THROW("Value '", val, "'is not a valid BATCH_MODE option");
-}
-
-std::string intel_npu::BATCH_MODE::toString(const ov::intel_npu::BatchMode& val) {
- std::stringstream strStream;
-
- strStream << val;
-
- return strStream.str();
-}
diff --git a/src/plugins/intel_npu/src/al/src/config/compiler.cpp b/src/plugins/intel_npu/src/al/src/config/compiler.cpp
deleted file mode 100644
index 1f55d752bbf..00000000000
--- a/src/plugins/intel_npu/src/al/src/config/compiler.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#include "intel_npu/config/compiler.hpp"
-
-using namespace intel_npu;
-using namespace ov::intel_npu;
-
-//
-// register
-//
-
-void intel_npu::registerCompilerOptions(OptionsDesc& desc) {
- desc.add<COMPILER_TYPE>();
- desc.add<COMPILATION_MODE>();
- desc.add<COMPILATION_MODE_PARAMS>();
- desc.add<BACKEND_COMPILATION_PARAMS>();
- desc.add<COMPILATION_NUM_THREADS>();
- desc.add<DPU_GROUPS>();
- desc.add<TILES>();
- desc.add<STEPPING>();
- desc.add<MAX_TILES>();
- desc.add<DMA_ENGINES>();
- desc.add<DYNAMIC_SHAPE_TO_STATIC>();
- desc.add<EXECUTION_MODE_HINT>();
- desc.add<COMPILER_DYNAMIC_QUANTIZATION>();
- desc.add<QDQ_OPTIMIZATION>();
- desc.add<BATCH_COMPILER_MODE_SETTINGS>();
-}
-
-//
-// COMPILER_TYPE
-//
-
-std::string_view ov::intel_npu::stringifyEnum(ov::intel_npu::CompilerType val) {
- switch (val) {
- case ov::intel_npu::CompilerType::MLIR:
- return "MLIR";
- case ov::intel_npu::CompilerType::DRIVER:
- return "DRIVER";
- default:
- return "<UNKNOWN>";
- }
-}
-
-std::string_view intel_npu::COMPILER_TYPE::envVar() {
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- return "IE_NPU_COMPILER_TYPE";
-#else
- return "";
-#endif
-}
-
-ov::intel_npu::CompilerType intel_npu::COMPILER_TYPE::defaultValue() {
- return ov::intel_npu::CompilerType::DRIVER;
-}
-
-ov::intel_npu::CompilerType intel_npu::COMPILER_TYPE::parse(std::string_view val) {
- if (val == stringifyEnum(ov::intel_npu::CompilerType::MLIR)) {
- return ov::intel_npu::CompilerType::MLIR;
- } else if (val == stringifyEnum(ov::intel_npu::CompilerType::DRIVER)) {
- return ov::intel_npu::CompilerType::DRIVER;
- }
-
- OPENVINO_THROW("Value '", val, "' is not a valid COMPILER_TYPE option");
-}
-
-std::string intel_npu::COMPILER_TYPE::toString(const ov::intel_npu::CompilerType& val) {
- std::stringstream strStream;
- if (val == ov::intel_npu::CompilerType::MLIR) {
- strStream << "MLIR";
- } else if (val == ov::intel_npu::CompilerType::DRIVER) {
- strStream << "DRIVER";
- } else {
- OPENVINO_THROW("No valid string for current LOG_LEVEL option");
- }
-
- return strStream.str();
-}
diff --git a/src/plugins/intel_npu/src/al/src/config/config.cpp b/src/plugins/intel_npu/src/al/src/config/config.cpp
index b9906b1af3e..8b39197b5c2 100644
--- a/src/plugins/intel_npu/src/al/src/config/config.cpp
+++ b/src/plugins/intel_npu/src/al/src/config/config.cpp
@@ -175,6 +175,23 @@ details::OptionConcept OptionsDesc::get(std::string_view key, OptionMode mode) c
return desc;
}
+void OptionsDesc::reset() {
+ _impl.clear();
+}
+
+bool OptionsDesc::has(std::string_view key) const {
+ std::string searchKey{key};
+ const auto itDeprecated = _deprecated.find(searchKey);
+ if (itDeprecated != _deprecated.end()) {
+ return true;
+ }
+ const auto itMain = _impl.find(searchKey);
+ if (itMain != _impl.end()) {
+ return true;
+ }
+ return false;
+}
+
std::vector<std::string> OptionsDesc::getSupported(bool includePrivate) const {
std::vector<std::string> res;
res.reserve(_impl.size());
@@ -188,6 +205,32 @@ std::vector<std::string> OptionsDesc::getSupported(bool includePrivate) const {
return res;
}
+std::vector<ov::PropertyName> OptionsDesc::getSupportedOptions(bool includePrivate) const {
+ std::vector<ov::PropertyName> res;
+ res.reserve(_impl.size());
+
+ for (const auto& p : _impl) {
+ if (p.second.isPublic() || includePrivate) {
+ res.push_back({p.first, p.second.mutability()});
+ }
+ }
+
+ return res;
+}
+
+std::string OptionsDesc::getSupportedAsString(bool includePrivate) const {
+ std::string res;
+
+ for (const auto& p : _impl) {
+ if (p.second.isPublic() || includePrivate) {
+ res += p.first;
+ res += " ";
+ }
+ }
+
+ return res;
+}
+
void OptionsDesc::walk(std::function<void(const details::OptionConcept&)> cb) const {
for (const auto& itr : _impl) {
cb(itr.second);
@@ -219,6 +262,10 @@ void Config::parseEnvVars() {
});
}
+bool Config::has(std::string key) const {
+ return _impl.count(key) != 0;
+}
+
void Config::update(const ConfigMap& options, OptionMode mode) {
auto log = Logger::global().clone("Config");
@@ -227,6 +274,7 @@ void Config::update(const ConfigMap& options, OptionMode mode) {
const auto opt = _desc->get(p.first, mode);
_impl[opt.key().data()] = opt.validateAndParse(p.second);
+ OPENVINO_ASSERT("[ NOT_FOUND ] Option '", p.first.c_str(), "' is not supported for current configuration");
}
}
@@ -235,6 +283,7 @@ std::string Config::toString() const {
for (auto it = _impl.cbegin(); it != _impl.cend(); ++it) {
const auto& key = it->first;
+ // include only enabled configs
resultStream << key << "=\"" << it->second->toString() << "\"";
if (std::next(it) != _impl.end()) {
resultStream << " ";
diff --git a/src/plugins/intel_npu/src/al/src/config/runtime.cpp b/src/plugins/intel_npu/src/al/src/config/runtime.cpp
deleted file mode 100644
index 63913142503..00000000000
--- a/src/plugins/intel_npu/src/al/src/config/runtime.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (C) 2018-2025 Intel Corporation
-// SPDX-License-Identifier: Apache-2.0
-//
-
-#include "intel_npu/config/runtime.hpp"
-
-#include <sstream>
-
-#include "intel_npu/config/common.hpp"
-#include "openvino/runtime/properties.hpp"
-
-using namespace intel_npu;
-using namespace ov::intel_npu;
-
-//
-// register
-//
-
-void intel_npu::registerRunTimeOptions(OptionsDesc& desc) {
- desc.add<EXCLUSIVE_ASYNC_REQUESTS>();
- desc.add<PROFILING_TYPE>();
- desc.add<MODEL_PRIORITY>();
- desc.add<CREATE_EXECUTOR>();
- desc.add<DEFER_WEIGHTS_LOAD>();
- desc.add<NUM_STREAMS>();
- desc.add<ENABLE_CPU_PINNING>();
- desc.add<WORKLOAD_TYPE>();
- desc.add<TURBO>();
- desc.add<WEIGHTS_PATH>();
- desc.add<MODEL_PTR>();
- desc.add<BYPASS_UMD_CACHING>();
- desc.add<RUN_INFERENCES_SEQUENTIALLY>();
- desc.add<DISABLE_VERSION_CHECK>();
-}
-
-// Heuristically obtained number. Varies depending on the values of PLATFORM and PERFORMANCE_HINT
-// Note: this is the value provided by the plugin, application should query and consider it, but may supply its own
-// preference for number of parallel requests via dedicated configuration
-int64_t intel_npu::getOptimalNumberOfInferRequestsInParallel(const Config& config) {
- const std::string platform = ov::intel_npu::Platform::standardize(config.get<PLATFORM>());
-
- if (platform == ov::intel_npu::Platform::NPU3720) {
- if (config.get<PERFORMANCE_HINT>() == ov::hint::PerformanceMode::THROUGHPUT) {
- return 4;
- } else {
- return 1;
- }
- } else {
- if (config.get<PERFORMANCE_HINT>() == ov::hint::PerformanceMode::THROUGHPUT) {
- return 8;
- } else {
- return 1;
- }
- }
-}
-
-//
-// PROFILING_TYPE
-//
-
-std::string_view ov::intel_npu::stringifyEnum(ov::intel_npu::ProfilingType val) {
- switch (val) {
- case ov::intel_npu::ProfilingType::MODEL:
- return "MODEL";
- case ov::intel_npu::ProfilingType::INFER:
- return "INFER";
- default:
- return "<UNKNOWN>";
- }
-}
-
-ov::intel_npu::ProfilingType intel_npu::PROFILING_TYPE::parse(std::string_view val) {
- const auto extractProfilingString = [](ov::intel_npu::ProfilingType prof) -> std::string {
- return profiling_type(prof).second.as<std::string>();
- };
-
- if (val == extractProfilingString(ov::intel_npu::ProfilingType::MODEL)) {
- return ov::intel_npu::ProfilingType::MODEL;
- } else if (val == extractProfilingString(ov::intel_npu::ProfilingType::INFER)) {
- return ov::intel_npu::ProfilingType::INFER;
- }
-
- OPENVINO_THROW("Value '", val, "' is not a valid PROFILING_TYPE option");
-}
-
-std::string intel_npu::PROFILING_TYPE::toString(const ov::intel_npu::ProfilingType& val) {
- std::stringstream strStream;
- if (val == ov::intel_npu::ProfilingType::MODEL) {
- strStream << "MODEL";
- } else if (val == ov::intel_npu::ProfilingType::INFER) {
- strStream << "INFER";
- } else {
- OPENVINO_THROW("No valid string for current PROFILING_TYPE option");
- }
-
- return strStream.str();
-}
-
-//
-// MODEL_PRIORITY
-//
-
-ov::hint::Priority intel_npu::MODEL_PRIORITY::parse(std::string_view val) {
- std::istringstream stringStream = std::istringstream(std::string(val));
- ov::hint::Priority priority;
-
- stringStream >> priority;
-
- return priority;
-}
-
-std::string intel_npu::MODEL_PRIORITY::toString(const ov::hint::Priority& val) {
- std::ostringstream stringStream;
-
- stringStream << val;
-
- return stringStream.str();
-}
-
-//
-// NUM_STREAMS
-//
-
-const ov::streams::Num intel_npu::NUM_STREAMS::defVal = ov::streams::Num(1);
-
-ov::streams::Num intel_npu::NUM_STREAMS::parse(std::string_view val) {
- std::istringstream stringStream = std::istringstream(std::string(val));
- ov::streams::Num numberOfStreams;
-
- stringStream >> numberOfStreams;
-
- return numberOfStreams;
-}
-
-std::string intel_npu::NUM_STREAMS::toString(const ov::streams::Num& val) {
- std::ostringstream stringStream;
-
- stringStream << val;
-
- return stringStream.str();
-}
-
-//
-// WORKLOAD_TYPE
-//
-
-ov::WorkloadType intel_npu::WORKLOAD_TYPE::parse(std::string_view val) {
- std::istringstream ss = std::istringstream(std::string(val));
- ov::WorkloadType workloadType;
-
- ss >> workloadType;
-
- return workloadType;
-}
-
-std::string intel_npu::WORKLOAD_TYPE::toString(const ov::WorkloadType& val) {
- std::ostringstream ss;
- ss << val;
- return ss.str();
-}
diff --git a/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp b/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp
index 85b62c492ef..7a040178020 100644
--- a/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp
+++ b/src/plugins/intel_npu/src/backend/include/zero_profiling.hpp
@@ -11,7 +11,7 @@
#include <map>
#include "intel_npu/common/igraph.hpp"
-#include "intel_npu/config/compiler.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "intel_npu/utils/zero/zero_init.hpp"
#include "intel_npu/utils/zero/zero_types.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
index 7b8c7957a61..6cb10003389 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_backend.cpp
@@ -6,7 +6,7 @@
#include <vector>
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "zero_device.hpp"
namespace intel_npu {
diff --git a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp
index a4911907b67..550ceb60462 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_infer_request.cpp
@@ -5,9 +5,7 @@
#include "zero_infer_request.hpp"
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/compiler.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/prefix.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
#include "openvino/op/util/op_types.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp
index 1cc0a425e0f..cd16bcf466d 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_pipeline.cpp
@@ -8,7 +8,7 @@
#include <ze_graph_ext.h>
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/prefix.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp
index f1f19f02256..8af9c071f38 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_profiling.cpp
@@ -6,7 +6,7 @@
#include <ze_graph_profiling_ext.h>
-#include "intel_npu/config/compiler.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/profiling.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
#include "intel_npu/utils/zero/zero_utils.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp
index 5fb00585b1c..4fa149d28f6 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_remote_tensor.cpp
@@ -6,7 +6,7 @@
#include <ze_api.h>
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
#include "intel_npu/utils/zero/zero_utils.hpp"
#include "openvino/core/type/element_iterator.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
index ae84ce4201c..4697b2521d0 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_tensor.cpp
@@ -4,7 +4,7 @@
#include "zero_tensor.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "openvino/core/type/element_iterator.hpp"
#include "openvino/runtime/properties.hpp"
#include "openvino/runtime/tensor.hpp"
diff --git a/src/plugins/intel_npu/src/backend/src/zero_variable_state.cpp b/src/plugins/intel_npu/src/backend/src/zero_variable_state.cpp
index a3437c64ce9..44f0767c5d5 100644
--- a/src/plugins/intel_npu/src/backend/src/zero_variable_state.cpp
+++ b/src/plugins/intel_npu/src/backend/src/zero_variable_state.cpp
@@ -4,7 +4,7 @@
#include "zero_variable_state.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/zero/zero_utils.hpp"
#include "zero_remote_tensor.hpp"
diff --git a/src/plugins/intel_npu/src/common/include/intel_npu/common/filtered_config.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/filtered_config.hpp
new file mode 100644
index 00000000000..6bb3d04b098
--- /dev/null
+++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/filtered_config.hpp
@@ -0,0 +1,124 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+// Plugin Config Engine
+
+#pragma once
+
+#include "intel_npu/config/config.hpp"
+
+namespace intel_npu {
+
+/**
+ * @class FilteredConfig
+ * @brief A derived configuration class that extends the base `Config` class with filtering capabilities.
+ *
+ * This class provides additional functionality to manage and filter configuration options,
+ * including enabling/disabling specific options, managing internal configurations, and
+ * generating filtered configuration strings for compiler-specific needs.
+ */
+class FilteredConfig final : public Config {
+public:
+ using EnableMap =
+ std::unordered_map<std::string, bool>; ///< Map to track enabled/disabled state of configuration keys.
+
+ /**
+ * @brief Constructs a `FilteredConfig` object with a given options descriptor.
+ * @param desc Shared pointer to an `OptionsDesc` object that describes available options.
+ */
+ explicit FilteredConfig(const std::shared_ptr<const OptionsDesc>& desc) : Config(desc) {}
+
+ /**
+ * @brief Updates the configuration with new options if the key is enabled state
+ * @param options A map of key-value pairs representing the new configuration options.
+ * @param mode Specifies the mode in which the options should be updated (default is `OptionMode::Both`).
+ */
+ void update(const ConfigMap& options, OptionMode mode = OptionMode::Both) override;
+
+ /**
+ * @brief Checks if a specific option exists in the configuration's descriptorDesc.
+ * @param key The key of the option to check.
+ * @return True if the option exists, false otherwise.
+ */
+ bool hasOpt(std::string_view key) const;
+
+ /**
+ * @brief Checks if a specific option is public (publishable in supported_properties).
+ * @param key The key of the option to check.
+ * @return True if the option is public, false otherwise.
+ */
+ bool isOptPublic(std::string_view key) const;
+
+ /**
+ * @brief Retrieves the OptionBase concept associated with a specific option. Used to check option details.
+ * @param key The key of the option to retrieve.
+ * @return The `OptionConcept` object representing the option's details.
+ */
+ details::OptionConcept getOpt(std::string_view key) const;
+
+ /**
+ * @brief Checks if a specific option is available (enabled and valid).
+ * @param key The key of the option to check.
+ * @return True if the option is available, false otherwise.
+ */
+ bool isAvailable(std::string key) const;
+
+ /**
+ * @brief Enables or disables a specific configuration option.
+ * @param key The key of the option to enable/disable.
+ * @param enable True to enable the option, false to disable it.
+ */
+ void enable(std::string key, bool enable);
+
+ /**
+ * @brief Enables all available configuration options.
+ */
+ void enableAll();
+
+ /**
+ * @brief Iterates over all enabled options and applies a callback function to each enabled key.
+ * @param cb A callback function that takes a string (key) as input and performs an operation on it.
+ */
+ void walkEnables(std::function<void(const std::string&)> cb) const;
+
+ /**
+ * @brief Adds or updates an internal configuration value for compiler-specific needs.
+ * @param key The key of the internal configuration to add or update.
+ * @param value The value to set for the internal configuration.
+ */
+ void addOrUpdateInternal(std::string key, std::string value);
+
+ /**
+ * @brief Retrieves an internal configuration value by its key.
+ * @param key The key of the internal configuration to retrieve.
+ * @return The value associated with the specified internal configuration key.
+ */
+ std::string getInternal(std::string key) const;
+
+ /**
+ * @brief Generates a string representation of all internal configurations for compiler use.
+ * @return A string containing all internal configurations formatted for compiler use.
+ */
+ std::string toStringForCompilerInternal() const;
+
+ /**
+ * @brief Iterates over all internal configurations and applies a callback function to each entry's key.
+ * @param cb A callback function that takes a string (key) as input and performs an operation on it.
+ */
+ void walkInternals(std::function<void(const std::string&)> cb) const;
+
+ /**
+ * @brief Generates a string representation of all config keys with set values
+ * that are relevant for compilation (`OptionMode::Compile` or `OptionMode::Both`).
+ * @return A string containing filtered configuration keys formatted for compiler use.
+ */
+ std::string toStringForCompiler() const;
+
+private:
+ EnableMap _enabled; ///< Map to track whether specific configuration keys are enabled or disabled.
+
+ ConfigMap _internal_compiler_configs; ///< Map to store internal (hidden) configurations used for compiler.
+};
+
+} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp
index 5a25e9e4ed7..0a746ec4553 100644
--- a/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp
+++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiled_model.hpp
@@ -8,7 +8,7 @@
#include <vector>
#include "intel_npu/common/igraph.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "openvino/runtime/icompiled_model.hpp"
namespace intel_npu {
diff --git a/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiler_adapter.hpp b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiler_adapter.hpp
index a86d942627c..a65a75d79db 100644
--- a/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiler_adapter.hpp
+++ b/src/plugins/intel_npu/src/common/include/intel_npu/common/icompiler_adapter.hpp
@@ -15,6 +15,8 @@ public:
virtual std::shared_ptr<IGraph> parse(std::unique_ptr<BlobContainer> blobPtr, const Config& config) const = 0;
virtual ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const = 0;
virtual uint32_t get_version() const = 0;
+ virtual std::vector<std::string> get_supported_options() const = 0;
+ virtual bool is_option_supported(std::string optname) const = 0;
virtual ~ICompilerAdapter() = default;
};
diff --git a/src/plugins/intel_npu/src/common/src/filtered_config.cpp b/src/plugins/intel_npu/src/common/src/filtered_config.cpp
new file mode 100644
index 00000000000..4ec6b9e9105
--- /dev/null
+++ b/src/plugins/intel_npu/src/common/src/filtered_config.cpp
@@ -0,0 +1,124 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#include "intel_npu/common/filtered_config.hpp"
+
+namespace intel_npu {
+
+bool FilteredConfig::hasOpt(std::string_view key) const {
+ return _desc->has(key);
+}
+
+details::OptionConcept FilteredConfig::getOpt(std::string_view key) const {
+ return _desc->get(key);
+}
+
+bool FilteredConfig::isOptPublic(std::string_view key) const {
+ auto log = Logger::global().clone("Config");
+ if (_desc->has(key)) {
+ return _desc->get(key).isPublic();
+ } else {
+ log.warning("Option '%s' not registered in config", key.data());
+ return true;
+ }
+}
+
+void FilteredConfig::update(const ConfigMap& options, OptionMode mode) {
+ auto log = Logger::global().clone("Config");
+
+ for (const auto& p : options) {
+ log.trace("Update option '%s' to value '%s'", p.first.c_str(), p.second.c_str());
+
+ if (isAvailable(p.first)) {
+ const auto opt = _desc->get(p.first, mode);
+ _impl[opt.key().data()] = opt.validateAndParse(p.second);
+ } else {
+ OPENVINO_ASSERT("[ NOT_FOUND ] Option '", p.first.c_str(), "' is not supported for current configuration");
+ }
+ }
+}
+
+bool FilteredConfig::isAvailable(std::string key) const {
+ auto it = _enabled.find(key);
+ if (it != _enabled.end() && hasOpt(key)) {
+ return it->second;
+ }
+ // if doesnt exist = not available
+ return false;
+}
+
+void FilteredConfig::enable(std::string key, bool enabled) {
+ // we insert for all cases - no need to check if exists
+ _enabled[key] = enabled;
+}
+
+void FilteredConfig::enableAll() {
+ _desc->walk([&](const details::OptionConcept& opt) {
+ enable(opt.key().data(), true);
+ });
+}
+
+void FilteredConfig::walkEnables(std::function<void(const std::string&)> cb) const {
+ for (const auto& itr : _enabled) {
+ cb(itr.first);
+ }
+}
+
+void FilteredConfig::walkInternals(std::function<void(const std::string&)> cb) const {
+ for (const auto& itr : _internal_compiler_configs) {
+ cb(itr.first);
+ }
+}
+
+void FilteredConfig::addOrUpdateInternal(std::string key, std::string value) {
+ auto log = Logger::global().clone("Config");
+ if (_internal_compiler_configs.count(key) != 0) {
+ log.warning("Internal compiler option '%s' was already registered! Updating value only!", key.c_str());
+ _internal_compiler_configs.at(key) = value;
+ } else {
+ // manual insert
+ _internal_compiler_configs.insert(std::make_pair(key, value)); // insert new
+ }
+}
+
+std::string FilteredConfig::getInternal(std::string key) const {
+ auto log = Logger::global().clone("Config");
+ if (_internal_compiler_configs.count(key) == 0) {
+ OPENVINO_THROW(std::string("Internal compiler option " + key + " does not exist! "));
+ }
+ return _internal_compiler_configs.at(key);
+}
+
+std::string FilteredConfig::toStringForCompilerInternal() const {
+ std::stringstream resultStream;
+
+ for (auto it = _internal_compiler_configs.cbegin(); it != _internal_compiler_configs.cend(); ++it) {
+ resultStream << it->first << "=\"" << it->second << "\"";
+ }
+
+ return resultStream.str();
+}
+
+std::string FilteredConfig::toStringForCompiler() const {
+ std::stringstream resultStream;
+ for (auto it = _impl.cbegin(); it != _impl.cend(); ++it) {
+ const auto& key = it->first;
+
+ // Only include available configs which options have OptionMode::Compile or OptionMode::Both
+ if (isAvailable(key)) {
+ if (_desc->has(key)) {
+ if (_desc->get(key).mode() != OptionMode::RunTime) {
+ resultStream << key << "=\"" << it->second->toString() << "\"";
+ if (std::next(it) != _impl.end()) {
+ resultStream << " ";
+ }
+ }
+ }
+ }
+ }
+
+ return resultStream.str();
+}
+
+} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/common/src/igraph.cpp b/src/plugins/intel_npu/src/common/src/igraph.cpp
index 9dc21c796d7..f775a653af8 100644
--- a/src/plugins/intel_npu/src/common/src/igraph.cpp
+++ b/src/plugins/intel_npu/src/common/src/igraph.cpp
@@ -4,8 +4,7 @@
#include "intel_npu/common/igraph.hpp"
-#include "intel_npu/config/compiler.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
namespace {
constexpr std::size_t BATCH_AXIS = 0;
diff --git a/src/plugins/intel_npu/src/common/src/remote_tensor.cpp b/src/plugins/intel_npu/src/common/src/remote_tensor.cpp
index ce82a4fa106..2f6134f1a62 100644
--- a/src/plugins/intel_npu/src/common/src/remote_tensor.cpp
+++ b/src/plugins/intel_npu/src/common/src/remote_tensor.cpp
@@ -4,7 +4,7 @@
#include "intel_npu/common/remote_tensor.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "openvino/core/type/element_iterator.hpp"
#include "openvino/runtime/intel_npu/remote_properties.hpp"
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp
index a23ba2b5990..a0412f53c84 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/include/compiler_adapter_factory.hpp
@@ -6,18 +6,17 @@
#include "driver_compiler_adapter.hpp"
#include "intel_npu/common/icompiler_adapter.hpp"
-#include "intel_npu/config/compiler.hpp"
#include "intel_npu/config/config.hpp"
+#include "intel_npu/config/options.hpp"
#include "plugin_compiler_adapter.hpp"
namespace intel_npu {
class CompilerAdapterFactory final {
public:
- const std::unique_ptr<ICompilerAdapter> getCompiler(const ov::SoPtr<IEngineBackend>& engineBackend,
- const Config& config) const {
- auto compilerType = config.get<COMPILER_TYPE>();
- switch (compilerType) {
+ std::unique_ptr<ICompilerAdapter> getCompiler(const ov::SoPtr<IEngineBackend>& engineBackend,
+ const ov::intel_npu::CompilerType type) const {
+ switch (type) {
case ov::intel_npu::CompilerType::MLIR: {
if (engineBackend == nullptr || engineBackend->getName() != "LEVEL0") {
return std::make_unique<PluginCompilerAdapter>(nullptr);
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp
index daf401100e6..311afca860f 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/include/driver_compiler_adapter.hpp
@@ -27,6 +27,10 @@ public:
ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const override;
+ std::vector<std::string> get_supported_options() const override;
+
+ bool is_option_supported(std::string optname) const override;
+
uint32_t get_version() const override;
private:
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/plugin_compiler_adapter.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/plugin_compiler_adapter.hpp
index c60b80bcfaa..742286a8778 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/include/plugin_compiler_adapter.hpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/include/plugin_compiler_adapter.hpp
@@ -25,6 +25,10 @@ public:
ov::SupportedOpsMap query(const std::shared_ptr<const ov::Model>& model, const Config& config) const override;
+ std::vector<std::string> get_supported_options() const override;
+
+ bool is_option_supported(std::string optname) const override;
+
uint32_t get_version() const override;
private:
diff --git a/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp b/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp
index 8b93a890425..2fab7aadd53 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/include/ze_graph_ext_wrappers.hpp
@@ -41,6 +41,10 @@ public:
_ze_result_t destroyGraph(ze_graph_handle_t graphHandle);
+ std::string getCompilerSupportedOptions() const;
+
+ bool isOptionSupported(std::string optname) const;
+
void getGraphBinary(ze_graph_handle_t graphHandle,
std::vector<uint8_t>& blob,
const uint8_t*& blobPtr,
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
index 56e4a4d639b..be3fb4052f9 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/driver_compiler_adapter.cpp
@@ -8,10 +8,9 @@
#include <string_view>
#include "driver_graph.hpp"
+#include "intel_npu/common/filtered_config.hpp"
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/compiler.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/prefix.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
@@ -409,7 +408,16 @@ std::string DriverCompilerAdapter::serializeConfig(const Config& config,
ze_graph_compiler_version_info_t compilerVersion) const {
Logger logger("serializeConfig", Logger::global().level());
- std::string content = config.toString();
+ std::string content = {};
+
+ const FilteredConfig* plgConfig = dynamic_cast<const FilteredConfig*>(&config);
+ if (plgConfig != nullptr) {
+ content += plgConfig->toStringForCompiler();
+ content += plgConfig->toStringForCompilerInternal();
+ } else {
+ logger.warning("Failed to cast Config to FilteredConfig. Exporting all configs");
+ content += config.toString();
+ }
logger.debug("Original content of config: %s", content.c_str());
@@ -480,117 +488,8 @@ std::string DriverCompilerAdapter::serializeConfig(const Config& config,
content = std::regex_replace(content,
getTargetRegex(ov::hint::Priority::HIGH),
getStringReplacement(ov::intel_npu::LegacyPriority::HIGH));
-
- // Removing cpu_pinning from the command string
- std::ostringstream pinningstr;
- pinningstr << ov::hint::enable_cpu_pinning.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning(
- "ENABLE_CPU_PINNING property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(pinningstr.str()), "");
- }
-
- /// Stepping and max_tiles are not supported in versions < 5.3 - need to remove it
- if ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 3)) {
- std::ostringstream stepstr;
- stepstr << ov::intel_npu::stepping.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\d+"
- << VALUE_DELIMITER;
- std::ostringstream maxtilestr;
- maxtilestr << ov::intel_npu::max_tiles.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\d+"
- << VALUE_DELIMITER;
- logger.warning("NPU_STEPPING property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(stepstr.str()), "");
- logger.warning("NPU_MAX_TILES property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(maxtilestr.str()), "");
- }
-
- /// Removing INFERENCE_PRECISION_HINT for older compilers
- if ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 4)) {
- std::ostringstream precstr;
- precstr << ov::hint::inference_precision.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning(
- "INFERENCE_PRECISION_HINT property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(precstr.str()), "");
- }
-
- /// Replacing NPU_TILES (for all versions) with NPU_DPU_GROUPS for backwards compatibility
- if (std::regex_search(content, std::regex(ov::intel_npu::tiles.name()))) {
- logger.warning("NPU_TILES property is not supported by this compiler version. Swaping it to "
- "NPU_DPU_GROUPS (obsolete)");
- content = std::regex_replace(content, std::regex(ov::intel_npu::tiles.name()), "NPU_DPU_GROUPS");
- }
-
- // Batch mode property is not supported in versions < 5.5 - need to remove it
- if ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 5)) {
- std::ostringstream batchstr;
- batchstr << ov::intel_npu::batch_mode.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
-
- logger.warning("NPU_BATCH_MODE property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(batchstr.str()), "");
- }
-
- // EXECUTION_MODE_HINT is not supported in versions < 5.6 - need to remove it
- if ((compilerVersion.major < 5) || (compilerVersion.major == 5 && compilerVersion.minor < 6)) {
- std::ostringstream batchstr;
- batchstr << ov::hint::execution_mode.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning(
- "EXECUTION_MODE_HINT property is not supported by this compiler version. Removing from parameters");
- content = std::regex_replace(content, std::regex(batchstr.str()), "");
- }
-
- // COMPILER_DYNAMIC_QUANTIZATION is not supported in versions < 7.1 - need to remove it
- if ((compilerVersion.major < 7) || (compilerVersion.major == 7 && compilerVersion.minor < 1)) {
- std::ostringstream dqstr;
- dqstr << ov::intel_npu::compiler_dynamic_quantization.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning(
- "COMPILER_DYNAMIC_QUANTIZATION property is not supported by this compiler version. Removing from "
- "parameters");
- content = std::regex_replace(content, std::regex(dqstr.str()), "");
- }
-
- // QDQ_OPTIMIZATION is not supported in versions < 7.20 - need to remove it
- if ((compilerVersion.major < 7) || (compilerVersion.major == 7 && compilerVersion.minor < 20)) {
- std::ostringstream qdqstr;
- qdqstr << ov::intel_npu::qdq_optimization.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning("NPU_QDQ_OPTIMIZATION property is not supported by this compiler version. Removing from "
- "parameters");
- content = std::regex_replace(content, std::regex(qdqstr.str()), "");
- }
-
- // BATCH_COMPILER_MODE_SETTINGS is not supported in versions < 7.4 - need to remove it
- if ((compilerVersion.major < 7) || (compilerVersion.major == 7 && compilerVersion.minor < 4)) {
- std::ostringstream dqstr;
- dqstr << ov::intel_npu::batch_compiler_mode_settings.name() << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+"
- << VALUE_DELIMITER;
- logger.warning("BATCH_COMPILER_MODE_SETTINGS property is not supported by this compiler version. Removing from "
- "parameters");
- content = std::regex_replace(content, std::regex(dqstr.str()), "");
}
- // Remove properties that are not used by the compiler
- auto remove_unused_property = [&](const char* property_name) {
- std::ostringstream propertystream;
- propertystream << property_name << KEY_VALUE_SEPARATOR << VALUE_DELIMITER << "\\S+" << VALUE_DELIMITER;
- std::string log(property_name);
- log.append(" property is needed at runtime only. Removing from parameters");
- logger.info(log.c_str());
- content = std::regex_replace(content, std::regex(propertystream.str()), "");
- };
-
- remove_unused_property(ov::intel_npu::defer_weights_load.name());
- remove_unused_property(ov::intel_npu::run_inferences_sequentially.name());
- remove_unused_property(ov::workload_type.name());
- remove_unused_property(ov::intel_npu::turbo.name());
- remove_unused_property(ov::weights_path.name());
- remove_unused_property(ov::hint::model.name());
- remove_unused_property(ov::intel_npu::bypass_umd_caching.name());
- remove_unused_property(ov::intel_npu::disable_version_check.name());
-
// FINAL step to convert prefixes of remaining params, to ensure backwards compatibility
// From 5.0.0, driver compiler start to use NPU_ prefix, the old version uses VPU_ prefix
if (compilerVersion.major < 5) {
@@ -607,4 +506,21 @@ std::string DriverCompilerAdapter::serializeConfig(const Config& config,
return "--config " + content;
}
+std::vector<std::string> DriverCompilerAdapter::get_supported_options() const {
+ std::string compilerOptionsStr;
+ compilerOptionsStr = _zeGraphExt->getCompilerSupportedOptions();
+ // vectorize string
+ std::istringstream suppstream(compilerOptionsStr);
+ std::vector<std::string> compilerOpts;
+ std::string option;
+ while (suppstream >> option) {
+ compilerOpts.push_back(option);
+ }
+ return compilerOpts;
+}
+
+bool DriverCompilerAdapter::is_option_supported(std::string optname) const {
+ return _zeGraphExt->isOptionSupported(optname);
+}
+
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/driver_graph.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/driver_graph.cpp
index 0c36e1b56ee..fbcb73682be 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/driver_graph.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/driver_graph.cpp
@@ -4,8 +4,7 @@
#include "driver_graph.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
namespace intel_npu {
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp
index 809e1c88e05..44cdf882344 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp
@@ -9,7 +9,7 @@
#include "intel_npu/common/device_helpers.hpp"
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/compiler.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
@@ -142,7 +142,20 @@ ov::SupportedOpsMap PluginCompilerAdapter::query(const std::shared_ptr<const ov:
}
uint32_t PluginCompilerAdapter::get_version() const {
+ // returning max val as PluginCompiler supports all features and options the plugin is aware of
return _compiler->get_version();
}
+std::vector<std::string> PluginCompilerAdapter::get_supported_options() const {
+ // PluginCompiler has all the same options as plugin
+ // Returing empty string to let the plugin fallback to legacy registration
+ return {};
+}
+
+bool PluginCompilerAdapter::is_option_supported(std::string optname) const {
+ // This functions has no utility in PluginCompiler
+ // returning false for any request to avoid the option of spaming the plugin
+ return false;
+}
+
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp
index b2bf01464b4..1a1e1e70e7a 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/plugin_graph.cpp
@@ -4,8 +4,7 @@
#include "plugin_graph.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
namespace intel_npu {
diff --git a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
index 6e9249a55f8..b62eb3f05c8 100644
--- a/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
+++ b/src/plugins/intel_npu/src/compiler_adapter/src/ze_graph_ext_wrappers.cpp
@@ -7,7 +7,7 @@
#include <regex>
#include <string_view>
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/prefix.hpp"
#include "intel_npu/utils/zero/zero_api.hpp"
#include "intel_npu/utils/zero/zero_result.hpp"
@@ -520,4 +520,73 @@ NetworkMetadata ZeGraphExtWrappers::getNetworkMeta(ze_graph_handle_t graphHandle
return meta;
}
+std::string ZeGraphExtWrappers::getCompilerSupportedOptions() const {
+ // Early exit if api is not supported
+ if (_graphExtVersion < ZE_MAKE_VERSION(1, 11)) {
+ return {};
+ }
+ // 1. ask driver for size of compiler supported options list
+ _logger.debug("pfnCompilerGetSupportedOptions - obtain string size");
+ size_t str_size = 0;
+ auto result = _zeroInitStruct->getGraphDdiTable().pfnCompilerGetSupportedOptions(_zeroInitStruct->getDevice(),
+ ZE_NPU_COMPILER_OPTIONS,
+ &str_size,
+ nullptr);
+ if (result == ZE_RESULT_SUCCESS) {
+ if (str_size > 0) {
+ _logger.debug("pfnCompilerGetSupportedOptions - obtain list");
+ // 2. allocate buffer for it
+ std::vector<char> sup_options_chr(str_size);
+ // 3. ask driver to populate char list
+ auto result =
+ _zeroInitStruct->getGraphDdiTable().pfnCompilerGetSupportedOptions(_zeroInitStruct->getDevice(),
+ ZE_NPU_COMPILER_OPTIONS,
+ &str_size,
+ sup_options_chr.data());
+ if (result == ZE_RESULT_SUCCESS) {
+ // convert received buff to string
+ std::string supported_options_list_str(sup_options_chr.data());
+ // cleanup
+ return supported_options_list_str;
+ } else if (result == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) {
+ // cleanup
+ return {};
+ } else {
+ // cleanup
+ THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnCompilerGetSupportedOptions",
+ result,
+ _zeroInitStruct->getGraphDdiTable())
+ }
+ }
+ } else if ((result == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) || (result == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE)) {
+ return {};
+ } else {
+ THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnCompilerGetSupportedOptions", result, _zeroInitStruct->getGraphDdiTable())
+ }
+
+ _logger.debug("pfnCompilerGetSupportedOptions - list size 0 - skipping!");
+ return {};
+}
+
+bool ZeGraphExtWrappers::isOptionSupported(std::string optname) const {
+ // Early exit if api is not supported
+ if (_graphExtVersion < ZE_MAKE_VERSION(1, 11)) {
+ return false;
+ }
+ const char* optname_ch = optname.c_str();
+ auto result = _zeroInitStruct->getGraphDdiTable().pfnCompilerIsOptionSupported(_zeroInitStruct->getDevice(),
+ ZE_NPU_COMPILER_OPTIONS,
+ optname_ch,
+ nullptr);
+ if (result == ZE_RESULT_SUCCESS) {
+ return true;
+ } else if ((result == ZE_RESULT_ERROR_UNSUPPORTED_FEATURE) || (result == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE) ||
+ (result == ZE_RESULT_ERROR_UNKNOWN)) {
+ return false;
+ } else {
+ THROW_ON_FAIL_FOR_LEVELZERO_EXT("pfnCompilerIsOptionSupported", result, _zeroInitStruct->getGraphDdiTable());
+ }
+ return false;
+}
+
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp b/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp
index 9986509eb39..afde2e31bf9 100644
--- a/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp
+++ b/src/plugins/intel_npu/src/plugin/include/compiled_model.hpp
@@ -10,6 +10,7 @@
#include "intel_npu/common/npu.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "openvino/runtime/so_ptr.hpp"
+#include "properties.hpp"
namespace intel_npu {
@@ -32,7 +33,7 @@ public:
const std::shared_ptr<const ov::IPlugin>& plugin,
const std::shared_ptr<IDevice>& device,
const std::shared_ptr<IGraph>& graph,
- const Config& config);
+ const FilteredConfig& config);
CompiledModel(const CompiledModel&) = delete;
@@ -54,21 +55,17 @@ public:
const std::shared_ptr<IGraph>& get_graph() const override;
- const Config& get_config() const override;
+ const FilteredConfig& get_config() const override;
private:
- void initialize_properties();
-
void configure_stream_executors();
- Config _config;
+ FilteredConfig _config;
Logger _logger;
const std::shared_ptr<IDevice> _device;
std::shared_ptr<ov::threading::ITaskExecutor> _resultExecutor;
- // properties map: {name -> [supported, mutable, eval function]}
- std::map<std::string, std::tuple<bool, ov::PropertyMutability, std::function<ov::Any(const Config&)>>> _properties;
- std::vector<ov::PropertyName> _supportedProperties;
+ std::unique_ptr<Properties> _properties;
std::shared_ptr<IGraph> _graph;
};
diff --git a/src/plugins/intel_npu/src/plugin/include/metrics.hpp b/src/plugins/intel_npu/src/plugin/include/metrics.hpp
index 8837f9021d7..b1b6e8266e8 100644
--- a/src/plugins/intel_npu/src/plugin/include/metrics.hpp
+++ b/src/plugins/intel_npu/src/plugin/include/metrics.hpp
@@ -40,9 +40,7 @@ public:
ov::device::PCIInfo GetPciInfo(const std::string& specifiedDeviceName) const;
std::map<ov::element::Type, float> GetGops(const std::string& specifiedDeviceName) const;
ov::device::Type GetDeviceType(const std::string& specifiedDeviceName) const;
-
- std::vector<ov::PropertyName> GetCachingProperties() const;
- std::vector<ov::PropertyName> GetInternalSupportedProperties() const;
+ bool IsCommandQueueExtSupported() const;
~Metrics() = default;
@@ -55,20 +53,6 @@ private:
ov::device::capability::INT8,
ov::device::capability::EXPORT_IMPORT,
};
- const std::vector<ov::PropertyName> _cachingProperties = {ov::device::architecture.name(),
- ov::intel_npu::compilation_mode_params.name(),
- ov::intel_npu::compiler_dynamic_quantization.name(),
- ov::intel_npu::tiles.name(),
- ov::intel_npu::dpu_groups.name(),
- ov::intel_npu::dma_engines.name(),
- ov::intel_npu::compilation_mode.name(),
- ov::intel_npu::driver_version.name(),
- ov::intel_npu::compiler_type.name(),
- ov::intel_npu::batch_mode.name(),
- ov::hint::execution_mode.name()};
-
- const std::vector<ov::PropertyName> _internalSupportedProperties = {ov::internal::caching_properties.name(),
- ov::internal::caching_with_mmap.name()};
// Metric to provide a hint for a range for number of async infer requests. (bottom bound, upper bound, step)
const std::tuple<uint32_t, uint32_t, uint32_t> _rangeForAsyncInferRequests{1u, 10u, 1u};
diff --git a/src/plugins/intel_npu/src/plugin/include/plugin.hpp b/src/plugins/intel_npu/src/plugin/include/plugin.hpp
index 2c9dfbf1a76..5d909f3a695 100644
--- a/src/plugins/intel_npu/src/plugin/include/plugin.hpp
+++ b/src/plugins/intel_npu/src/plugin/include/plugin.hpp
@@ -9,12 +9,15 @@
#include <string>
#include "backends_registry.hpp"
+#include "intel_npu/common/filtered_config.hpp"
+#include "intel_npu/common/icompiler_adapter.hpp"
#include "intel_npu/common/npu.hpp"
#include "intel_npu/config/config.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "metrics.hpp"
#include "openvino/runtime/iplugin.hpp"
#include "openvino/runtime/so_ptr.hpp"
+#include "properties.hpp"
namespace intel_npu {
@@ -53,27 +56,25 @@ public:
const ov::AnyMap& properties) const override;
private:
+ void init_options();
+ void filter_config_by_compiler_support(FilteredConfig& cfg) const;
+ FilteredConfig fork_local_config(const std::map<std::string, std::string>& rawConfig,
+ const std::unique_ptr<ICompilerAdapter>& compiler,
+ OptionMode mode = OptionMode::Both) const;
+
std::unique_ptr<BackendsRegistry> _backendsRegistry;
// _backend might not be set by the plugin; certain actions, such as offline compilation, might be supported.
// Appropriate checks are needed in plugin/metrics/properties when actions depend on a backend.
ov::SoPtr<IEngineBackend> _backend;
- std::map<std::string, std::string> _config;
std::shared_ptr<OptionsDesc> _options;
- Config _globalConfig;
+ FilteredConfig _globalConfig;
mutable Logger _logger;
- std::unique_ptr<Metrics> _metrics;
-
- // properties map: {name -> [supported, mutable, eval function]}
- mutable std::map<std::string, std::tuple<bool, ov::PropertyMutability, std::function<ov::Any(const Config&)>>>
- _properties;
- mutable std::vector<ov::PropertyName> _supportedProperties;
+ std::shared_ptr<Metrics> _metrics;
+ std::unique_ptr<Properties> _properties;
static std::atomic<int> _compiledModelLoadCounter;
-
- void reset_compiler_dependent_properties() const;
- void reset_supported_properties() const;
};
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/include/properties.hpp b/src/plugins/intel_npu/src/plugin/include/properties.hpp
new file mode 100644
index 00000000000..86b336dea7e
--- /dev/null
+++ b/src/plugins/intel_npu/src/plugin/include/properties.hpp
@@ -0,0 +1,80 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+#pragma once
+
+#include "intel_npu/common/filtered_config.hpp"
+#include "metrics.hpp"
+
+namespace intel_npu {
+
+enum class PropertiesType { PLUGIN, COMPILED_MODEL };
+
+class Properties final {
+public:
+ /**
+ * @brief Properties handler constructor
+ * @param pType - type of object this handler gets attached to: PLUGIN or COMPILED_MODEL
+ * @param config - reference to the global configuration table of the parent object
+ * @param metrics - reference ptr to the metrics object of the parent object (PLUGIN only)
+ */
+ Properties(const PropertiesType pType,
+ FilteredConfig& config,
+ const std::shared_ptr<Metrics>& metrics = nullptr,
+ const ov::SoPtr<IEngineBackend>& backend = {nullptr});
+
+ /**
+ * @brief Initialize the properties map and try registering the properties for npu-plugin and compiled-model
+ * Can be used for both plugin and compiled-model properties maps, based on the provided pType param to the
+ * constructor of this object
+ * @details
+ * - it will reset the properties map
+ * - it will try registering config-backed option-based properties, with data from global configuration (supported,
+ * visibilty, mutability, value)
+ * - if an option is not present in the global config, it assumes it is not supported and will skip it
+ * - it will register metric-based properties, with data from the metrics interface
+ * - at the end it populates supported_properties with the now dynamically registered public properties
+ */
+ void registerProperties();
+
+ /**
+ * @brief Get the values of a property in a map
+ */
+ ov::Any get_property(const std::string& name, const ov::AnyMap& arguments = {}) const;
+
+ /**
+ * @brief Set the values of a subset of properties, provided as a map
+ * @details
+ * - checks if the property exists, will report if unsupported
+ * - checks if the property is Read-only, will report error if so
+ */
+ void set_property(const ov::AnyMap& properties);
+
+private:
+ PropertiesType _pType;
+ FilteredConfig& _config;
+ std::shared_ptr<Metrics> _metrics;
+ ov::SoPtr<IEngineBackend> _backend;
+
+ // properties map: {name -> [supported, mutable, eval function]}
+ std::map<std::string, std::tuple<bool, ov::PropertyMutability, std::function<ov::Any(const Config&)>>> _properties;
+ std::vector<ov::PropertyName> _supportedProperties;
+
+ const std::vector<ov::PropertyName> _cachingProperties = {ov::device::architecture.name(),
+ ov::intel_npu::compilation_mode_params.name(),
+ ov::intel_npu::compiler_dynamic_quantization.name(),
+ ov::intel_npu::tiles.name(),
+ ov::intel_npu::dpu_groups.name(),
+ ov::intel_npu::dma_engines.name(),
+ ov::intel_npu::compilation_mode.name(),
+ ov::intel_npu::driver_version.name(),
+ ov::intel_npu::compiler_type.name(),
+ ov::intel_npu::batch_mode.name(),
+ ov::hint::execution_mode.name()};
+
+ const std::vector<ov::PropertyName> _internalSupportedProperties = {ov::internal::caching_properties.name(),
+ ov::internal::caching_with_mmap.name()};
+};
+
+} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp b/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp
index 80536a30c59..6b53cea7cf6 100644
--- a/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/compiled_model.cpp
@@ -9,10 +9,8 @@
#include "async_infer_request.hpp"
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/compiler.hpp"
#include "intel_npu/config/config.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "metadata.hpp"
#include "openvino/pass/constant_folding.hpp"
#include "openvino/pass/manager.hpp"
@@ -35,7 +33,7 @@ CompiledModel::CompiledModel(const std::shared_ptr<const ov::Model>& model,
const std::shared_ptr<const ov::IPlugin>& plugin,
const std::shared_ptr<IDevice>& device,
const std::shared_ptr<IGraph>& graph,
- const Config& config)
+ const FilteredConfig& config)
: ICompiledModel(model, plugin),
_config(config),
_logger("CompiledModel", config.get<LOG_LEVEL>()),
@@ -44,7 +42,9 @@ CompiledModel::CompiledModel(const std::shared_ptr<const ov::Model>& model,
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "CompiledModel::CompiledModel");
OV_ITT_TASK_CHAIN(COMPILED_MODEL, itt::domains::NPUPlugin, "CompiledModel::CompiledModel", "initialize_properties");
- initialize_properties();
+ _properties = std::make_unique<Properties>(PropertiesType::COMPILED_MODEL, _config);
+ _properties->registerProperties();
+
configure_stream_executors();
OV_ITT_TASK_SKIP(COMPILED_MODEL);
@@ -58,7 +58,15 @@ CompiledModel::~CompiledModel() {
std::shared_ptr<ov::IAsyncInferRequest> CompiledModel::create_infer_request() const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "CompiledModel::create_infer_request");
+ // sanity check
+ if (_device == nullptr) {
+ OPENVINO_THROW("No available devices. Failed to create infer request!");
+ }
+
if (!_config.get<CREATE_EXECUTOR>() || _config.get<DEFER_WEIGHTS_LOAD>()) {
+ if (_graph == nullptr) {
+ OPENVINO_THROW("Invalid graph handle! Failed to create infer request!");
+ }
_graph->initialize(_config);
}
@@ -134,41 +142,34 @@ std::shared_ptr<const ov::Model> CompiledModel::get_runtime_model() const {
}
void CompiledModel::set_property(const ov::AnyMap& properties) {
- std::map<std::string, std::string> config;
- for (auto&& value : properties) {
- config.emplace(value.first, value.second.as<std::string>());
- }
- for (const auto& configEntry : config) {
- if (_properties.find(configEntry.first) == _properties.end()) {
- OPENVINO_THROW("Unsupported configuration key: ", configEntry.first);
- } else {
- if (std::get<1>(_properties[configEntry.first]) == ov::PropertyMutability::RO) {
- OPENVINO_THROW("READ-ONLY configuration key: ", configEntry.first);
- }
+ // 1. Set the property via Properties interface
+ _properties->set_property(properties);
+
+ // 2. Extra hooks
+ if (properties.count(std::string(WORKLOAD_TYPE::key())) != 0) {
+ if (_graph != nullptr) {
+ const auto workloadType = properties.at(ov::workload_type.name()).as<ov::WorkloadType>();
+ _graph->set_workload_type(workloadType);
}
}
-
- _config.update(config);
- if (config.find(ov::workload_type.name()) != config.end()) {
- const auto workloadType = properties.at(ov::workload_type.name()).as<ov::WorkloadType>();
- _graph->set_workload_type(workloadType);
- }
}
ov::Any CompiledModel::get_property(const std::string& name) const {
- auto configIterator = _properties.find(name);
- if (configIterator != _properties.cend()) {
- return std::get<2>(configIterator->second)(_config);
+ // special cases
+ if (name == ov::model_name.name()) {
+ OPENVINO_ASSERT(_graph != nullptr, "Missing graph");
+ return _graph->get_metadata().name;
+ } else {
+ // default behaviour
+ return _properties->get_property(name);
}
-
- OPENVINO_THROW("Unsupported property ", name);
}
const std::shared_ptr<IGraph>& CompiledModel::get_graph() const {
return _graph;
}
-const Config& CompiledModel::get_config() const {
+const FilteredConfig& CompiledModel::get_config() const {
return _config;
}
@@ -194,201 +195,4 @@ void CompiledModel::configure_stream_executors() {
_resultExecutor = ov::threading::executor_manager()->get_executor(executorId);
}
-void CompiledModel::initialize_properties() {
- const auto pluginSupportedProperties =
- get_plugin()->get_property(ov::supported_properties.name(), {}).as<std::vector<ov::PropertyName>>();
- const auto isPropertySupported = [&pluginSupportedProperties](const std::string& name) {
- return std::any_of(pluginSupportedProperties.begin(),
- pluginSupportedProperties.end(),
- [&name](const ov::PropertyName& property) {
- return property == name;
- });
- };
- _properties = {
- // OV Public
- // =========
- {ov::supported_properties.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _supportedProperties;
- }}},
- {ov::device::id.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<DEVICE_ID>();
- }}},
- {ov::enable_profiling.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<PERF_COUNT>();
- }}},
- {ov::model_name.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- OPENVINO_ASSERT(_graph != nullptr, "Missing graph");
- return _graph->get_metadata().name;
- }}},
- {ov::optimal_number_of_infer_requests.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- // value is allowed to be queried prior the network is compiled
- return static_cast<uint32_t>(getOptimalNumberOfInferRequestsInParallel(config));
- }}},
- {ov::execution_devices.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return std::string("NPU");
- }}},
- {ov::loaded_from_cache.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<LOADED_FROM_CACHE>();
- }}},
- {ov::workload_type.name(),
- {isPropertySupported(ov::workload_type.name()),
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<WORKLOAD_TYPE>();
- }}},
- // OV Public Hints
- // =========
- {ov::hint::performance_mode.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<PERFORMANCE_HINT>();
- }}},
- {ov::hint::execution_mode.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<EXECUTION_MODE_HINT>();
- }}},
- {ov::hint::num_requests.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<PERFORMANCE_HINT_NUM_REQUESTS>();
- }}},
- {ov::hint::inference_precision.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<INFERENCE_PRECISION_HINT>();
- }}},
- {ov::hint::enable_cpu_pinning.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<ENABLE_CPU_PINNING>();
- }}},
- {ov::hint::model_priority.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<MODEL_PRIORITY>();
- }}},
- // OV Internals
- // =========
- {ov::internal::supported_properties.name(),
- {false,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- static const std::vector<ov::PropertyName> supportedProperty{
- ov::PropertyName(ov::internal::caching_properties.name(), ov::PropertyMutability::RO),
- };
- return supportedProperty;
- }}},
- // NPU Public
- // =========
- {ov::intel_npu::compilation_mode_params.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<COMPILATION_MODE_PARAMS>();
- }}},
- {ov::intel_npu::compiler_dynamic_quantization.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<COMPILER_DYNAMIC_QUANTIZATION>();
- }}},
- {ov::intel_npu::qdq_optimization.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<QDQ_OPTIMIZATION>();
- }}},
- {ov::intel_npu::turbo.name(),
- {isPropertySupported(ov::intel_npu::turbo.name()),
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<TURBO>();
- }}},
- // NPU Private
- // =========
- {ov::intel_npu::tiles.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<TILES>();
- }}},
- {ov::intel_npu::profiling_type.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.getString<PROFILING_TYPE>();
- }}},
- {ov::intel_npu::platform.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<PLATFORM>();
- }}},
- {ov::intel_npu::dynamic_shape_to_static.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.getString<DYNAMIC_SHAPE_TO_STATIC>();
- }}},
- {ov::intel_npu::create_executor.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<CREATE_EXECUTOR>();
- }}},
- {ov::intel_npu::defer_weights_load.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<DEFER_WEIGHTS_LOAD>();
- }}},
- {ov::intel_npu::batch_mode.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.getString<BATCH_MODE>();
- }}},
- {ov::intel_npu::run_inferences_sequentially.name(),
- {false,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<RUN_INFERENCES_SEQUENTIALLY>();
- }}},
- };
-
- for (auto& property : _properties) {
- if (std::get<0>(property.second)) {
- _supportedProperties.emplace_back(property.first, std::get<1>(property.second));
- }
- }
-}
-
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/src/metrics.cpp b/src/plugins/intel_npu/src/plugin/src/metrics.cpp
index a042a506708..9e85d0584ec 100644
--- a/src/plugins/intel_npu/src/plugin/src/metrics.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/metrics.cpp
@@ -100,17 +100,9 @@ ov::device::LUID Metrics::GetDeviceLUID(const std::string& specifiedDeviceName)
}};
}
-std::vector<ov::PropertyName> Metrics::GetCachingProperties() const {
- return _cachingProperties;
-}
-
-std::vector<ov::PropertyName> Metrics::GetInternalSupportedProperties() const {
- return _internalSupportedProperties;
-}
-
std::string Metrics::GetBackendName() const {
if (_backend == nullptr) {
- OPENVINO_THROW("No available backends");
+ OPENVINO_THROW("No available backend");
}
return _backend->getName();
@@ -118,7 +110,7 @@ std::string Metrics::GetBackendName() const {
uint32_t Metrics::GetDriverVersion() const {
if (_backend == nullptr) {
- OPENVINO_THROW("No available backends");
+ OPENVINO_THROW("No available backend");
}
return _backend->getDriverVersion();
@@ -126,7 +118,7 @@ uint32_t Metrics::GetDriverVersion() const {
uint32_t Metrics::GetGraphExtVersion() const {
if (_backend == nullptr) {
- OPENVINO_THROW("No available backends");
+ OPENVINO_THROW("No available backend");
}
return _backend->getGraphExtVersion();
@@ -226,4 +218,11 @@ ov::device::Type Metrics::GetDeviceType(const std::string& specifiedDeviceName)
OPENVINO_THROW("No device with name '", specifiedDeviceName, "' is available");
}
+bool Metrics::IsCommandQueueExtSupported() const {
+ if (_backend == nullptr) {
+ OPENVINO_THROW("No available backend");
+ }
+ return _backend->isCommandQueueExtSupported();
+}
+
} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
index d8d9e65e6b5..069f863703f 100644
--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
@@ -13,10 +13,8 @@
#include "intel_npu/common/icompiler_adapter.hpp"
#include "intel_npu/common/igraph.hpp"
#include "intel_npu/common/itt.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/compiler.hpp"
#include "intel_npu/config/npuw.hpp"
-#include "intel_npu/config/runtime.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/utils/zero/zero_init.hpp"
#include "metadata.hpp"
#include "npuw/compiled_model.hpp"
@@ -104,7 +102,7 @@ std::shared_ptr<ov::Model> create_dummy_model(const std::vector<IODescriptor>& i
* @param isBatchingSupported Newer driver versions support batching mode on the plugin.
* @param config A configuration map.
*/
-void set_batch_config(bool isBatchingSupported, Config& config) {
+void set_batch_config(bool isBatchingSupported, FilteredConfig& config) {
if (!isBatchingSupported) {
if (config.has<BATCH_MODE>()) {
if (config.get<BATCH_MODE>() == ov::intel_npu::BatchMode::PLUGIN) {
@@ -146,30 +144,20 @@ void update_log_level(const std::map<std::string, std::string>& propertiesMap) {
}
}
-} // namespace
-
-namespace intel_npu {
-
-static Config merge_configs(const Config& globalConfig,
- const std::map<std::string, std::string>& rawConfig,
- OptionMode mode = OptionMode::Both) {
- update_log_level(rawConfig);
- Config localConfig = globalConfig;
- localConfig.update(rawConfig, mode);
- return localConfig;
-}
-
-static auto get_specified_device_name(const Config config) {
- if (config.has<DEVICE_ID>()) {
- return config.get<DEVICE_ID>();
+static ov::intel_npu::CompilerType resolveCompilerType(const FilteredConfig base_conf, const ov::AnyMap& local_conf) {
+ // first look if provided config changes compiler type
+ auto it = local_conf.find(std::string(COMPILER_TYPE::key()));
+ if (it != local_conf.end()) {
+ // if compiler_type is provided by local config = use that
+ return COMPILER_TYPE::parse(it->second.as<std::string>());
}
- return std::string();
+ // if there is no compiler_type provided = use base_config value
+ return base_conf.get<COMPILER_TYPE>();
}
-static Config add_platform_to_the_config(Config config, const std::string_view platform) {
- config.update({{ov::intel_npu::platform.name(), std::string(platform)}});
- return config;
-}
+} // namespace
+
+namespace intel_npu {
Plugin::Plugin()
: _options(std::make_shared<OptionsDesc>()),
@@ -178,13 +166,11 @@ Plugin::Plugin()
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::Plugin");
set_device_name("NPU");
- registerCommonOptions(*_options);
- registerCompilerOptions(*_options);
- registerRunTimeOptions(*_options);
-
// parse env_variables to get LOG_LEVEL if needed
+ _options->add<LOG_LEVEL>();
_globalConfig.parseEnvVars();
Logger::global().setLevel(_globalConfig.get<LOG_LEVEL>());
+ _logger.setLevel(_globalConfig.get<LOG_LEVEL>());
OV_ITT_TASK_CHAIN(PLUGIN, itt::domains::NPUPlugin, "Plugin::Plugin", "GetBackend");
// backend registry shall be created after configs are updated
@@ -199,505 +185,241 @@ Plugin::Plugin()
OV_ITT_TASK_NEXT(PLUGIN, "createMetrics");
_metrics = std::make_unique<Metrics>(_backend);
- // parse again env_variables after backend is initialized to get backend proprieties
- _globalConfig.parseEnvVars();
+ OV_ITT_TASK_NEXT(PLUGIN, "InitOptions");
+ init_options();
- // Map from name to function {Config -> ov::Any}
- // Note that some properties are RW before network is loaded, and become RO after network is loaded
- _properties = {
- // OV Public
- // =========
- {ov::supported_properties.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _supportedProperties;
- }}},
- {ov::enable_profiling.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<PERF_COUNT>();
- }}},
- {ov::hint::performance_mode.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<PERFORMANCE_HINT>();
- }}},
- {ov::hint::execution_mode.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<EXECUTION_MODE_HINT>();
- }}},
- {ov::hint::num_requests.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<PERFORMANCE_HINT_NUM_REQUESTS>();
- }}},
- {ov::hint::inference_precision.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<INFERENCE_PRECISION_HINT>();
- }}},
- {ov::hint::enable_cpu_pinning.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<ENABLE_CPU_PINNING>();
- }}},
- {ov::log::level.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<LOG_LEVEL>();
- }}},
- {ov::cache_dir.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<CACHE_DIR>();
- }}},
- {ov::device::id.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<DEVICE_ID>();
- }}},
- {ov::compilation_num_threads.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.getString<COMPILATION_NUM_THREADS>();
- }}},
- {ov::available_devices.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetAvailableDevicesNames();
- }}},
- {ov::workload_type.name(),
- {_backend == nullptr ? false : _backend->isCommandQueueExtSupported(),
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<WORKLOAD_TYPE>();
- }}},
- {ov::device::capabilities.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetOptimizationCapabilities();
- }}},
- {ov::optimal_number_of_infer_requests.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return static_cast<uint32_t>(getOptimalNumberOfInferRequestsInParallel(add_platform_to_the_config(
- config,
- utils::getCompilationPlatform(
- config.get<PLATFORM>(),
- config.get<DEVICE_ID>(),
- _backend == nullptr ? std::vector<std::string>() : _backend->getDeviceNames()))));
- }}},
- {ov::range_for_async_infer_requests.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetRangeForAsyncInferRequest();
- }}},
- {ov::range_for_streams.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetRangeForStreams();
- }}},
- {ov::num_streams.name(),
- {true,
- ov::PropertyMutability::RO,
- [](const Config& config) {
- return config.get<NUM_STREAMS>();
- }}},
- {ov::weights_path.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<WEIGHTS_PATH>();
- }}},
- {ov::hint::model.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<MODEL_PTR>();
- }}},
- {ov::device::uuid.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- auto devUuid = _metrics->GetDeviceUuid(specifiedDeviceName);
- return decltype(ov::device::uuid)::value_type{devUuid};
- }}},
- {ov::device::luid.name(),
- {_backend == nullptr ? false : _backend->isLUIDExtSupported(),
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- return _metrics->GetDeviceLUID(specifiedDeviceName);
- }}},
- // Add FULL_DEVICE_NAME and DEVICE_ARCHITECTURE in supported
- // properties list only in case of non-empty device list (#1424144d)
- {ov::device::architecture.name(),
- {!_metrics->GetAvailableDevicesNames().empty(),
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- return _metrics->GetDeviceArchitecture(specifiedDeviceName);
- }}},
- {ov::device::full_name.name(),
- {!_metrics->GetAvailableDevicesNames().empty(),
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- return _metrics->GetFullDeviceName(specifiedDeviceName);
- }}},
- {ov::hint::model_priority.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<MODEL_PRIORITY>();
- }}},
- {ov::device::pci_info.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetPciInfo(get_specified_device_name(config));
- }}},
- {ov::device::gops.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetGops(get_specified_device_name(config));
- }}},
- {ov::device::type.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetDeviceType(get_specified_device_name(config));
- }}},
- {ov::execution_devices.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- if (_metrics->GetAvailableDevicesNames().size() > 1) {
- return std::string("NPU." + config.get<DEVICE_ID>());
- } else {
- return std::string("NPU");
- }
- }}},
- // OV Internals
- // =========
- {ov::internal::caching_properties.name(),
- {false,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetCachingProperties();
- }}},
- {ov::internal::exclusive_async_requests.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<EXCLUSIVE_ASYNC_REQUESTS>();
- }}},
- {ov::internal::supported_properties.name(),
- {false,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetInternalSupportedProperties();
- }}},
- // NPU Public
- // =========
- {ov::intel_npu::device_alloc_mem_size.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetDeviceAllocMemSize(get_specified_device_name(config));
- }}},
- {ov::intel_npu::device_total_mem_size.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetDeviceTotalMemSize(get_specified_device_name(config));
- }}},
- {ov::intel_npu::driver_version.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- return _metrics->GetDriverVersion();
- }}},
- {ov::intel_npu::compiler_version.name(),
- {true,
- ov::PropertyMutability::RO,
- [&](const Config& config) {
- /// create dummy compiler
- CompilerAdapterFactory compilerAdapterFactory;
- auto dummyCompiler = compilerAdapterFactory.getCompiler(_backend, config);
- return dummyCompiler->get_version();
- }}},
- {ov::intel_npu::compilation_mode_params.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<COMPILATION_MODE_PARAMS>();
- }}},
- {ov::intel_npu::compiler_dynamic_quantization.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<COMPILER_DYNAMIC_QUANTIZATION>();
- }}},
- {ov::intel_npu::qdq_optimization.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<QDQ_OPTIMIZATION>();
- }}},
- {ov::intel_npu::turbo.name(),
- {_backend == nullptr ? false : _backend->isCommandQueueExtSupported(),
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<TURBO>();
- }}},
- {ov::intel_npu::tiles.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<TILES>();
- }}},
- {ov::intel_npu::max_tiles.name(),
- {true,
- ov::PropertyMutability::RW,
- [&](const Config& config) {
- if (!config.has<MAX_TILES>()) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- return static_cast<int64_t>(_metrics->GetMaxTiles(specifiedDeviceName));
- }
- return config.get<MAX_TILES>();
- }}},
- {ov::intel_npu::bypass_umd_caching.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<BYPASS_UMD_CACHING>();
- }}},
- {ov::intel_npu::defer_weights_load.name(),
- {true,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<DEFER_WEIGHTS_LOAD>();
- }}},
- // NPU Private
- // =========
- {ov::intel_npu::dma_engines.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<DMA_ENGINES>();
- }}},
- {ov::intel_npu::dpu_groups.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<DPU_GROUPS>();
- }}},
- {ov::intel_npu::stepping.name(),
- {false,
- ov::PropertyMutability::RW,
- [&](const Config& config) {
- if (!config.has<STEPPING>()) {
- const auto specifiedDeviceName = get_specified_device_name(config);
- return static_cast<int64_t>(_metrics->GetSteppingNumber(specifiedDeviceName));
- } else {
- return config.get<STEPPING>();
- }
- }}},
- {ov::intel_npu::compilation_mode.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<COMPILATION_MODE>();
- }}},
- {ov::intel_npu::compiler_type.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.getString<COMPILER_TYPE>();
- }}},
- {ov::intel_npu::platform.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<PLATFORM>();
- }}},
- {ov::intel_npu::backend_name.name(),
- {false,
- ov::PropertyMutability::RO,
- [&](const Config&) {
- return _metrics->GetBackendName();
- }}},
- {ov::intel_npu::create_executor.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<CREATE_EXECUTOR>();
- }}},
- {ov::intel_npu::dynamic_shape_to_static.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<DYNAMIC_SHAPE_TO_STATIC>();
- }}},
- {ov::intel_npu::profiling_type.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<PROFILING_TYPE>();
- }}},
- {ov::intel_npu::backend_compilation_params.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.getString<BACKEND_COMPILATION_PARAMS>();
- }}},
- {ov::intel_npu::run_inferences_sequentially.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.get<RUN_INFERENCES_SEQUENTIALLY>();
- }}},
- {ov::intel_npu::batch_mode.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.getString<BATCH_MODE>();
- }}},
- {ov::intel_npu::disable_version_check.name(),
- {false,
- ov::PropertyMutability::RW,
- [](const Config& config) {
- return config.getString<DISABLE_VERSION_CHECK>();
- }}},
- {ov::intel_npu::batch_compiler_mode_settings.name(),
- {false, ov::PropertyMutability::RW, [](const Config& config) {
- return config.get<BATCH_COMPILER_MODE_SETTINGS>();
- }}}};
+ /// Init and register properties
+ OV_ITT_TASK_NEXT(PLUGIN, "RegisterProperties");
+ _properties = std::make_unique<Properties>(PropertiesType::PLUGIN, _globalConfig, _metrics, _backend);
+ _properties->registerProperties();
}
-void Plugin::reset_supported_properties() const {
- /// reset first
- _supportedProperties.clear(); /// Mutable member
- /// populate
- for (auto& property : _properties) {
- if (std::get<0>(property.second)) {
- _supportedProperties.emplace_back(ov::PropertyName(property.first, std::get<1>(property.second)));
+void Plugin::init_options() {
+ // Initialize (note: it will reset registered options)
+ _options->reset();
+
+#define REGISTER_OPTION(OPT_TYPE) \
+ do { \
+ auto dummyopt = details::makeOptionModel<OPT_TYPE>(); \
+ std::string o_name = dummyopt.key().data(); \
+ _options->add<OPT_TYPE>(); \
+ _globalConfig.enable(o_name, false); \
+ } while (0)
+
+ REGISTER_OPTION(LOG_LEVEL);
+ REGISTER_OPTION(CACHE_DIR);
+ REGISTER_OPTION(DEVICE_ID);
+ REGISTER_OPTION(NUM_STREAMS);
+ REGISTER_OPTION(PERF_COUNT);
+ REGISTER_OPTION(LOADED_FROM_CACHE);
+ REGISTER_OPTION(COMPILATION_NUM_THREADS);
+ REGISTER_OPTION(PERFORMANCE_HINT);
+ REGISTER_OPTION(EXECUTION_MODE_HINT);
+ REGISTER_OPTION(PERFORMANCE_HINT_NUM_REQUESTS);
+ REGISTER_OPTION(ENABLE_CPU_PINNING);
+ REGISTER_OPTION(INFERENCE_PRECISION_HINT);
+ REGISTER_OPTION(MODEL_PRIORITY);
+ REGISTER_OPTION(EXCLUSIVE_ASYNC_REQUESTS);
+ REGISTER_OPTION(COMPILATION_MODE_PARAMS);
+ REGISTER_OPTION(DMA_ENGINES);
+ REGISTER_OPTION(TILES);
+ REGISTER_OPTION(DPU_GROUPS);
+ REGISTER_OPTION(COMPILATION_MODE);
+ REGISTER_OPTION(COMPILER_TYPE);
+ REGISTER_OPTION(PLATFORM);
+ REGISTER_OPTION(CREATE_EXECUTOR);
+ REGISTER_OPTION(DYNAMIC_SHAPE_TO_STATIC);
+ REGISTER_OPTION(PROFILING_TYPE);
+ REGISTER_OPTION(BACKEND_COMPILATION_PARAMS);
+ REGISTER_OPTION(BATCH_MODE);
+ REGISTER_OPTION(BYPASS_UMD_CACHING);
+ REGISTER_OPTION(DEFER_WEIGHTS_LOAD);
+ REGISTER_OPTION(WEIGHTS_PATH);
+ REGISTER_OPTION(RUN_INFERENCES_SEQUENTIALLY);
+ REGISTER_OPTION(COMPILER_DYNAMIC_QUANTIZATION);
+ REGISTER_OPTION(QDQ_OPTIMIZATION);
+ REGISTER_OPTION(STEPPING);
+ REGISTER_OPTION(MAX_TILES);
+ REGISTER_OPTION(DISABLE_VERSION_CHECK);
+ REGISTER_OPTION(MODEL_PTR);
+ REGISTER_OPTION(BATCH_COMPILER_MODE_SETTINGS);
+ if (_backend) {
+ if (_backend->isCommandQueueExtSupported()) {
+ REGISTER_OPTION(TURBO);
+ REGISTER_OPTION(WORKLOAD_TYPE);
}
}
+
+ filter_config_by_compiler_support(_globalConfig);
+
+ if (_backend) {
+ _backend->registerOptions(*_options);
+ }
+
+ // parse again env_variables to update registered configs which have env vars set
+ _globalConfig.parseEnvVars();
}
-void Plugin::reset_compiler_dependent_properties() const {
- uint32_t active_compiler_version = 0;
- // get active compiler version
+void Plugin::filter_config_by_compiler_support(FilteredConfig& cfg) const {
+ bool legacy = false;
+ bool nocompiler = false;
+ std::unique_ptr<ICompilerAdapter> compiler = nullptr;
+ std::vector<std::string> compiler_support_list{};
+ uint32_t compiler_version = 0;
+ // create a dummy compiler to fetch version and supported options
+
try {
CompilerAdapterFactory compilerAdapterFactory;
- auto dummyCompiler = compilerAdapterFactory.getCompiler(_backend, _globalConfig);
- active_compiler_version = dummyCompiler->get_version();
+ compiler = compilerAdapterFactory.getCompiler(_backend, cfg.get<COMPILER_TYPE>());
} catch (...) {
- _logger.warning(
- "No available compiler. Can not determine version > compiler dependent properties remain hidden");
- return;
- }
-
- // NPU_COMPILER_DYNAMIC_QUANTIZATION
- // unpublish if compiler version requirement is not met
- if (_properties.find(ov::intel_npu::compiler_dynamic_quantization.name()) != _properties.end()) {
- if (active_compiler_version >= ICOMPILER_MAKE_VERSION(7, 1)) {
- std::get<0>(_properties[ov::intel_npu::compiler_dynamic_quantization.name()]) = true; /// mark supported
- } else {
- std::get<0>(_properties[ov::intel_npu::compiler_dynamic_quantization.name()]) = false; // mark unsupported
+ // assuming getCompiler failed, meaning we are offline
+ _logger.warning("No available compiler. Enabling only runtime options ");
+ nocompiler = true;
+ }
+
+ if (!nocompiler || (compiler != nullptr)) {
+ compiler_version = compiler->get_version();
+ compiler_support_list = compiler->get_supported_options();
+ }
+ if (compiler_support_list.size() == 0) {
+ _logger.info("No compiler support options list received! Fallback to version-based option registration");
+ legacy = true;
+ }
+
+ // Logs
+ _logger.debug("Compiler version: %ld", compiler_version);
+ _logger.debug("Compiler supported options list (%ld): ", compiler_support_list.size());
+ for (const auto& str : compiler_support_list) {
+ _logger.debug(" %s ", str.c_str());
+ }
+ _logger.debug("Legacy registration: %s", legacy ? "true" : "false");
+
+ // Parse enables
+ cfg.walkEnables([&](const std::string& key) {
+ bool isEnabled = false;
+ auto opt = cfg.getOpt(key);
+ // Runtime (plugin-only) options are always enabled
+ if (opt.mode() == OptionMode::RunTime) {
+ isEnabled = true;
+ } else { // Compiler and common options
+ if (nocompiler && (opt.mode() == OptionMode::CompileTime)) {
+ // we do not register compileTime options if there is no compiler
+ isEnabled = false;
+ } else if (legacy) {
+ // Compiler or common option in Legacy mode? Checking its supported version
+ if (compiler_version >= opt.compilerSupportVersion()) {
+ isEnabled = true;
+ }
+ } else {
+ // We have compiler, we are not in legacy mode = we have a valid list of supported options
+ // Searching in the list
+ auto it = std::find(compiler_support_list.begin(), compiler_support_list.end(), key);
+ if (it != compiler_support_list.end()) {
+ isEnabled = true;
+ } else {
+ // Not found in the supported options list.
+ if (compiler != nullptr) {
+ // Checking if it is a private option?
+ isEnabled = compiler->is_option_supported(key);
+ } else {
+ // Not in the list and not a private option = disabling
+ isEnabled = false;
+ }
+ }
+ }
}
- }
-
- // NPU_QDQ_OPTIMIZATION
- // unpublish if compiler version requirement is not met
- if (_properties.find(ov::intel_npu::qdq_optimization.name()) != _properties.end()) {
- if (active_compiler_version >= ICOMPILER_MAKE_VERSION(7, 20)) {
- std::get<0>(_properties[ov::intel_npu::qdq_optimization.name()]) = true; /// mark supported
+ if (!isEnabled) {
+ _logger.debug("Config option %s not supported! Requirements not met.", key.c_str());
} else {
- std::get<0>(_properties[ov::intel_npu::qdq_optimization.name()]) = false; // mark unsupported
+ _logger.debug("Enabled config option %s", key.c_str());
}
- }
+ // update enable flag
+ cfg.enable(key, isEnabled);
+ });
}
-void Plugin::set_property(const ov::AnyMap& properties) {
- const std::map<std::string, std::string> config = any_copy(properties);
- update_log_level(config);
- bool compiler_type_change = false;
- for (const auto& configEntry : config) {
- if (_properties.find(configEntry.first) == _properties.end()) {
- OPENVINO_THROW("Unsupported configuration key: ", configEntry.first);
- } else {
- if (std::get<1>(_properties[configEntry.first]) == ov::PropertyMutability::RO) {
- OPENVINO_THROW("READ-ONLY configuration key: ", configEntry.first);
+FilteredConfig Plugin::fork_local_config(const std::map<std::string, std::string>& rawConfig,
+ const std::unique_ptr<ICompilerAdapter>& compiler,
+ OptionMode mode) const {
+ update_log_level(rawConfig);
+ // create a copy of the global config
+ FilteredConfig localConfig = _globalConfig;
+ bool compiler_changed = false;
+
+ // Check if compiler was changed
+ // 1. Check for compiler change
+ auto it = rawConfig.find(std::string(COMPILER_TYPE::key()));
+ if (it != rawConfig.end()) {
+ if (localConfig.getString<COMPILER_TYPE>() != it->second) {
+ // Compiler type has changed!
+ // Set new compiler type
+ localConfig.update({{std::string(COMPILER_TYPE::key()), it->second}});
+ // enable/disable config keys based on what the new compiler supports
+ filter_config_by_compiler_support(localConfig);
+ compiler_changed = true;
+ }
+ }
+ // 2. Revalidate unknown internal configs
+ // look for unsupported internals
+ // first in what we inherited from globalconfig by forking it - ONLY if compiler has changed
+ if (compiler_changed) {
+ localConfig.walkInternals([&](const std::string& key) {
+ if (!compiler->is_option_supported(key)) {
+ OPENVINO_THROW("[ NOT_FOUND ] Option '", key, "' is not supported for current configuration");
}
- if (configEntry.first == ov::intel_npu::compiler_type.name()) {
- // we just assume its a change, not compare against old value
- compiler_type_change = true;
+ });
+ }
+ // secondly, in the new config provided by user
+ for (const auto& [key, value] : rawConfig) {
+ if (!localConfig.hasOpt(key)) {
+ // not a known config key
+ if (!compiler->is_option_supported(key)) {
+ OPENVINO_THROW("[ NOT_FOUND ] Option '", key, "' is not supported for current configuration");
}
}
}
- _globalConfig.update(config);
- if (_backend != nullptr) {
- _backend->updateInfo(_globalConfig);
- }
-
- for (const auto& entry : config) {
- _config[entry.first] = entry.second;
- }
+ // 3. If all good so far, update values
+ localConfig.update(rawConfig, mode);
+ return localConfig;
+}
- if (compiler_type_change) {
- // if compiler type was changed > need to reset properties to match the new compiler
- // since properties have changed > need to reset supported_properties as well
- reset_compiler_dependent_properties();
- reset_supported_properties();
+void Plugin::set_property(const ov::AnyMap& properties) {
+ // 1. Check for compiler change
+ if (properties.count(std::string(COMPILER_TYPE::key())) != 0) {
+ // Compiler change detected
+ // Set new compiler in _globalConfig
+ auto it = properties.find(std::string(COMPILER_TYPE::key()));
+ if (it != properties.end()) {
+ _globalConfig.update({{std::string(COMPILER_TYPE::key()), it->second.as<std::string>()}});
+ // enable/disable config keys based on what the new compiler supports
+ filter_config_by_compiler_support(_globalConfig);
+ // 2. Reset properties for the new options
+ _properties->registerProperties();
+ }
}
-}
-ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& arguments) const {
- const std::map<std::string, std::string>& amends = any_copy(arguments);
- const Config amendedConfig = merge_configs(_globalConfig, amends);
+ // 2. Set the property via Properties interface
+ _properties->set_property(properties);
- /// Special case for supportedProperties
- /// populate it at first get
- if (name == ov::supported_properties.name() && _supportedProperties.size() < 1) {
- reset_compiler_dependent_properties();
- reset_supported_properties();
+ // 3. Extra hooks
+ // Update log level if it was provided
+ if (properties.count(std::string(LOG_LEVEL::key())) != 0) {
+ Logger::global().setLevel(_globalConfig.get<LOG_LEVEL>());
}
-
- auto&& configIterator = _properties.find(name);
- if (configIterator != _properties.cend()) {
- return std::get<2>(configIterator->second)(amendedConfig);
+ // Init backends if needed
+ if (_backend != nullptr) {
+ _backend->updateInfo(_globalConfig);
}
+}
- OPENVINO_THROW("Unsupported configuration key: ", name);
+ov::Any Plugin::get_property(const std::string& name, const ov::AnyMap& arguments) const {
+ return _properties->get_property(name, arguments);
}
std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<const ov::Model>& model,
const ov::AnyMap& properties) const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::compile_model");
- OV_ITT_TASK_CHAIN(PLUGIN_COMPILE_MODEL, itt::domains::NPUPlugin, "Plugin::compile_model", "merge_configs");
// Before going any further: if
// ... 1 - NPUW mode is activated
@@ -714,8 +436,13 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
}
}
+ // create compiler
+ CompilerAdapterFactory compilerAdapterFactory;
+ auto compiler = compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, properties));
+
const std::map<std::string, std::string> localPropertiesMap = any_copy(localProperties);
- auto localConfig = merge_configs(_globalConfig, localPropertiesMap);
+ OV_ITT_TASK_CHAIN(PLUGIN_COMPILE_MODEL, itt::domains::NPUPlugin, "Plugin::compile_model", "fork_local_config");
+ auto localConfig = fork_local_config(localPropertiesMap, compiler);
update_log_level(localPropertiesMap);
const auto set_cache_dir = localConfig.get<CACHE_DIR>();
@@ -772,8 +499,7 @@ std::shared_ptr<ov::ICompiledModel> Plugin::compile_model(const std::shared_ptr<
}
}
- CompilerAdapterFactory compilerAdapterFactory;
- auto compiler = compilerAdapterFactory.getCompiler(_backend, localConfig);
+ auto originalModel = model->clone();
OV_ITT_TASK_NEXT(PLUGIN_COMPILE_MODEL, "compile");
std::shared_ptr<intel_npu::IGraph> graph;
@@ -823,7 +549,6 @@ ov::SoPtr<ov::IRemoteContext> Plugin::get_default_context(const ov::AnyMap&) con
std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, const ov::AnyMap& properties) const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::import_model");
- OV_ITT_TASK_CHAIN(PLUGIN_IMPORT_MODEL, itt::domains::NPUPlugin, "Plugin::import_model", "merge_configs");
// If was exported via NPUW
auto stream_start_pos = stream.tellg();
@@ -856,9 +581,12 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, c
npu_plugin_properties.erase(blob_it);
}
- const auto propertiesMap = any_copy(npu_plugin_properties);
+ CompilerAdapterFactory compilerAdapterFactory;
+ auto compiler = compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, properties));
- auto localConfig = merge_configs(_globalConfig, propertiesMap, OptionMode::RunTime);
+ const auto propertiesMap = any_copy(npu_plugin_properties);
+ OV_ITT_TASK_CHAIN(PLUGIN_IMPORT_MODEL, itt::domains::NPUPlugin, "Plugin::import_model", "fork_local_config");
+ auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::RunTime);
_logger.setLevel(localConfig.get<LOG_LEVEL>());
const auto platform =
utils::getCompilationPlatform(localConfig.get<PLATFORM>(),
@@ -880,9 +608,6 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream, c
std::shared_ptr<ov::ICompiledModel> compiledModel;
try {
- CompilerAdapterFactory compilerAdapterFactory;
- auto compiler = compilerAdapterFactory.getCompiler(_backend, localConfig);
-
uint64_t graphSize;
const bool skipCompatibility = localConfig.get<DISABLE_VERSION_CHECK>();
if (!skipCompatibility) {
@@ -943,8 +668,10 @@ std::shared_ptr<ov::ICompiledModel> Plugin::import_model(std::istream& stream,
ov::SupportedOpsMap Plugin::query_model(const std::shared_ptr<const ov::Model>& model,
const ov::AnyMap& properties) const {
OV_ITT_SCOPED_TASK(itt::domains::NPUPlugin, "Plugin::query_model");
+ CompilerAdapterFactory compilerAdapterFactory;
+ auto compiler = compilerAdapterFactory.getCompiler(_backend, resolveCompilerType(_globalConfig, properties));
const std::map<std::string, std::string> propertiesMap = any_copy(properties);
- auto localConfig = merge_configs(_globalConfig, propertiesMap, OptionMode::CompileTime);
+ auto localConfig = fork_local_config(propertiesMap, compiler, OptionMode::CompileTime);
_logger.setLevel(localConfig.get<LOG_LEVEL>());
const auto platform =
utils::getCompilationPlatform(localConfig.get<PLATFORM>(),
@@ -952,8 +679,6 @@ ov::SupportedOpsMap Plugin::query_model(const std::shared_ptr<const ov::Model>&
_backend == nullptr ? std::vector<std::string>() : _backend->getDeviceNames());
localConfig.update({{ov::intel_npu::platform.name(), platform}});
- CompilerAdapterFactory compilerAdapterFactory;
- auto compiler = compilerAdapterFactory.getCompiler(_backend, localConfig);
ov::SupportedOpsMap supportedOpsMap;
try {
supportedOpsMap = compiler->query(model, localConfig);
diff --git a/src/plugins/intel_npu/src/plugin/src/properties.cpp b/src/plugins/intel_npu/src/plugin/src/properties.cpp
new file mode 100644
index 00000000000..60925b405ba
--- /dev/null
+++ b/src/plugins/intel_npu/src/plugin/src/properties.cpp
@@ -0,0 +1,520 @@
+// Copyright (C) 2018-2025 Intel Corporation
+// SPDX-License-Identifier: Apache-2.0
+//
+
+// Plugin
+#include "properties.hpp"
+
+#include "compiler_adapter_factory.hpp"
+#include "intel_npu/common/device_helpers.hpp"
+#include "intel_npu/config/options.hpp"
+
+namespace intel_npu {
+
+//
+// Helper macro functions to ease registration of properties (both from configs and from metrics)
+//
+
+/**
+ * @brief Macro for registering simple get<> properties which have everything defined in their optionBase.
+ *
+ * This macro can be used for registering properties which have entry in the optionsDesc table and
+ * requre a simple globalconfig.get<TEMPLATE>() callback for value, without any extra data manipulation
+ * It will check if the configuration option is available in the globalconfig and if it exists,
+ * then registers it as a property in the internal property map. It handles
+ * public/private property visibility and the mutability of the property
+ * based on the configuration from the optionBase type.
+ *
+ * @param OPT_NAME Class/type of the option (will fetch .name() from it)
+ * @param OPT_TYPE Type (template) of the option
+ *
+ * @details
+ * - It first checks if the option was registered in the global config. Options not present in the global config
+ * are not supported in the current configuration and were previously filtered out on plugin level.
+ * - The property visibility (public/private) and mutability (RO/RW) are read from the base option descriptor
+ * (optionBase) the property will map to
+ * - COMPILED_MODEL only: In case the property is registered for a compiled_model, mutability will be automatically
+ * forced to READ-ONLY
+ * - COMPILED_MODEL only: If the configuration has no entry for the option, it means it was not set, which means it will
+ * skip registering it
+ * - A simple config.get<OPT_TYPE> lambda function is defined as the property's callback function
+ *
+ * @note The macro ensures that compiled model properties are marked read-only unless the configuration lacks the
+ * specified option type.
+ */
+#define TRY_REGISTER_SIMPLE_PROPERTY(OPT_NAME, OPT_TYPE) \
+ do { \
+ std::string o_name = OPT_NAME.name(); \
+ if (_config.isAvailable(o_name)) { \
+ bool isPublic = _config.getOpt(o_name).isPublic(); \
+ ov::PropertyMutability isMutable = _config.getOpt(o_name).mutability(); \
+ if (_pType == PropertiesType::COMPILED_MODEL) { \
+ isMutable = ov::PropertyMutability::RO; \
+ } \
+ _properties.emplace(o_name, std::make_tuple(isPublic, isMutable, [](const Config& config) { \
+ return config.get<OPT_TYPE>(); \
+ })); \
+ } \
+ } while (0)
+
+/**
+ * @brief Macro for defining otherwise simple get<> properties but which have variable public/private field
+ *
+ * This macro offers the same functionality as TRY_REGISTER_SIMPLE_PROPERTY (see its description for more)
+ * with the extra feature that enforces plugin property visibility (public/private) given by user.
+ * Compiled model properties will still be forced to READ-ONLY
+ *
+ * @param OPT_NAME Class/type of the option (will fetch .name() from it)
+ * @param OPT_TYPE Type (template) of the option
+ * @param PROP_VISIBILITY Visibility (true=public, false=private) of the resulting property
+ *
+ * @details
+ * @see TRY_REGISTER_SIMPLE_PROPERTY
+ */
+#define TRY_REGISTER_VARPUB_PROPERTY(OPT_NAME, OPT_TYPE, PROP_VISIBILITY) \
+ do { \
+ std::string o_name = OPT_NAME.name(); \
+ if (_config.isAvailable(o_name)) { \
+ ov::PropertyMutability isMutable = _config.getOpt(o_name).mutability(); \
+ if (_pType == PropertiesType::COMPILED_MODEL) { \
+ isMutable = ov::PropertyMutability::RO; \
+ } \
+ _properties.emplace(o_name, std::make_tuple(PROP_VISIBILITY, isMutable, [](const Config& config) { \
+ return config.get<OPT_TYPE>(); \
+ })); \
+ } \
+ } while (0)
+
+/**
+ * @brief Macro for registering properties which need a custom return function
+ *
+ * This macro offers the same functionality as TRY_REGISTER_SIMPLE_PROPERTY (see its description for more)
+ * but with a custom callback function.
+ *
+ * @param OPT_NAME Class/type of the option (will fetch .name() from it)
+ * @param OPT_TYPE Type (template) of the option
+ * @param PROP_RETFUNC Custom lambda callback function for the resulting property
+ *
+ * @details
+ * @see TRY_REGISTER_SIMPLE_PROPERTY
+ */
+#define TRY_REGISTER_CUSTOMFUNC_PROPERTY(OPT_NAME, OPT_TYPE, PROP_RETFUNC) \
+ do { \
+ std::string o_name = OPT_NAME.name(); \
+ if (_config.isAvailable(o_name)) { \
+ bool isPublic = _config.getOpt(o_name).isPublic(); \
+ ov::PropertyMutability isMutable = _config.getOpt(o_name).mutability(); \
+ if (_pType == PropertiesType::COMPILED_MODEL) { \
+ isMutable = ov::PropertyMutability::RO; \
+ } \
+ _properties.emplace(o_name, std::make_tuple(isPublic, isMutable, PROP_RETFUNC)); \
+ } \
+ } while (0)
+
+/**
+ * @brief Macro for registering a fully custom property, with option entry validation
+ *
+ * This macro offers the flexibility of registering a fully custom property where all its parameters
+ * are user provided: visibility (public/private), mutability and callback function
+ *
+ * @param OPT_NAME Class/type of the option (will fetch .name() from it)
+ * @param OPT_TYPE Type (template) of the option
+ * @param PROP_VISIBILITY Visibility (true=public, false=private) of the resulting property
+ * @param PROP_MUTABILITY Mutability (RO/RW) of the resulting property
+ * @param PROP_RETFUNC Custom lambda callback function for the resulting property
+ *
+ * @details
+ * - It first checks if the option was registered in the global config. Options not present in the global config
+ * are not supported in the current configuration and were previously filtered out on plugin level.
+ * - A new entry is added to the properties table with the user provided parameters (visibility,mutability,callback)
+ * without any further checks and validations
+ *
+ * @note This macro does not offer any compiled-model specific checks, such as
+ * if the config options this property maps to has actual value, nor it enforces RO, like previous macros.
+ */
+#define TRY_REGISTER_CUSTOM_PROPERTY(OPT_NAME, OPT_TYPE, PROP_VISIBILITY, PROP_MUTABILITY, PROP_RETFUNC) \
+ do { \
+ std::string o_name = OPT_NAME.name(); \
+ if (_config.isAvailable(o_name)) { \
+ _properties.emplace(o_name, std::make_tuple(PROP_VISIBILITY, PROP_MUTABILITY, PROP_RETFUNC)); \
+ } \
+ } while (0)
+
+/**
+ * @brief Macro for force registering a fully custom property (no option entry validation.
+ *
+ * Same as TRY_REGISTER_CUSTOM_PROPERTY but without any checks. It will force register the property.
+ *
+ * @param OPT_NAME Class/type of the option (will fetch .name() from it)
+ * @param OPT_TYPE Type (template) of the option
+ * @param PROP_VISIBILITY Visibility (true=public, false=private) of the resulting property
+ * @param PROP_MUTABILITY Mutability (RO/RW) of the resulting property
+ * @param PROP_RETFUNC Custom lambda callback function for the resulting property
+ *
+ * @details
+ * - A new entry is added to the properties table with the user provided parameters (visibility,mutability,callback)
+ * without any checks and validations
+ *
+ * @note This macro does not offer any compiled-model specific checks, such as
+ * if the config options this property maps to has actual value, nor it enforces RO, like previous macros.
+ */
+#define FORCE_REGISTER_CUSTOM_PROPERTY(OPT_NAME, OPT_TYPE, PROP_VISIBILITY, PROP_MUTABILITY, PROP_RETFUNC) \
+ do { \
+ _properties.emplace(OPT_NAME.name(), std::make_tuple(PROP_VISIBILITY, PROP_MUTABILITY, PROP_RETFUNC)); \
+ } while (0)
+
+/**
+ * @brief Macro for defining properties which have simmple 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
+ * or environment. Since they don't have an entry in the config map, nor an optionBase descriptor, their callback
+ * function returns custom data.
+ *
+ * @param PROP_NAME Class/type of the property (will fetch .name() from it)
+ * @param PROP_VISIBILITY Visibility (true=public, false=private) of the resulting property
+ * @param PROP_RETVAL Value for the callback function to return
+ *
+ * @details
+ * - A new entry is added to the properties table with the user provided parameters (visibility,mutability,callback val)
+ * without any checks and validations
+ *
+ * @note This macro does not offer any compiled-model specific checks
+ */
+#define REGISTER_SIMPLE_METRIC(PROP_NAME, PROP_VISIBILITY, PROP_RETVAL) \
+ do { \
+ _properties.emplace(PROP_NAME.name(), \
+ std::make_tuple(PROP_VISIBILITY, ov::PropertyMutability::RO, [&](const Config& config) { \
+ return PROP_RETVAL; \
+ })); \
+ } while (0)
+
+/**
+ * @brief Macro for defining metric properties with full callback lambda functions
+ *
+ * The difference from REGISTER_SIMPLE_METRIC is that here we can define the whole callback lambdafunction, not just the
+ * return value
+ *
+ * @param PROP_NAME Class/type of the property (will fetch .name() from it)
+ * @param PROP_VISIBILITY Visibility (true=public, false=private) of the resulting property
+ * @param PROP_RETFUNC Callback lambda function of the resulting property
+ *
+ * @details
+ * - A new entry is added to the properties table with the user provided parameters (visibility,mutability,callback
+ * func) without any checks and validations
+ *
+ * @note This macro does not offer any compiled-model specific checks
+ */
+// Macro for defining metrics with custom return function
+#define REGISTER_CUSTOM_METRIC(PROP_NAME, PROP_VISIBILITY, PROP_RETFUNC) \
+ do { \
+ _properties.emplace(PROP_NAME.name(), \
+ std::make_tuple(PROP_VISIBILITY, ov::PropertyMutability::RO, PROP_RETFUNC)); \
+ } while (0)
+
+// Local helper function for appending platform name to the config
+static Config add_platform_to_the_config(Config config, const std::string_view platform) {
+ config.update({{ov::intel_npu::platform.name(), std::string(platform)}});
+ return config;
+}
+
+// Local helper function for retrieving the device name
+static auto get_specified_device_name(const Config config) {
+ if (config.has<DEVICE_ID>()) {
+ return config.get<DEVICE_ID>();
+ }
+ return std::string();
+}
+
+// Heuristically obtained number. Varies depending on the values of PLATFORM and PERFORMANCE_HINT
+// Note: this is the value provided by the plugin, application should query and consider it, but may supply its own
+// preference for number of parallel requests via dedicated configuration
+static int64_t getOptimalNumberOfInferRequestsInParallel(const Config& config) {
+ const std::string platform = ov::intel_npu::Platform::standardize(config.get<PLATFORM>());
+
+ if (platform == ov::intel_npu::Platform::NPU3720) {
+ if (config.get<PERFORMANCE_HINT>() == ov::hint::PerformanceMode::THROUGHPUT) {
+ return 4;
+ } else {
+ return 1;
+ }
+ } else {
+ if (config.get<PERFORMANCE_HINT>() == ov::hint::PerformanceMode::THROUGHPUT) {
+ return 8;
+ } else {
+ return 1;
+ }
+ }
+}
+
+Properties::Properties(const PropertiesType pType,
+ FilteredConfig& config,
+ const std::shared_ptr<Metrics>& metrics,
+ const ov::SoPtr<IEngineBackend>& backend)
+ : _pType(pType),
+ _config(config),
+ _metrics(metrics),
+ _backend(backend) {}
+
+void Properties::registerProperties() {
+ // Reset
+ _properties.clear();
+
+ // 1. Configs
+ // ========
+ // 1.1 simple configs which only return value
+ // TRY_REGISTER_SIMPLE_PROPERTY format: (property, config_to_return)
+ // TRY_REGISTER_VARPUB_PROPERTY format: (property, config_to_return, dynamic public/private value)
+ // TRY_REGISTER_CUSTOMFUNC_PROPERTY format: (property, custom_return_lambda_function)
+ // TRY_REGISTER_CUSTOM_PROPERTY format: (property, visibility, mutability, custom_return_lambda_function)
+ // FORCE_REGISTER_CUSTOM_PROPERTY format: (property, visibility, mutability, custom_return_lambda_function)
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::enable_profiling, PERF_COUNT);
+ 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);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::cache_dir, CACHE_DIR);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::device::id, DEVICE_ID);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::num_streams, NUM_STREAMS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::weights_path, WEIGHTS_PATH);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::model_priority, MODEL_PRIORITY);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::internal::exclusive_async_requests, EXCLUSIVE_ASYNC_REQUESTS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::compilation_mode_params, COMPILATION_MODE_PARAMS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::dma_engines, DMA_ENGINES);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::tiles, TILES);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::dpu_groups, DPU_GROUPS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::compilation_mode, COMPILATION_MODE);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::compiler_type, COMPILER_TYPE);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::platform, PLATFORM);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::create_executor, CREATE_EXECUTOR);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::dynamic_shape_to_static, DYNAMIC_SHAPE_TO_STATIC);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::profiling_type, PROFILING_TYPE);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::backend_compilation_params, BACKEND_COMPILATION_PARAMS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::batch_mode, BATCH_MODE);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::turbo, TURBO);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::bypass_umd_caching, BYPASS_UMD_CACHING);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::defer_weights_load, DEFER_WEIGHTS_LOAD);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::run_inferences_sequentially, RUN_INFERENCES_SEQUENTIALLY);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::compiler_dynamic_quantization, COMPILER_DYNAMIC_QUANTIZATION);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::qdq_optimization, QDQ_OPTIMIZATION);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::disable_version_check, DISABLE_VERSION_CHECK);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::batch_compiler_mode_settings, BATCH_COMPILER_MODE_SETTINGS);
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::hint::enable_cpu_pinning, ENABLE_CPU_PINNING);
+
+ // 1.2. Special cases
+ // ==================
+ if (_pType == PropertiesType::PLUGIN && _metrics != nullptr) {
+ // These properties require different handling in plugin vs compiled_model
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::workload_type, WORKLOAD_TYPE);
+ // plugin-only
+ TRY_REGISTER_CUSTOMFUNC_PROPERTY(ov::intel_npu::stepping, STEPPING, [&](const Config& config) {
+ if (!config.has<STEPPING>()) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ return static_cast<int64_t>(_metrics->GetSteppingNumber(specifiedDeviceName));
+ } else {
+ return config.get<STEPPING>();
+ }
+ });
+ // plugin-only
+ TRY_REGISTER_CUSTOMFUNC_PROPERTY(ov::intel_npu::max_tiles, MAX_TILES, [&](const Config& config) {
+ if (!config.has<MAX_TILES>()) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ return static_cast<int64_t>(_metrics->GetMaxTiles(specifiedDeviceName));
+ } else {
+ return config.get<MAX_TILES>();
+ }
+ });
+ } else if (_pType == PropertiesType::COMPILED_MODEL) {
+ // These properties require different handling in plugin vs compiled_model
+ TRY_REGISTER_CUSTOM_PROPERTY(ov::workload_type,
+ WORKLOAD_TYPE,
+ true,
+ ov::PropertyMutability::RW,
+ [](const Config& config) {
+ return config.get<WORKLOAD_TYPE>();
+ });
+ // compiled-model only
+ TRY_REGISTER_SIMPLE_PROPERTY(ov::loaded_from_cache, LOADED_FROM_CACHE);
+ }
+
+ // 2. Metrics (static device and enviroment properties)
+ // ========
+ // REGISTER_SIMPLE_METRIC format: (property, public true/false, return value)
+ // REGISTER_CUSTOM_METRIC format: (property, public true/false, return value function)
+
+ // 2.1 Metrics for Plugin-only (or those which need to be handled differently)
+ if (_pType == PropertiesType::PLUGIN && _metrics != nullptr) {
+ REGISTER_SIMPLE_METRIC(ov::available_devices, true, _metrics->GetAvailableDevicesNames());
+ REGISTER_SIMPLE_METRIC(ov::device::capabilities, true, _metrics->GetOptimizationCapabilities());
+ REGISTER_SIMPLE_METRIC(
+ ov::optimal_number_of_infer_requests,
+ true,
+ static_cast<uint32_t>(getOptimalNumberOfInferRequestsInParallel(add_platform_to_the_config(
+ config,
+ utils::getCompilationPlatform(
+ config.get<PLATFORM>(),
+ config.get<DEVICE_ID>(),
+ _backend == nullptr ? std::vector<std::string>() : _backend->getDeviceNames())))));
+ REGISTER_SIMPLE_METRIC(ov::range_for_async_infer_requests, true, _metrics->GetRangeForAsyncInferRequest());
+ REGISTER_SIMPLE_METRIC(ov::range_for_streams, true, _metrics->GetRangeForStreams());
+ REGISTER_SIMPLE_METRIC(ov::device::pci_info, true, _metrics->GetPciInfo(get_specified_device_name(config)));
+ REGISTER_SIMPLE_METRIC(ov::device::gops, true, _metrics->GetGops(get_specified_device_name(config)));
+ REGISTER_SIMPLE_METRIC(ov::device::type, true, _metrics->GetDeviceType(get_specified_device_name(config)));
+ REGISTER_SIMPLE_METRIC(ov::internal::supported_properties, true, _internalSupportedProperties);
+ REGISTER_SIMPLE_METRIC(ov::intel_npu::device_alloc_mem_size,
+ true,
+ _metrics->GetDeviceAllocMemSize(get_specified_device_name(config)));
+ REGISTER_SIMPLE_METRIC(ov::intel_npu::device_total_mem_size,
+ true,
+ _metrics->GetDeviceTotalMemSize(get_specified_device_name(config)));
+ REGISTER_SIMPLE_METRIC(ov::intel_npu::driver_version, true, _metrics->GetDriverVersion());
+ REGISTER_SIMPLE_METRIC(ov::intel_npu::backend_name, false, _metrics->GetBackendName());
+ REGISTER_SIMPLE_METRIC(ov::intel_npu::batch_mode, false, _metrics->GetDriverVersion());
+ REGISTER_CUSTOM_METRIC(ov::device::architecture,
+ !_metrics->GetAvailableDevicesNames().empty(),
+ [&](const Config& config) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ return _metrics->GetDeviceArchitecture(specifiedDeviceName);
+ });
+ REGISTER_CUSTOM_METRIC(ov::device::full_name,
+ !_metrics->GetAvailableDevicesNames().empty(),
+ [&](const Config& config) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ return _metrics->GetFullDeviceName(specifiedDeviceName);
+ });
+ REGISTER_CUSTOM_METRIC(ov::device::luid,
+ _backend == nullptr ? false : _backend->isLUIDExtSupported(),
+ [&](const Config& config) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ return _metrics->GetDeviceLUID(specifiedDeviceName);
+ });
+ REGISTER_CUSTOM_METRIC(ov::device::uuid, true, [&](const Config& config) {
+ const auto specifiedDeviceName = get_specified_device_name(config);
+ auto devUuid = _metrics->GetDeviceUuid(specifiedDeviceName);
+ return decltype(ov::device::uuid)::value_type{devUuid};
+ });
+ REGISTER_CUSTOM_METRIC(ov::execution_devices, true, [&](const Config& config) {
+ if (_metrics->GetAvailableDevicesNames().size() > 1) {
+ return std::string("NPU." + config.get<DEVICE_ID>());
+ } else {
+ return std::string("NPU");
+ }
+ });
+ REGISTER_CUSTOM_METRIC(ov::intel_npu::compiler_version, true, [&](const Config& config) {
+ /// create dummy compiler
+ CompilerAdapterFactory compilerAdapterFactory;
+ auto dummyCompiler = compilerAdapterFactory.getCompiler(_backend, config.get<COMPILER_TYPE>());
+ return dummyCompiler->get_version();
+ });
+ REGISTER_CUSTOM_METRIC(ov::internal::caching_properties, false, [&](const Config& config) {
+ // return a dynamically created list based on what is supported in current configuration
+ std::vector<ov::PropertyName> caching_props{};
+ // walk the static caching properties, add only what is supported now
+ for (auto prop : _cachingProperties) {
+ if (_config.isAvailable(prop)) {
+ caching_props.emplace_back(prop);
+ }
+ }
+ return caching_props;
+ });
+ } else if (_pType == PropertiesType::COMPILED_MODEL) {
+ /// 2.2 Metrics for CompiledModel-only (or those which need to be handled differently)
+ REGISTER_CUSTOM_METRIC(ov::model_name, true, [](const Config&) {
+ // TODO: log an error here as the code shouldn't have gotten here
+ // this property is implemented in compiled model directly
+ // this implementation here servers only to publish it in supported_properties
+ return std::string("invalid");
+ });
+ REGISTER_SIMPLE_METRIC(ov::optimal_number_of_infer_requests,
+ true,
+ static_cast<uint32_t>(getOptimalNumberOfInferRequestsInParallel(config)));
+ REGISTER_CUSTOM_METRIC(ov::internal::supported_properties, true, [&](const Config&) {
+ static const std::vector<ov::PropertyName> supportedProperty{
+ ov::PropertyName(ov::internal::caching_properties.name(), ov::PropertyMutability::RO)};
+ return supportedProperty;
+ });
+ REGISTER_CUSTOM_METRIC(ov::execution_devices, true, [](const Config&) {
+ // TODO: log an error here as the code shouldn't have gotten here
+ // this property is implemented in compiled model directly
+ // this implementation here servers only to publish it in supported_properties
+ return std::string("NPU");
+ });
+ }
+ // 2.3. Common metrics (exposed same way by both Plugin and CompiledModel)
+ REGISTER_SIMPLE_METRIC(ov::supported_properties, true, _supportedProperties);
+
+ // 3. Populate supported properties list
+ // ========
+ for (auto& property : _properties) {
+ if (std::get<0>(property.second)) {
+ _supportedProperties.emplace_back(ov::PropertyName(property.first, std::get<1>(property.second)));
+ }
+ }
+}
+
+ov::Any Properties::get_property(const std::string& name, const ov::AnyMap& arguments) const {
+ std::map<std::string, std::string> amends;
+ for (auto&& value : arguments) {
+ amends.emplace(value.first, value.second.as<std::string>());
+ }
+ FilteredConfig amendedConfig = _config;
+ amendedConfig.update(amends, OptionMode::Both);
+
+ auto&& configIterator = _properties.find(name);
+ if (configIterator != _properties.cend()) {
+ return std::get<2>(configIterator->second)(amendedConfig);
+ }
+ try {
+ return amendedConfig.getInternal(name);
+ } catch (...) {
+ OPENVINO_THROW("Unsupported configuration key: ", name);
+ }
+}
+
+void Properties::set_property(const ov::AnyMap& properties) {
+ std::map<std::string, std::string> cfgs_to_set;
+
+ std::unique_ptr<ICompilerAdapter> compiler = nullptr;
+ if (_pType == PropertiesType::PLUGIN) {
+ try {
+ // Only accepting unknown config keys in plugin
+ CompilerAdapterFactory compilerAdapterFactory;
+ compiler = compilerAdapterFactory.getCompiler(_backend, _config.get<COMPILER_TYPE>());
+ } catch (...) {
+ // nothing to do here. we will just throw exception bellow in case unknown property check is called
+ // if its not called, nothing to do
+ }
+ }
+
+ for (auto&& value : properties) {
+ if (_properties.find(value.first) == _properties.end()) {
+ // property doesn't exist
+ // checking as internal now
+ if (compiler != nullptr) {
+ if (compiler->is_option_supported(value.first)) {
+ // if compiler reports it supported > registering as internal
+ _config.addOrUpdateInternal(value.first, value.second.as<std::string>());
+ } else {
+ OPENVINO_THROW("Unsupported configuration key: ", value.first);
+ }
+ } else {
+ OPENVINO_THROW("Unsupported configuration key: ", value.first);
+ }
+ } else {
+ if (std::get<1>(_properties[value.first]) == ov::PropertyMutability::RO) {
+ OPENVINO_THROW("READ-ONLY configuration key: ", value.first);
+ } else {
+ cfgs_to_set.emplace(value.first, value.second.as<std::string>());
+ }
+ }
+ }
+
+ if (!cfgs_to_set.empty()) {
+ _config.update(cfgs_to_set);
+ }
+}
+
+} // namespace intel_npu
diff --git a/src/plugins/intel_npu/src/plugin/src/remote_context.cpp b/src/plugins/intel_npu/src/plugin/src/remote_context.cpp
index 5823e0796f1..f089f650326 100644
--- a/src/plugins/intel_npu/src/plugin/src/remote_context.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/remote_context.cpp
@@ -4,7 +4,7 @@
#include "remote_context.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::intel_npu;
diff --git a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp
index 86f0e7c89df..a9a5efc1cf6 100644
--- a/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp
+++ b/src/plugins/intel_npu/src/utils/include/intel_npu/utils/zero/zero_types.hpp
@@ -168,6 +168,23 @@ public:
throwWhenUnsupported("ze_pfnGraphGetProperties_ext_2_t", ZE_GRAPH_EXT_VERSION_1_8);
return _impl->pfnGraphInitialize(hGraph);
}
+
+ // version 1.11
+ ze_result_t ZE_APICALL pfnCompilerGetSupportedOptions(ze_device_handle_t hDevice,
+ ze_npu_options_type_t type,
+ size_t* pSize,
+ char* pSupportedOptions) {
+ throwWhenUnsupported("pfnCompilerGetSupportedOptions", ZE_GRAPH_EXT_VERSION_1_11);
+ return _impl->pfnCompilerGetSupportedOptions(hDevice, type, pSize, pSupportedOptions);
+ }
+
+ ze_result_t ZE_APICALL pfnCompilerIsOptionSupported(ze_device_handle_t hDevice,
+ ze_npu_options_type_t type,
+ const char* pOption,
+ const char* pValue) {
+ throwWhenUnsupported("pfnCompilerIsOptionSupported", ZE_GRAPH_EXT_VERSION_1_11);
+ return _impl->pfnCompilerIsOptionSupported(hDevice, type, pOption, pValue);
+ }
};
/**
diff --git a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp
index f15b8a32991..96645f479fd 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/batched_tensors_tests/batched_run.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp
index ec6c2e66911..4d34136cb2d 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp
index a2b4f89469d..8c04ef413d3 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/fail_gracefully_forward_compatibility.hpp
@@ -19,7 +19,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common_test_utils/node_builders/constant.hpp"
#include "functional_test_utils/ov_plugin_cache.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using CompilationParams = std::tuple<std::string, // Device name
ov::AnyMap // Config
diff --git a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp
index f30fa2bb141..0cf272fd7b3 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/infer_request_run.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp
index e1254162099..0a7de671055 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/custom_stream.cpp
@@ -8,11 +8,10 @@
#include "common/functions.h"
#include "common/npu_test_env_cfg.hpp"
#include "common_test_utils/node_builders/constant.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "ir_serializer.hpp"
#include "openvino/opsets/opset11.hpp"
-
using CompilationParams = std::tuple<std::string, // Device name
ov::AnyMap // Config
>;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/downgrade_interpolate11.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/downgrade_interpolate11.cpp
index 5655d797518..ac82a37d02c 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/downgrade_interpolate11.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/downgrade_interpolate11.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp
index 58cae3b3c70..49ccba0687e 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/expected_throw.cpp
@@ -5,7 +5,7 @@
#include "expected_throw.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp
index 8df03f3451f..7a87eb0cafc 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/inputs_outputs.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp
index dcfd8067c27..3b971ba2604 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/properties_compatibility.cpp
@@ -4,7 +4,7 @@
#include "base/ov_behavior_test_utils.hpp"
#include "common/npu_test_env_cfg.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "shared_test_classes/subgraph/split_conv_concat.hpp"
using CompilationParams = std::tuple<std::string, // Device name
diff --git a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/query_network.cpp b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/query_network.cpp
index 5bb7f6dd079..057cd6d6be1 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/query_network.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/npu_driver_compiler_adapter/query_network.cpp
@@ -12,7 +12,7 @@
#include "common_test_utils/node_builders/constant.hpp"
#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp"
#include "common_test_utils/subgraph_builders/conv_pool_relu_non_zero.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using CompilationParams = std::tuple<std::string, // Device name
ov::AnyMap // Config
diff --git a/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp b/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp
index 37dd63407d7..68a391b17c5 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/ov_plugin/internal_properties_tests.cpp
@@ -137,7 +137,7 @@ TEST_P(OVCheckSetSupportedRWMetricsPropsTestsNPU, ChangeCorrectProperties) {
}
}
-const std::vector<ov::AnyMap> CorrectPluginMutableProperties = {
+const std::vector<ov::AnyMap> compat_CorrectPluginMutableProperties = {
{{ov::internal::exclusive_async_requests.name(), true}},
{{ov::intel_npu::dpu_groups.name(), 1}},
{{ov::intel_npu::dma_engines.name(), 1}},
@@ -145,31 +145,50 @@ const std::vector<ov::AnyMap> CorrectPluginMutableProperties = {
{{ov::intel_npu::platform.name(),
removeDeviceNameOnlyID(
ov::test::utils::getTestsDeviceNameFromEnvironmentOr(std::string(ov::intel_npu::Platform::AUTO_DETECT)))}},
- {{ov::intel_npu::stepping.name(), 0}},
{{ov::intel_npu::profiling_type.name(), ov::intel_npu::ProfilingType::INFER}}};
-const std::vector<ov::AnyMap> IncorrectMutablePropertiesWrongValueTypes = {
+const std::vector<ov::AnyMap> compat_IncorrectMutablePropertiesWrongValueTypes = {
{{ov::intel_npu::compilation_mode.name(), -3.6}},
- {{ov::intel_npu::stepping.name(), "V1"}},
{{ov::intel_npu::profiling_type.name(), 10}},
{{ov::intel_npu::dma_engines.name(), false}},
};
+const std::vector<ov::AnyMap> CorrectPluginMutableProperties = {
+ {{ov::intel_npu::stepping.name(), 0}},
+};
+
+const std::vector<ov::AnyMap> IncorrectMutablePropertiesWrongValueTypes = {
+ {{ov::intel_npu::stepping.name(), "V1"}},
+};
+
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
OVPropertiesTestsNPU,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(CorrectPluginMutableProperties)),
+ ::testing::ValuesIn(compat_CorrectPluginMutableProperties)),
(ov::test::utils::appendPlatformTypeTestName<OVPropertiesTestsNPU>));
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
OVPropertiesIncorrectTestsNPU,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(IncorrectMutablePropertiesWrongValueTypes)),
+ ::testing::ValuesIn(compat_IncorrectMutablePropertiesWrongValueTypes)),
(ov::test::utils::appendPlatformTypeTestName<OVPropertiesIncorrectTestsNPU>));
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVCheckSetSupportedRWMetricsPropsTestsNPU,
- ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(CorrectPluginMutableProperties)),
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU), ::testing::ValuesIn([] {
+ std::vector<ov::AnyMap> combined =
+ compat_CorrectPluginMutableProperties;
+ combined.insert(combined.end(),
+ CorrectPluginMutableProperties.begin(),
+ CorrectPluginMutableProperties.end());
+ return combined;
+ }())),
(ov::test::utils::appendPlatformTypeTestName<OVCheckSetSupportedRWMetricsPropsTestsNPU>));
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
+ OVPropertiesIncorrectTestsNPU,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(IncorrectMutablePropertiesWrongValueTypes)),
+ (ov::test::utils::appendPlatformTypeTestName<OVPropertiesIncorrectTestsNPU>));
+
} // namespace ov::test::behavior
diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp
index 8803e19533f..1c945ab77e2 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dma_buf_remote_run.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#ifdef __linux__
# include <linux/version.h>
diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp
index 163172909e7..a9e8f75090c 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/dx12_remote_run.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#ifdef _WIN32
# ifdef ENABLE_DX12
diff --git a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp
index d3e53786322..93ee3dcda4f 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/remote_tensor_tests/remote_run.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp b/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp
index c5b661344cd..bd61b3d61c9 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/replace_sw_layers.cpp
@@ -9,7 +9,7 @@
#include "common/functions.h"
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
#include "openvino/op/clamp.hpp"
#include "openvino/runtime/intel_npu/properties.hpp"
diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
index 9a472963804..fde9be94f5b 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.cpp
@@ -5,7 +5,7 @@
#include "behavior/work_with_devices.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
namespace {
diff --git a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
index dd106fbf06e..f76bbae4fc3 100644
--- a/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
+++ b/src/plugins/intel_npu/tests/functional/behavior/work_with_devices.hpp
@@ -11,8 +11,7 @@
#include "base/ov_behavior_test_utils.hpp"
#include "common/functions.h"
#include "common/npu_test_env_cfg.hpp"
-#include "intel_npu/config/common.hpp"
-#include "intel_npu/config/compiler.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
using CompilerType = ov::intel_npu::CompilerType;
diff --git a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp
index f2a48221cb4..95a5b07a376 100644
--- a/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp
+++ b/src/plugins/intel_npu/tests/functional/common/npu_test_env_cfg.cpp
@@ -7,8 +7,8 @@
#include <cstdlib>
#include <stdexcept>
-#include "intel_npu/config/common.hpp"
#include "intel_npu/config/config.hpp"
+#include "intel_npu/config/options.hpp"
namespace ov::test::utils {
diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp
index e44329c5de5..fa54f03d773 100644
--- a/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp
+++ b/src/plugins/intel_npu/tests/functional/internal/overload/compile_and_infer.hpp
@@ -9,7 +9,7 @@
#include <sstream>
#include "base/ov_behavior_test_utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
#include "intel_npu/utils/zero/zero_init.hpp"
#include "openvino/core/except.hpp"
@@ -121,9 +121,10 @@ TEST_P(OVCompileAndInferRequest, PluginWorkloadType) {
ASSERT_TRUE(is_called);
} else {
ASSERT_FALSE(workloadTypeSupported);
- OV_EXPECT_THROW_HAS_SUBSTRING(core->compile_model(function, target_device, configuration),
- ov::Exception,
- "WorkloadType property is not supported by the current Driver Version!");
+ OV_EXPECT_THROW_HAS_SUBSTRING(
+ core->compile_model(function, target_device, configuration),
+ ov::Exception,
+ "[ NOT_FOUND ] Option 'WORKLOAD_TYPE' is not supported for current configuration");
}
}
@@ -154,7 +155,7 @@ TEST_P(OVCompileAndInferRequest, CompiledModelWorkloadType) {
ASSERT_FALSE(workloadTypeSupported);
OV_EXPECT_THROW_HAS_SUBSTRING(execNet.set_property(modelConfiguration),
ov::Exception,
- "WorkloadType property is not supported by the current Driver Version!");
+ "Unsupported configuration key: WORKLOAD_TYPE");
}
}
@@ -163,9 +164,9 @@ TEST_P(OVCompileAndInferRequest, CompiledModelWorkloadTypeDelayedExecutor) {
OV_ASSERT_NO_THROW(execNet = core->compile_model(function, target_device, configuration));
ov::AnyMap modelConfiguration;
modelConfiguration[workload_type.name()] = WorkloadType::DEFAULT;
- OV_ASSERT_NO_THROW(execNet.set_property(modelConfiguration));
if (isCommandQueueExtSupported()) {
+ OV_ASSERT_NO_THROW(execNet.set_property(modelConfiguration));
ov::InferRequest req;
OV_ASSERT_NO_THROW(req = execNet.create_infer_request());
bool is_called = false;
@@ -177,9 +178,9 @@ TEST_P(OVCompileAndInferRequest, CompiledModelWorkloadTypeDelayedExecutor) {
OV_ASSERT_NO_THROW(req.wait());
ASSERT_TRUE(is_called);
} else {
- OV_EXPECT_THROW_HAS_SUBSTRING(execNet.create_infer_request(),
+ OV_EXPECT_THROW_HAS_SUBSTRING(execNet.set_property(modelConfiguration),
ov::Exception,
- "WorkloadType property is not supported by the current Driver Version!");
+ "Unsupported configuration key: WORKLOAD_TYPE");
}
}
@@ -233,17 +234,9 @@ TEST_P(OVCompileAndInferRequestTurbo, CompiledModelTurbo) {
OV_ASSERT_NO_THROW(req.wait());
ASSERT_TRUE(is_called);
} else {
- auto cr_ex = configuration.find(intel_npu::defer_weights_load.name());
- if (cr_ex->second.as<bool>() == false) {
- OV_EXPECT_THROW_HAS_SUBSTRING(core->compile_model(function, target_device, configuration),
- ov::Exception,
- "Turbo is not supported by the current driver");
- } else {
- OV_ASSERT_NO_THROW(execNet = core->compile_model(function, target_device, configuration));
- OV_EXPECT_THROW_HAS_SUBSTRING(execNet.create_infer_request(),
- ov::Exception,
- "Turbo is not supported by the current driver");
- }
+ OV_EXPECT_THROW_HAS_SUBSTRING(core->compile_model(function, target_device, configuration),
+ ov::Exception,
+ "[ NOT_FOUND ] Option 'NPU_TURBO' is not supported for current configuration");
}
}
diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp
index 6565c9bbb7a..97b6af33167 100644
--- a/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp
+++ b/src/plugins/intel_npu/tests/functional/internal/overload/compiled_model/property.cpp
@@ -9,7 +9,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
#include "common_test_utils/subgraph_builders/conv_pool_relu.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
@@ -120,17 +120,20 @@ std::vector<std::pair<std::string, ov::Any>> plugin_public_mutable_properties =
{ov::device::id.name(), ov::Any(ov::test::utils::getDeviceNameID(ov::test::utils::getDeviceName()))},
};
-std::vector<std::pair<std::string, ov::Any>> plugin_internal_mutable_properties = {
+std::vector<std::pair<std::string, ov::Any>> compat_plugin_internal_mutable_properties = {
{ov::intel_npu::compilation_mode_params.name(), ov::Any("use-user-precision=false propagate-quant-dequant=0")},
{ov::intel_npu::dma_engines.name(), ov::Any(1)},
{ov::intel_npu::platform.name(), ov::Any(ov::intel_npu::Platform::AUTO_DETECT)},
{ov::intel_npu::compilation_mode.name(), ov::Any("DefaultHW")},
- {ov::intel_npu::max_tiles.name(), ov::Any(8)},
- {ov::intel_npu::stepping.name(), ov::Any(4)},
{ov::intel_npu::dpu_groups.name(), ov::Any(2)},
{ov::intel_npu::defer_weights_load.name(), ov::Any(true)},
};
+std::vector<std::pair<std::string, ov::Any>> plugin_internal_mutable_properties = {
+ {ov::intel_npu::max_tiles.name(), ov::Any(8)},
+ {ov::intel_npu::stepping.name(), ov::Any(4)},
+};
+
std::vector<std::pair<std::string, ov::Any>> plugin_public_immutable_properties = {
{ov::device::uuid.name(), ov::Any("deadbeef")},
{ov::supported_properties.name(), {ov::device::full_name.name()}},
@@ -213,6 +216,12 @@ TEST_P(ClassPluginPropertiesTestSuite1NPU, CanSetGetInternalMutableProperty) {
}
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_ClassPluginPropertiesTestNPU,
+ ClassPluginPropertiesTestSuite1NPU,
+ ::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()),
+ ::testing::ValuesIn(compat_plugin_internal_mutable_properties)),
+ ClassPluginPropertiesTestNPU::getTestCaseName);
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests_ClassPluginPropertiesTestNPU,
ClassPluginPropertiesTestSuite1NPU,
::testing::Combine(::testing::Values(ov::test::utils::getDeviceName()),
::testing::ValuesIn(plugin_internal_mutable_properties)),
diff --git a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
index afd587e4c03..e08cb363bc0 100644
--- a/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
+++ b/src/plugins/intel_npu/tests/functional/internal/overload/ov_plugin/core_integration.hpp
@@ -17,7 +17,7 @@
#include "common_test_utils/subgraph_builders/kso_func.hpp"
#include "common_test_utils/subgraph_builders/single_concat_with_constant.hpp"
#include "common_test_utils/subgraph_builders/split_conv_concat.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using CompilationParams = std::tuple<std::string, // Device name
ov::AnyMap // Config
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp
index 637ecd7c9e7..6d848fb1844 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/compiled_model_base.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
namespace {
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp
index 6dba87612b6..da80bb51d74 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/compiled_model/import_export.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
namespace {
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 92f83e1afb9..75380fd4406 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
@@ -53,13 +53,11 @@ const std::string& expectedModelName = []() -> std::string {
return ov::test::behavior::getDefaultNGraphFunctionForTheDevice()->get_friendly_name();
}();
-const std::vector<ov::AnyMap> publicCompiledModelConfigs = {
+const std::vector<ov::AnyMap> compat_PublicCompiledModelConfigs = {
{{ov::device::id.name(), ov::Any("")}},
{{ov::hint::enable_cpu_pinning.name(), ov::Any(false)}},
{{ov::hint::model_priority.name(), ov::Any(ov::hint::Priority::MEDIUM)}},
{{ov::execution_devices.name(), ov::Any(ov::test::utils::DEVICE_NPU)}},
- {{ov::hint::execution_mode.name(), ov::Any(ov::hint::ExecutionMode::PERFORMANCE)}},
- {{ov::hint::inference_precision.name(), ov::Any(ov::element::f16)}},
{{ov::loaded_from_cache.name(), ov::Any(false)}},
{{ov::model_name.name(), ov::Any(expectedModelName)}},
{{ov::optimal_number_of_infer_requests.name(), ov::Any(1u)}},
@@ -67,6 +65,11 @@ const std::vector<ov::AnyMap> publicCompiledModelConfigs = {
{{ov::hint::num_requests.name(), ov::Any(1u)}},
{{ov::enable_profiling.name(), ov::Any(false)}}};
+const std::vector<ov::AnyMap> PublicCompiledModelConfigs = {
+ {{ov::hint::execution_mode.name(), ov::Any(ov::hint::ExecutionMode::PERFORMANCE)}},
+ {{ov::hint::inference_precision.name(), ov::Any(ov::element::f16)}},
+};
+
const std::vector<ov::AnyMap> compiledModelIncorrectConfigs = {
{{"NPU_INEXISTENT_PROPERTY", "NPU_INEXISTENT_PROPERTY_VALUE"}}};
@@ -257,7 +260,13 @@ INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
OVClassCompiledModelPropertiesDefaultTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(publicCompiledModelConfigs)),
+ ::testing::ValuesIn(compat_PublicCompiledModelConfigs)),
+ ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesDefaultTests>);
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
+ OVClassCompiledModelPropertiesDefaultTests,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(PublicCompiledModelConfigs)),
ov::test::utils::appendPlatformTypeTestName<OVClassCompiledModelPropertiesDefaultTests>);
INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp
index 7ea165117a5..2fd9a768614 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/callback.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "overload/ov_infer_request/callback.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp
index d3170e6a384..df859315096 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/cancellation.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "overload/ov_infer_request/cancellation.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp
index 97769cbea9b..11d5b7d80ab 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/inference_chaining.cpp
@@ -7,7 +7,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
#include "common_test_utils/test_constants.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp
index 92bb52e62a8..62edaa33aa1 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/io_tensor.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "overload/ov_infer_request/io_tensor.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp
index 49b6eed00bb..ac0038aa380 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/multithreading.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "overload/ov_infer_request/multithreading.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp
index f7197d15c98..0cf6186681f 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/perf_counters.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp
index 0d163c3cae9..af1b2fe3193 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_infer_request/wait.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
index e73e5ce9819..1cdcd24ba0a 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/caching_tests.cpp
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp
index f04890e16e8..682940c7be0 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/core_integration.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
#include "common_test_utils/data_utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "openvino/runtime/intel_npu/properties.hpp"
using namespace ov::test::behavior;
diff --git a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp
index 4379a89d642..fc370c47404 100644
--- a/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp
+++ b/src/plugins/intel_npu/tests/functional/shared_tests_instances/behavior/ov_plugin/life_time.cpp
@@ -6,7 +6,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "overload/ov_plugin/life_time.hpp"
using namespace ov::test::behavior;
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 76f93947171..8e36fc742fa 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
@@ -8,7 +8,7 @@
#include "common/npu_test_env_cfg.hpp"
#include "common/utils.hpp"
-#include "intel_npu/config/common.hpp"
+#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
#include "openvino/runtime/intel_cpu/properties.hpp"
#include "openvino/runtime/intel_gpu/properties.hpp"
@@ -36,24 +36,32 @@ ov::log::Level getTestsLogLevelFromEnvironmentOr(ov::log::Level instead) {
return instead;
}
-const std::vector<ov::AnyMap> CorrectPluginMutableProperties = {
+const std::vector<ov::AnyMap> compat_CorrectPluginMutableProperties = {
// OV
{{ov::hint::performance_mode.name(), ov::hint::PerformanceMode::THROUGHPUT}},
- {{ov::hint::execution_mode.name(), ov::hint::ExecutionMode::ACCURACY}},
{{ov::hint::num_requests.name(), 2u}},
{{ov::log::level.name(), ov::log::Level::ERR}},
{{ov::device::id.name(), removeDeviceNameOnlyID(ov::test::utils::getTestsPlatformFromEnvironmentOr("3720"))}},
{{ov::enable_profiling.name(), true}},
};
-const std::vector<ov::AnyMap> CorrectPluginDefaultMutableProperties = {
+const std::vector<ov::AnyMap> CorrectPluginMutableProperties = {
+ // OV
+ {{ov::hint::execution_mode.name(), ov::hint::ExecutionMode::ACCURACY}},
+};
+
+const std::vector<ov::AnyMap> compat_CorrectPluginDefaultMutableProperties = {
/// OV
{{ov::enable_profiling.name(), false}},
{{ov::hint::performance_mode.name(), ov::hint::PerformanceMode::LATENCY}},
{{ov::hint::num_requests.name(), 1u}},
- {{ov::log::level.name(), getTestsLogLevelFromEnvironmentOr(ov::log::Level::NO)}},
+ {{ov::log::level.name(), getTestsLogLevelFromEnvironmentOr(ov::log::Level::WARNING)}},
{{ov::device::id.name(), ""}},
{{ov::num_streams.name(), ov::streams::Num(1)}},
+};
+
+const std::vector<ov::AnyMap> CorrectPluginDefaultMutableProperties = {
+ /// OV
{{ov::hint::execution_mode.name(), ov::hint::ExecutionMode::PERFORMANCE}},
};
@@ -140,6 +148,12 @@ const std::vector<ov::AnyMap> IncorrectInexistingProperties = {
{{ov::intel_gpu::hint::queue_throttle.name(), ov::intel_gpu::hint::ThrottleLevel::HIGH}}};
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
+ OVPropertiesTests,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(compat_CorrectPluginMutableProperties)),
+ (ov::test::utils::appendPlatformTypeTestName<OVPropertiesTests>));
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVPropertiesTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(CorrectPluginMutableProperties)),
@@ -164,6 +178,12 @@ INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests_OVClassCommon,
(ov::test::utils::appendPlatformTypeTestName<OVBasicPropertiesTestsP>));
INSTANTIATE_TEST_SUITE_P(compatibility_smoke_BehaviorTests,
+ OVPropertiesDefaultTests,
+ ::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
+ ::testing::ValuesIn(compat_CorrectPluginDefaultMutableProperties)),
+ (ov::test::utils::appendPlatformTypeTestName<OVPropertiesDefaultTests>));
+
+INSTANTIATE_TEST_SUITE_P(smoke_BehaviorTests,
OVPropertiesDefaultTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
::testing::ValuesIn(CorrectPluginDefaultMutableProperties)),
@@ -173,7 +193,7 @@ INSTANTIATE_TEST_SUITE_P(
smoke_BehaviorTests_OVCheckSetSupportedRWMetricsPropsTests,
OVCheckSetSupportedRWMetricsPropsTests,
::testing::Combine(::testing::Values(ov::test::utils::DEVICE_NPU),
- ::testing::ValuesIn(getRWMandatoryPropertiesValues(CorrectPluginMutableProperties))),
+ ::testing::ValuesIn(getRWMandatoryPropertiesValues(compat_CorrectPluginMutableProperties))),
(ov::test::utils::appendPlatformTypeTestName<OVCheckSetSupportedRWMetricsPropsTests>));
INSTANTIATE_TEST_SUITE_P(
diff --git a/src/plugins/intel_npu/thirdparty/level-zero-ext b/src/plugins/intel_npu/thirdparty/level-zero-ext
index c0156a3390a..24108f3d688 160000
--- a/src/plugins/intel_npu/thirdparty/level-zero-ext
+++ b/src/plugins/intel_npu/thirdparty/level-zero-ext
@@ -1 +1 @@
-Subproject commit c0156a3390ae39671ff8f2a6f5471f04bb65bb12
+Subproject commit 24108f3d6889b2d878896f0f97ec793d36fe800f