Skip to content

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

NPUW: Deduplicate plugin options (#34797)

Dmitry Matveev94140ffac29d
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 26766745bb1..52a409686b1 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
@@ -8,7 +8,6 @@
#include "intel_npu/config/options.hpp"
#include "intel_npu/npu_private_properties.hpp"
-#include "intel_npu/npuw_private_properties.hpp"
namespace ov {
namespace npuw {
@@ -41,37 +40,33 @@ ov::AnyMap stringToAnyMap(const std::string& var);
namespace intel_npu {
-//
-// register
-//
-
void registerNPUWOptions(OptionsDesc& desc);
void registerNPUWLLMOptions(OptionsDesc& desc);
void registerNPUWKokoroOptions(OptionsDesc& desc);
-#define DEFINE_OPT(Name, Type, DefaultValue, PropertyKey, Mode) \
- struct Name final : OptionBase<Name, Type> { \
- static std::string_view key() { \
- return ov::intel_npu::PropertyKey.name(); \
- } \
- \
- static Type defaultValue() { \
- return DefaultValue; \
- } \
- \
- static OptionMode mode() { \
- return OptionMode::Mode; \
- } \
+#define DEFINE_NPUW_SIMPLE_OPT(Name, Type, DefaultValue, KeyLiteral) \
+ struct Name final : OptionBase<Name, Type> { \
+ static std::string_view key() { \
+ return KeyLiteral; \
+ } \
+ \
+ static Type defaultValue() { \
+ return DefaultValue; \
+ } \
+ \
+ static OptionMode mode() { \
+ return OptionMode::RunTime; \
+ } \
};
-#define DEFINE_ANYMAP_OPT(Name, PropertyKey) \
+#define DEFINE_NPUW_ANYMAP_OPT(Name, KeyLiteral) \
struct Name final : OptionBase<Name, ov::AnyMap> { \
static std::string_view key() { \
- return ov::intel_npu::PropertyKey.name(); \
+ return KeyLiteral; \
} \
\
static constexpr std::string_view getTypeName() { \
- return "::intel_npu::" #PropertyKey; \
+ return "ov::AnyMap"; \
} \
\
static ov::AnyMap defaultValue() { \
@@ -95,85 +90,6 @@ void registerNPUWKokoroOptions(OptionsDesc& desc);
} \
};
-DEFINE_OPT(NPU_USE_NPUW, bool, false, use_npuw, RunTime);
-DEFINE_OPT(NPUW_DEVICES, std::string, "NPU,CPU", npuw::devices, RunTime);
-DEFINE_OPT(NPUW_SUBMODEL_DEVICE, std::string, "", npuw::submodel_device, RunTime);
-DEFINE_OPT(NPUW_ONLINE_PIPELINE, std::string, "REG", npuw::partitioning::online::pipeline, RunTime);
-DEFINE_OPT(NPUW_ONLINE_AVOID, std::string, "", npuw::partitioning::online::avoid, RunTime);
-DEFINE_OPT(NPUW_ONLINE_ISOLATE, std::string, "", npuw::partitioning::online::isolate, RunTime);
-DEFINE_OPT(NPUW_ONLINE_NO_FOLD, std::string, "", npuw::partitioning::online::nofold, RunTime);
-DEFINE_OPT(NPUW_ONLINE_MIN_SIZE, std::size_t, 10, npuw::partitioning::online::min_size, RunTime);
-DEFINE_OPT(NPUW_ONLINE_KEEP_BLOCKS, std::size_t, 5, npuw::partitioning::online::keep_blocks, RunTime);
-DEFINE_OPT(NPUW_ONLINE_KEEP_BLOCK_SIZE, std::size_t, 10, npuw::partitioning::online::keep_block_size, RunTime);
-DEFINE_OPT(NPUW_ONLINE_DUMP_PLAN, std::string, "", npuw::partitioning::online::dump_plan, RunTime);
-DEFINE_OPT(NPUW_PLAN, std::string, "", npuw::partitioning::plan, RunTime);
-DEFINE_OPT(NPUW_FOLD, bool, false, npuw::partitioning::fold, RunTime);
-DEFINE_OPT(NPUW_CWAI, bool, false, npuw::partitioning::cwai, RunTime);
-DEFINE_OPT(NPUW_DQ, bool, false, npuw::partitioning::dyn_quant, RunTime);
-DEFINE_OPT(NPUW_DQ_FULL, bool, true, npuw::partitioning::dyn_quant_full, RunTime);
-DEFINE_OPT(NPUW_PMM, std::string, "2", npuw::partitioning::par_matmul_merge_dims, RunTime);
-DEFINE_OPT(NPUW_MM_GATED, bool, true, npuw::partitioning::matmul_gate_preserve_constants, RunTime);
-DEFINE_OPT(NPUW_SLICE_OUT, bool, false, npuw::partitioning::slice_out, RunTime);
-DEFINE_OPT(NPUW_HOST_GATHER, bool, true, npuw::partitioning::host_gather, RunTime);
-DEFINE_OPT(NPUW_SPATIAL, bool, false, npuw::partitioning::spatial, RunTime);
-DEFINE_OPT(NPUW_F16IC, bool, true, npuw::partitioning::f16_interconnect, RunTime);
-DEFINE_OPT(NPUW_SPATIAL_NWAY, std::size_t, 128, npuw::partitioning::spatial_nway, RunTime);
-DEFINE_OPT(NPUW_SPATIAL_DYN, bool, true, npuw::partitioning::spatial_dyn, RunTime);
-DEFINE_OPT(NPUW_MOE_TOKEN_CHUNK_SIZE, uint64_t, 0, npuw::partitioning::moe_token_chunk_size, RunTime);
-DEFINE_OPT(NPUW_MOE_POOL_SIZE, std::size_t, 8, npuw::partitioning::moe_pool_size, RunTime);
-DEFINE_OPT(NPUW_ATTN, std::string, "STATIC", npuw::partitioning::attn, RunTime);
-DEFINE_OPT(NPUW_ATTN_DYN, bool, true, npuw::partitioning::attn_dyn, RunTime);
-DEFINE_OPT(NPUW_ATTN_NO_COPY, bool, false, npuw::partitioning::attn_no_copy, RunTime);
-DEFINE_OPT(NPUW_ATTN_HFA_FUSED, bool, false, npuw::partitioning::attn_hfa_fused, RunTime);
-DEFINE_OPT(NPUW_DCOFF_TYPE, std::string, "", npuw::partitioning::dcoff_type, RunTime);
-DEFINE_OPT(NPUW_DCOFF_SCALE, bool, false, npuw::partitioning::dcoff_with_scale, RunTime);
-DEFINE_OPT(NPUW_FUNCALL_FOR_ALL, bool, false, npuw::partitioning::funcall_for_all, RunTime);
-DEFINE_OPT(NPUW_PARALLEL_COMPILE, bool, false, npuw::parallel_compilation, RunTime);
-DEFINE_OPT(NPUW_WEIGHTS_BANK, std::string, "", npuw::weights_bank, RunTime);
-DEFINE_OPT(NPUW_WEIGHTS_BANK_ALLOC, std::string, "", npuw::weights_bank_alloc, RunTime);
-DEFINE_OPT(NPUW_CACHE_DIR, std::string, "", npuw::cache_dir, RunTime);
-DEFINE_OPT(NPUW_FUNCALL_ASYNC, bool, false, npuw::funcall_async, RunTime);
-DEFINE_OPT(NPUW_UNFOLD_IREQS, bool, false, npuw::unfold_ireqs, RunTime);
-DEFINE_OPT(NPUW_FALLBACK_EXEC, bool, true, npuw::fallback_exec, RunTime);
-DEFINE_OPT(NPUW_ACC_CHECK, bool, false, npuw::accuracy::check, RunTime);
-DEFINE_OPT(NPUW_ACC_THRESH, double, 0.01, npuw::accuracy::threshold, RunTime);
-DEFINE_OPT(NPUW_ACC_DEVICE, std::string, "", npuw::accuracy::reference_device, RunTime);
-DEFINE_OPT(NPUW_DUMP_FULL, bool, false, npuw::dump::full, RunTime);
-DEFINE_OPT(NPUW_DUMP_SUBS, std::string, "", npuw::dump::subgraphs, RunTime);
-DEFINE_OPT(NPUW_DUMP_SUBS_DIR, std::string, "", npuw::dump::subgraphs_dir, RunTime);
-DEFINE_OPT(NPUW_DUMP_SUBS_ON_FAIL, std::string, "", npuw::dump::subgraphs_on_fail, RunTime);
-DEFINE_OPT(NPUW_DUMP_IO, std::string, "", npuw::dump::inputs_outputs, RunTime);
-DEFINE_OPT(NPUW_DUMP_IO_ITERS, bool, false, npuw::dump::io_iters, RunTime);
-DEFINE_OPT(NPUW_LLM, bool, false, npuw::llm::enabled, RunTime);
-DEFINE_OPT(NPUW_LLM_BATCH_DIM, uint32_t, 0, npuw::llm::batch_dim, RunTime);
-DEFINE_OPT(NPUW_LLM_SEQ_LEN_DIM, uint32_t, 2, npuw::llm::seq_len_dim, RunTime);
-DEFINE_OPT(NPUW_LLM_MAX_PROMPT_LEN, uint32_t, 1024, npuw::llm::max_prompt_len, RunTime);
-DEFINE_OPT(NPUW_LLM_MAX_GENERATION_TOKEN_LEN, uint32_t, 1, npuw::llm::max_generation_token_len, RunTime);
-DEFINE_OPT(NPUW_LLM_MIN_RESPONSE_LEN, uint32_t, 128, npuw::llm::min_response_len, RunTime);
-DEFINE_OPT(NPUW_LLM_OPTIMIZE_V_TENSORS, bool, true, npuw::llm::optimize_v_tensors, RunTime);
-DEFINE_OPT(NPUW_LLM_CACHE_ROPE, bool, true, npuw::llm::cache_rope, RunTime);
-DEFINE_OPT(NPUW_LLM_GENERATE_PYRAMID, bool, false, npuw::llm::generate_pyramid, RunTime);
-DEFINE_OPT(NPUW_LLM_PREFILL_CHUNK_SIZE, uint64_t, 1024, npuw::llm::prefill_chunk_size, RunTime);
-DEFINE_OPT(NPUW_LLM_SHARED_HEAD, bool, true, npuw::llm::shared_lm_head, RunTime);
-DEFINE_OPT(NPUW_KOKORO, bool, false, npuw::kokoro::enabled, RunTime);
-DEFINE_OPT(NPUW_KOKORO_BLOCK_SIZE, uint64_t, 200, npuw::kokoro::block_size, RunTime);
-DEFINE_OPT(NPUW_KOKORO_OVERLAP_SIZE, uint64_t, 20, npuw::kokoro::overlap_size, RunTime);
-DEFINE_OPT(NPUW_LLM_MAX_LORA_RANK, uint32_t, 32, npuw::llm::max_lora_rank, RunTime);
-DEFINE_OPT(NPUW_LLM_OPTIMIZE_FP8, bool, false, npuw::llm::optimize_fp8, RunTime);
-DEFINE_OPT(NPUW_LLM_ENABLE_PREFIX_CACHING, bool, false, npuw::llm::enable_prefix_caching, RunTime);
-DEFINE_OPT(NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE, uint64_t, 256, npuw::llm::prefix_caching_block_size, RunTime);
-DEFINE_OPT(NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS, uint64_t, 128, npuw::llm::prefix_caching_max_num_blocks, RunTime);
-DEFINE_OPT(NPUW_WHISPER, bool, false, npuw::whisper::enabled, RunTime);
-DEFINE_OPT(NPUW_WHISPER_EOS_TOKEN, uint64_t, 50257, npuw::whisper::whisper_eos_token, RunTime);
-DEFINE_OPT(NPUW_EAGLE, bool, false, npuw::eagle::enabled, RunTime);
-DEFINE_OPT(NPUW_TEXT_EMBED, bool, false, npuw::text_embed::enabled, RunTime);
-DEFINE_ANYMAP_OPT(NPUW_LLM_PREFILL_CONFIG, npuw::llm::prefill_config);
-DEFINE_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_PREFILL_CONFIG, npuw::llm::additional_prefill_config);
-DEFINE_ANYMAP_OPT(NPUW_LLM_GENERATE_CONFIG, npuw::llm::generate_config);
-DEFINE_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_GENERATE_CONFIG, npuw::llm::additional_generate_config);
-DEFINE_ANYMAP_OPT(NPUW_LLM_SHARED_LM_HEAD_CONFIG, npuw::llm::shared_lm_head_config);
-DEFINE_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_SHARED_LM_HEAD_CONFIG, npuw::llm::additional_shared_lm_head_config);
-
namespace npuw {
namespace llm {
enum class PrefillHint { DYNAMIC, STATIC };
@@ -183,207 +99,197 @@ enum class MoEHint { DENSE, HOST_ROUTED, DEVICE_ROUTED };
} // namespace llm
} // namespace npuw
-struct NPUW_LLM_PREFILL_HINT final : OptionBase<NPUW_LLM_PREFILL_HINT, ::intel_npu::npuw::llm::PrefillHint> {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::prefill_hint.name();
- }
+enum class NPUWOptionGroup { ROOT, LLM, KOKORO };
+enum class NPUWOptionSurface { EXPOSED, HIDDEN };
+enum class NPUWOptionCaching { CACHED, UNCACHED };
+enum class NPUWOptionBuild { ALL, DEV };
+
+template <typename Option>
+struct NPUWOptionMeta;
+
+namespace detail {
+template <typename T>
+struct TypeTag {
+ using type = T;
+};
+} // namespace detail
+
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+inline constexpr bool kIsNPUWDeveloperBuild = true;
+#else
+inline constexpr bool kIsNPUWDeveloperBuild = false;
+#endif
+
+template <NPUWOptionBuild Build>
+inline constexpr bool kIsNPUWBuildEnabled = Build == NPUWOptionBuild::ALL || kIsNPUWDeveloperBuild;
+
+template <typename EnumType>
+struct NPUWStringEnumOptionTraits;
+
+template <>
+struct NPUWStringEnumOptionTraits<::intel_npu::npuw::llm::PrefillHint> {
+ using ValueType = ::intel_npu::npuw::llm::PrefillHint;
static constexpr std::string_view getTypeName() {
return "::intel_npu::npuw::llm::PrefillHint";
}
- static ::intel_npu::npuw::llm::PrefillHint defaultValue() {
- return ::intel_npu::npuw::llm::PrefillHint::DYNAMIC;
+ static ValueType defaultValue() {
+ return ValueType::DYNAMIC;
}
- static ::intel_npu::npuw::llm::PrefillHint parse(std::string_view val) {
+ static ValueType parse(std::string_view val) {
if (val == "DYNAMIC") {
- return ::intel_npu::npuw::llm::PrefillHint::DYNAMIC;
+ return ValueType::DYNAMIC;
} else if (val == "STATIC") {
- return ::intel_npu::npuw::llm::PrefillHint::STATIC;
+ return ValueType::STATIC;
}
OPENVINO_THROW("Unsupported \"PREFILL_HINT\" provided: ", val);
- return {};
}
- static std::string toString(const ::intel_npu::npuw::llm::PrefillHint& val) {
+ static std::string toString(const ValueType& val) {
switch (val) {
- case ::intel_npu::npuw::llm::PrefillHint::DYNAMIC:
+ case ValueType::DYNAMIC:
return "DYNAMIC";
- case ::intel_npu::npuw::llm::PrefillHint::STATIC:
+ case ValueType::STATIC:
return "STATIC";
default:
OPENVINO_THROW("Can't convert provided \"PREFILL_HINT\" : ", int(val), " to string.");
}
- return {};
}
+};
- static OptionMode mode() {
- return OptionMode::RunTime;
+template <>
+struct NPUWStringEnumOptionTraits<::intel_npu::npuw::llm::GenerateHint> {
+ using ValueType = ::intel_npu::npuw::llm::GenerateHint;
+
+ static constexpr std::string_view getTypeName() {
+ return "::intel_npu::npuw::llm::GenerateHint";
}
- static bool isPublic() {
- return false;
+ static ValueType defaultValue() {
+ return ValueType::FAST_COMPILE;
+ }
+
+ static ValueType parse(std::string_view val) {
+ if (val == "FAST_COMPILE") {
+ return ValueType::FAST_COMPILE;
+ } else if (val == "BEST_PERF") {
+ return ValueType::BEST_PERF;
+ }
+ OPENVINO_THROW("Unsupported \"GENERATE_HINT\" provided: ",
+ val,
+ ". Please select either \"FAST_COMPILE\" or \"BEST_PERF\".");
+ }
+
+ static std::string toString(const ValueType& val) {
+ switch (val) {
+ case ValueType::FAST_COMPILE:
+ return "FAST_COMPILE";
+ case ValueType::BEST_PERF:
+ return "BEST_PERF";
+ default:
+ OPENVINO_THROW("Can't convert provided \"GENERATE_HINT\" : ", int(val), " to string.");
+ }
}
};
-struct ATTN_HINT_BASE : OptionBase<ATTN_HINT_BASE, ::intel_npu::npuw::llm::AttentionHint> {
+template <>
+struct NPUWStringEnumOptionTraits<::intel_npu::npuw::llm::AttentionHint> {
+ using ValueType = ::intel_npu::npuw::llm::AttentionHint;
+
static constexpr std::string_view getTypeName() {
return "::intel_npu::npuw::llm::AttentionHint";
}
- static ::intel_npu::npuw::llm::AttentionHint defaultValue() {
- return ::intel_npu::npuw::llm::AttentionHint::STATIC;
+ static ValueType defaultValue() {
+ return ValueType::STATIC;
}
- static ::intel_npu::npuw::llm::AttentionHint parse(std::string_view val) {
+ static ValueType parse(std::string_view val) {
if (val == "DYNAMIC") {
- return ::intel_npu::npuw::llm::AttentionHint::DYNAMIC;
+ return ValueType::DYNAMIC;
} else if (val == "STATIC") {
- return ::intel_npu::npuw::llm::AttentionHint::STATIC;
+ return ValueType::STATIC;
} else if (val == "PYRAMID") {
- return ::intel_npu::npuw::llm::AttentionHint::PYRAMID;
+ return ValueType::PYRAMID;
} else if (val == "HFA") {
- return ::intel_npu::npuw::llm::AttentionHint::HFA;
+ return ValueType::HFA;
}
OPENVINO_THROW("Unsupported attention hint provided: ", val);
- return {};
}
- static std::string toString(const ::intel_npu::npuw::llm::AttentionHint& val) {
+ static std::string toString(const ValueType& val) {
switch (val) {
- case ::intel_npu::npuw::llm::AttentionHint::DYNAMIC:
+ case ValueType::DYNAMIC:
return "DYNAMIC";
- case ::intel_npu::npuw::llm::AttentionHint::STATIC:
+ case ValueType::STATIC:
return "STATIC";
- case ::intel_npu::npuw::llm::AttentionHint::PYRAMID:
+ case ValueType::PYRAMID:
return "PYRAMID";
- case ::intel_npu::npuw::llm::AttentionHint::HFA:
+ case ValueType::HFA:
return "HFA";
default:
OPENVINO_THROW("Can't convert provided attention hint : ", int(val), " to string.");
}
- return {};
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-struct NPUW_LLM_GENERATE_ATTENTION_HINT final : ATTN_HINT_BASE {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::generate_attn_hint.name();
}
};
-struct NPUW_LLM_PREFILL_ATTENTION_HINT final : ATTN_HINT_BASE {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::prefill_attn_hint.name();
- }
-};
+template <>
+struct NPUWStringEnumOptionTraits<::intel_npu::npuw::llm::MoEHint> {
+ using ValueType = ::intel_npu::npuw::llm::MoEHint;
-struct MOE_HINT_BASE : OptionBase<MOE_HINT_BASE, ::intel_npu::npuw::llm::MoEHint> {
static constexpr std::string_view getTypeName() {
return "::intel_npu::npuw::llm::MoEHint";
}
- static ::intel_npu::npuw::llm::MoEHint defaultValue() {
- return ::intel_npu::npuw::llm::MoEHint::HOST_ROUTED;
+ static ValueType defaultValue() {
+ return ValueType::HOST_ROUTED;
}
- static ::intel_npu::npuw::llm::MoEHint parse(std::string_view val) {
+ static ValueType parse(std::string_view val) {
if (val == "DENSE") {
- return ::intel_npu::npuw::llm::MoEHint::DENSE;
+ return ValueType::DENSE;
} else if (val == "HOST_ROUTED") {
- return ::intel_npu::npuw::llm::MoEHint::HOST_ROUTED;
+ return ValueType::HOST_ROUTED;
} else if (val == "DEVICE_ROUTED") {
- return ::intel_npu::npuw::llm::MoEHint::DEVICE_ROUTED;
+ return ValueType::DEVICE_ROUTED;
}
OPENVINO_THROW("Unsupported MoE hint provided: ", val);
- return {};
}
- static std::string toString(const ::intel_npu::npuw::llm::MoEHint& val) {
+ static std::string toString(const ValueType& val) {
switch (val) {
- case ::intel_npu::npuw::llm::MoEHint::DENSE:
+ case ValueType::DENSE:
return "DENSE";
- case ::intel_npu::npuw::llm::MoEHint::HOST_ROUTED:
+ case ValueType::HOST_ROUTED:
return "HOST_ROUTED";
- case ::intel_npu::npuw::llm::MoEHint::DEVICE_ROUTED:
+ case ValueType::DEVICE_ROUTED:
return "DEVICE_ROUTED";
default:
OPENVINO_THROW("Can't convert provided MoE hint : ", int(val), " to string.");
}
- return {};
- }
-
- static OptionMode mode() {
- return OptionMode::RunTime;
- }
-
- static bool isPublic() {
- return false;
- }
-};
-
-struct NPUW_LLM_PREFILL_MOE_HINT final : MOE_HINT_BASE {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::prefill_moe_hint.name();
- }
-};
-
-struct NPUW_LLM_GENERATE_MOE_HINT final : MOE_HINT_BASE {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::generate_moe_hint.name();
}
};
-struct NPUW_LLM_GENERATE_HINT final : OptionBase<NPUW_LLM_GENERATE_HINT, ::intel_npu::npuw::llm::GenerateHint> {
- static std::string_view key() {
- return ov::intel_npu::npuw::llm::generate_hint.name();
- }
+template <class ActualOpt, class Traits>
+struct NPUWStringEnumOptionBase : OptionBase<ActualOpt, typename Traits::ValueType> {
+ using ValueType = typename Traits::ValueType;
static constexpr std::string_view getTypeName() {
- return "::intel_npu::npuw::llm::GenerateHint";
+ return Traits::getTypeName();
}
- static ::intel_npu::npuw::llm::GenerateHint defaultValue() {
- return ::intel_npu::npuw::llm::GenerateHint::FAST_COMPILE;
+ static ValueType defaultValue() {
+ return Traits::defaultValue();
}
- static ::intel_npu::npuw::llm::GenerateHint parse(std::string_view val) {
- ::intel_npu::npuw::llm::GenerateHint res;
-
- if (val == "FAST_COMPILE") {
- res = ::intel_npu::npuw::llm::GenerateHint::FAST_COMPILE;
- } else if (val == "BEST_PERF") {
- res = ::intel_npu::npuw::llm::GenerateHint::BEST_PERF;
- } else {
- OPENVINO_THROW("Unsupported \"GENERATE_HINT\" provided: ",
- val,
- ". Please select either \"FAST_COMPILE\" or \"BEST_PERF\".");
- }
- return res;
+ static ValueType parse(std::string_view val) {
+ return Traits::parse(val);
}
- static std::string toString(const ::intel_npu::npuw::llm::GenerateHint& val) {
- std::string res;
- switch (val) {
- case ::intel_npu::npuw::llm::GenerateHint::FAST_COMPILE:
- res = "FAST_COMPILE";
- break;
- case ::intel_npu::npuw::llm::GenerateHint::BEST_PERF:
- res = "BEST_PERF";
- break;
- default:
- OPENVINO_THROW("Can't convert provided \"GENERATE_HINT\" : ", int(val), " to string.");
- }
- return res;
+ static std::string toString(const ValueType& val) {
+ return Traits::toString(val);
}
static OptionMode mode() {
@@ -394,4 +300,138 @@ struct NPUW_LLM_GENERATE_HINT final : OptionBase<NPUW_LLM_GENERATE_HINT, ::intel
return false;
}
};
+
+#define DEFINE_NPUW_STRING_ENUM_OPT(Name, Traits, KeyLiteral) \
+ struct Name final : NPUWStringEnumOptionBase<Name, Traits> { \
+ static std::string_view key() { \
+ return KeyLiteral; \
+ } \
+ };
+
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ DEFINE_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, KEY)
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ DEFINE_NPUW_STRING_ENUM_OPT(OPT, NPUWStringEnumOptionTraits<TYPE>, KEY)
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ DEFINE_NPUW_ANYMAP_OPT(OPT, KEY)
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef DEFINE_NPUW_STRING_ENUM_OPT
+#undef DEFINE_NPUW_ANYMAP_OPT
+#undef DEFINE_NPUW_SIMPLE_OPT
+
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ template <> \
+ struct NPUWOptionMeta<OPT> { \
+ using ConfigValueType = TYPE; \
+ using PropertyValueType = TYPE; \
+ static constexpr auto group = NPUWOptionGroup::GROUP; \
+ static constexpr auto surface = NPUWOptionSurface::SURFACE; \
+ static constexpr auto caching = NPUWOptionCaching::CACHING; \
+ static constexpr auto build = NPUWOptionBuild::BUILD; \
+ static constexpr std::string_view key() { \
+ return KEY; \
+ } \
+ };
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ template <> \
+ struct NPUWOptionMeta<OPT> { \
+ using ConfigValueType = TYPE; \
+ using PropertyValueType = std::string; \
+ static constexpr auto group = NPUWOptionGroup::GROUP; \
+ static constexpr auto surface = NPUWOptionSurface::SURFACE; \
+ static constexpr auto caching = NPUWOptionCaching::CACHING; \
+ static constexpr auto build = NPUWOptionBuild::BUILD; \
+ static constexpr std::string_view key() { \
+ return KEY; \
+ } \
+ };
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ template <> \
+ struct NPUWOptionMeta<OPT> { \
+ using ConfigValueType = ov::AnyMap; \
+ using PropertyValueType = ov::AnyMap; \
+ static constexpr auto group = NPUWOptionGroup::GROUP; \
+ static constexpr auto surface = NPUWOptionSurface::SURFACE; \
+ static constexpr auto caching = NPUWOptionCaching::CACHING; \
+ static constexpr auto build = NPUWOptionBuild::BUILD; \
+ static constexpr std::string_view key() { \
+ return KEY; \
+ } \
+ };
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+
+template <NPUWOptionGroup Group, typename Fn>
+void for_each_npuw_option(Fn&& fn) {
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS, VARNAME, KEY, ENTRY_GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (Group == NPUWOptionGroup::ENTRY_GROUP && kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS, VARNAME, KEY, ENTRY_GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (Group == NPUWOptionGroup::ENTRY_GROUP && kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS, VARNAME, KEY, ENTRY_GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (Group == NPUWOptionGroup::ENTRY_GROUP && kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+}
+
+template <typename Fn>
+void for_each_exposed_npuw_option(Fn&& fn) {
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionSurface::SURFACE == NPUWOptionSurface::EXPOSED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionSurface::SURFACE == NPUWOptionSurface::EXPOSED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionSurface::SURFACE == NPUWOptionSurface::EXPOSED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+}
+
+template <typename Fn>
+void for_each_cached_npuw_option(Fn&& fn) {
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionCaching::CACHING == NPUWOptionCaching::CACHED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionCaching::CACHING == NPUWOptionCaching::CACHED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS, VARNAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ if constexpr (NPUWOptionCaching::CACHING == NPUWOptionCaching::CACHED && \
+ kIsNPUWBuildEnabled<NPUWOptionBuild::BUILD>) { \
+ fn(detail::TypeTag<OPT>{}); \
+ }
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+}
+
} // namespace intel_npu
+
+#include "intel_npu/npuw_private_properties.hpp"
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw_option_defs.inc b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw_option_defs.inc
new file mode 100644
index 00000000000..da573e30e99
--- /dev/null
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/config/npuw_option_defs.inc
@@ -0,0 +1,84 @@
+INTEL_NPU_NPUW_SIMPLE_OPT(NPU_USE_NPUW, bool, false, ov::intel_npu, use_npuw, "NPU_USE_NPUW", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DEVICES, std::string, "NPU,CPU", ov::intel_npu::npuw, devices, "NPUW_DEVICES", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_SUBMODEL_DEVICE, std::string, "", ov::intel_npu::npuw, submodel_device, "NPUW_SUBMODEL_DEVICE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_PIPELINE, std::string, "REG", ov::intel_npu::npuw::partitioning::online, pipeline, "NPUW_ONLINE_PIPELINE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_AVOID, std::string, "", ov::intel_npu::npuw::partitioning::online, avoid, "NPUW_ONLINE_AVOID", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_ISOLATE, std::string, "", ov::intel_npu::npuw::partitioning::online, isolate, "NPUW_ONLINE_ISOLATE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_NO_FOLD, std::string, "", ov::intel_npu::npuw::partitioning::online, nofold, "NPUW_ONLINE_NO_FOLD", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_MIN_SIZE, std::size_t, 10, ov::intel_npu::npuw::partitioning::online, min_size, "NPUW_ONLINE_MIN_SIZE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_KEEP_BLOCKS, std::size_t, 5, ov::intel_npu::npuw::partitioning::online, keep_blocks, "NPUW_ONLINE_KEEP_BLOCKS", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_KEEP_BLOCK_SIZE, std::size_t, 10, ov::intel_npu::npuw::partitioning::online, keep_block_size, "NPUW_ONLINE_KEEP_BLOCK_SIZE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ONLINE_DUMP_PLAN, std::string, "", ov::intel_npu::npuw::partitioning::online, dump_plan, "NPUW_ONLINE_DUMP_PLAN", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_PLAN, std::string, "", ov::intel_npu::npuw::partitioning, plan, "NPUW_PLAN", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_FOLD, bool, false, ov::intel_npu::npuw::partitioning, fold, "NPUW_FOLD", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_CWAI, bool, false, ov::intel_npu::npuw::partitioning, cwai, "NPUW_CWAI", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DQ, bool, false, ov::intel_npu::npuw::partitioning, dyn_quant, "NPUW_DQ", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DQ_FULL, bool, true, ov::intel_npu::npuw::partitioning, dyn_quant_full, "NPUW_DQ_FULL", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_PMM, std::string, "2", ov::intel_npu::npuw::partitioning, par_matmul_merge_dims, "NPUW_PMM", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_MM_GATED, bool, true, ov::intel_npu::npuw::partitioning, matmul_gate_preserve_constants, "NPUW_MM_GATED", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_SLICE_OUT, bool, false, ov::intel_npu::npuw::partitioning, slice_out, "NPUW_SLICE_OUT", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_HOST_GATHER, bool, true, ov::intel_npu::npuw::partitioning, host_gather, "NPUW_HOST_GATHER", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_SPATIAL, bool, false, ov::intel_npu::npuw::partitioning, spatial, "NPUW_SPATIAL", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_F16IC, bool, true, ov::intel_npu::npuw::partitioning, f16_interconnect, "NPUW_F16IC", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_SPATIAL_NWAY, std::size_t, 128, ov::intel_npu::npuw::partitioning, spatial_nway, "NPUW_SPATIAL_NWAY", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_SPATIAL_DYN, bool, true, ov::intel_npu::npuw::partitioning, spatial_dyn, "NPUW_SPATIAL_DYN", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_MOE_TOKEN_CHUNK_SIZE, uint64_t, 0, ov::intel_npu::npuw::partitioning, moe_token_chunk_size, "NPUW_MOE_TOKEN_CHUNK_SIZE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_MOE_POOL_SIZE, std::size_t, 8, ov::intel_npu::npuw::partitioning, moe_pool_size, "NPUW_MOE_POOL_SIZE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ATTN, std::string, "STATIC", ov::intel_npu::npuw::partitioning, attn, "NPUW_ATTN", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ATTN_DYN, bool, true, ov::intel_npu::npuw::partitioning, attn_dyn, "NPUW_ATTN_DYN", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ATTN_NO_COPY, bool, false, ov::intel_npu::npuw::partitioning, attn_no_copy, "NPUW_ATTN_NO_COPY", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ATTN_HFA_FUSED, bool, false, ov::intel_npu::npuw::partitioning, attn_hfa_fused, "NPUW_ATTN_HFA_FUSED", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DCOFF_TYPE, std::string, "", ov::intel_npu::npuw::partitioning, dcoff_type, "NPUW_DCOFF_TYPE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DCOFF_SCALE, bool, false, ov::intel_npu::npuw::partitioning, dcoff_with_scale, "NPUW_DCOFF_SCALE", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_FUNCALL_FOR_ALL, bool, false, ov::intel_npu::npuw::partitioning, funcall_for_all, "NPUW_FUNCALL_FOR_ALL", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_PARALLEL_COMPILE, bool, false, ov::intel_npu::npuw, parallel_compilation, "NPUW_PARALLEL_COMPILE", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_WEIGHTS_BANK, std::string, "", ov::intel_npu::npuw, weights_bank, "NPUW_WEIGHTS_BANK", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_WEIGHTS_BANK_ALLOC, std::string, "", ov::intel_npu::npuw, weights_bank_alloc, "NPUW_WEIGHTS_BANK_ALLOC", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_CACHE_DIR, std::string, "", ov::intel_npu::npuw, cache_dir, "NPUW_CACHE_DIR", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_FUNCALL_ASYNC, bool, false, ov::intel_npu::npuw, funcall_async, "NPUW_FUNCALL_ASYNC", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_UNFOLD_IREQS, bool, false, ov::intel_npu::npuw, unfold_ireqs, "NPUW_UNFOLD_IREQS", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_FALLBACK_EXEC, bool, true, ov::intel_npu::npuw, fallback_exec, "NPUW_FALLBACK_EXEC", ROOT, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ACC_CHECK, bool, false, ov::intel_npu::npuw::accuracy, check, "NPUW_ACC_CHECK", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ACC_THRESH, double, 0.01, ov::intel_npu::npuw::accuracy, threshold, "NPUW_ACC_THRESH", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_ACC_DEVICE, std::string, "", ov::intel_npu::npuw::accuracy, reference_device, "NPUW_ACC_DEVICE", ROOT, HIDDEN, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_FULL, bool, false, ov::intel_npu::npuw::dump, full, "NPUW_DUMP_FULL", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_SUBS, std::string, "", ov::intel_npu::npuw::dump, subgraphs, "NPUW_DUMP_SUBS", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_SUBS_DIR, std::string, "", ov::intel_npu::npuw::dump, subgraphs_dir, "NPUW_DUMP_SUBS_DIR", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_SUBS_ON_FAIL, std::string, "", ov::intel_npu::npuw::dump, subgraphs_on_fail, "NPUW_DUMP_SUBS_ON_FAIL", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_IO, std::string, "", ov::intel_npu::npuw::dump, inputs_outputs, "NPUW_DUMP_IO", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_DUMP_IO_ITERS, bool, false, ov::intel_npu::npuw::dump, io_iters, "NPUW_DUMP_IO_ITERS", ROOT, HIDDEN, UNCACHED, DEV)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM, bool, false, ov::intel_npu::npuw::llm, enabled, "NPUW_LLM", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_BATCH_DIM, uint32_t, 0, ov::intel_npu::npuw::llm, batch_dim, "NPUW_LLM_BATCH_DIM", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_SEQ_LEN_DIM, uint32_t, 2, ov::intel_npu::npuw::llm, seq_len_dim, "NPUW_LLM_SEQ_LEN_DIM", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_MAX_PROMPT_LEN, uint32_t, 1024, ov::intel_npu::npuw::llm, max_prompt_len, "NPUW_LLM_MAX_PROMPT_LEN", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_MAX_GENERATION_TOKEN_LEN, uint32_t, 1, ov::intel_npu::npuw::llm, max_generation_token_len, "NPUW_LLM_MAX_GENERATION_TOKEN_LEN", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_MIN_RESPONSE_LEN, uint32_t, 128, ov::intel_npu::npuw::llm, min_response_len, "NPUW_LLM_MIN_RESPONSE_LEN", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_OPTIMIZE_V_TENSORS, bool, true, ov::intel_npu::npuw::llm, optimize_v_tensors, "NPUW_LLM_OPTIMIZE_V_TENSORS", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_GENERATE_PYRAMID, bool, false, ov::intel_npu::npuw::llm, generate_pyramid, "NPUW_LLM_GENERATE_PYRAMID", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_PREFILL_CHUNK_SIZE, uint64_t, 1024, ov::intel_npu::npuw::llm, prefill_chunk_size, "NPUW_LLM_PREFILL_CHUNK_SIZE", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_SHARED_HEAD, bool, true, ov::intel_npu::npuw::llm, shared_lm_head, "NPUW_LLM_SHARED_HEAD", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_MAX_LORA_RANK, uint32_t, 32, ov::intel_npu::npuw::llm, max_lora_rank, "NPUW_LLM_MAX_LORA_RANK", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_OPTIMIZE_FP8, bool, false, ov::intel_npu::npuw::llm, optimize_fp8, "NPUW_LLM_OPTIMIZE_FP8", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_ENABLE_PREFIX_CACHING, bool, false, ov::intel_npu::npuw::llm, enable_prefix_caching, "NPUW_LLM_ENABLE_PREFIX_CACHING", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE, uint64_t, 256, ov::intel_npu::npuw::llm, prefix_caching_block_size, "NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS, uint64_t, 128, ov::intel_npu::npuw::llm, prefix_caching_max_num_blocks, "NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_LLM_CACHE_ROPE, bool, true, ov::intel_npu::npuw::llm, cache_rope, "NPUW_LLM_CACHE_ROPE", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_PREFILL_MOE_HINT, ::intel_npu::npuw::llm::MoEHint, MoEHintOptionTraits, ov::intel_npu::npuw::llm, prefill_moe_hint, "NPUW_LLM_PREFILL_MOE_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_GENERATE_MOE_HINT, ::intel_npu::npuw::llm::MoEHint, MoEHintOptionTraits, ov::intel_npu::npuw::llm, generate_moe_hint, "NPUW_LLM_GENERATE_MOE_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_PREFILL_HINT, ::intel_npu::npuw::llm::PrefillHint, PrefillHintOptionTraits, ov::intel_npu::npuw::llm, prefill_hint, "NPUW_LLM_PREFILL_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_GENERATE_HINT, ::intel_npu::npuw::llm::GenerateHint, GenerateHintOptionTraits, ov::intel_npu::npuw::llm, generate_hint, "NPUW_LLM_GENERATE_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_PREFILL_ATTENTION_HINT, ::intel_npu::npuw::llm::AttentionHint, AttentionHintOptionTraits, ov::intel_npu::npuw::llm, prefill_attn_hint, "NPUW_LLM_PREFILL_ATTENTION_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_STRING_ENUM_OPT(NPUW_LLM_GENERATE_ATTENTION_HINT, ::intel_npu::npuw::llm::AttentionHint, AttentionHintOptionTraits, ov::intel_npu::npuw::llm, generate_attn_hint, "NPUW_LLM_GENERATE_ATTENTION_HINT", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_PREFILL_CONFIG, ov::intel_npu::npuw::llm, prefill_config, "NPUW_LLM_PREFILL_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_PREFILL_CONFIG, ov::intel_npu::npuw::llm, additional_prefill_config, "++NPUW_LLM_PREFILL_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_GENERATE_CONFIG, ov::intel_npu::npuw::llm, generate_config, "NPUW_LLM_GENERATE_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_GENERATE_CONFIG, ov::intel_npu::npuw::llm, additional_generate_config, "++NPUW_LLM_GENERATE_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_SHARED_LM_HEAD_CONFIG, ov::intel_npu::npuw::llm, shared_lm_head_config, "NPUW_LLM_SHARED_HEAD_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_ANYMAP_OPT(NPUW_LLM_ADDITIONAL_SHARED_LM_HEAD_CONFIG, ov::intel_npu::npuw::llm, additional_shared_lm_head_config, "++NPUW_LLM_SHARED_HEAD_CONFIG", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_WHISPER, bool, false, ov::intel_npu::npuw::whisper, enabled, "NPUW_WHISPER", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_WHISPER_EOS_TOKEN, uint64_t, 50257, ov::intel_npu::npuw::whisper, whisper_eos_token, "NPUW_WHISPER_EOS_TOKEN", LLM, EXPOSED, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_EAGLE, bool, false, ov::intel_npu::npuw::eagle, enabled, "NPUW_EAGLE", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_TEXT_EMBED, bool, false, ov::intel_npu::npuw::text_embed, enabled, "NPUW_TEXT_EMBED", LLM, EXPOSED, CACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_KOKORO, bool, false, ov::intel_npu::npuw::kokoro, enabled, "NPUW_KOKORO", KOKORO, EXPOSED, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_KOKORO_BLOCK_SIZE, uint64_t, 200, ov::intel_npu::npuw::kokoro, block_size, "NPUW_KOKORO_BLOCK_SIZE", KOKORO, EXPOSED, UNCACHED, ALL)
+INTEL_NPU_NPUW_SIMPLE_OPT(NPUW_KOKORO_OVERLAP_SIZE, uint64_t, 20, ov::intel_npu::npuw::kokoro, overlap_size, "NPUW_KOKORO_OVERLAP_SIZE", KOKORO, EXPOSED, UNCACHED, ALL)
diff --git a/src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp b/src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp
index 6ef738ff16b..6b8c668f200 100644
--- a/src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp
+++ b/src/plugins/intel_npu/src/al/include/intel_npu/npuw_private_properties.hpp
@@ -4,824 +4,48 @@
#pragma once
+#include "intel_npu/config/npuw.hpp"
#include "openvino/runtime/file_handle.hpp"
#include "openvino/runtime/intel_npu/properties.hpp"
-namespace ov {
-namespace intel_npu {
-/**
- * @brief
- * Type: bool
- * Set this option to true to utilize NPUW extension
- * Default value: false
- */
-static constexpr ov::Property<bool> use_npuw{"NPU_USE_NPUW"};
+namespace ov::intel_npu::detail {
-namespace npuw {
-/**
- * @brief
- * Type: std::string
- * Device list to try in order.
- * Possible values: Comma-separated list of devices. E.g., "NPU,GPU,CPU".
- * Default value: "NPU,CPU"
- */
-static constexpr ov::Property<std::string> devices{"NPUW_DEVICES"};
+template <typename Option>
+using NPUWProperty = ov::Property<typename ::intel_npu::NPUWOptionMeta<Option>::PropertyValueType>;
-/**
- * @brief
- * Type: std::string.
- * Force the specific subgraph to specific device. The device must be present in the NPUW_DEVICES list.
- * Possible values: Comma-separated "Subgraph index:OpenVINO device name" pairs, "last" keyword can be
- * used for last subgraph, e.g. "0:CPU,1:NPU,last:CPU".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> submodel_device{"NPUW_SUBMODEL_DEVICE"};
+template <typename Option>
+inline constexpr NPUWProperty<Option> npuw_property{::intel_npu::NPUWOptionMeta<Option>::key().data()};
-/**
- * @brief
- * Type: std::string.
- * Specify bank name to utilize for a particular model.
- * Possible values: any std::string as a name.
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> weights_bank{"NPUW_WEIGHTS_BANK"};
+} // namespace ov::intel_npu::detail
-/**
- * @brief
- * Type: std::string.
- * Specify device name for weights bank which is used to allocate memory.
- * Default value: "".
- */
-static constexpr ov::Property<std::string> weights_bank_alloc{"NPUW_WEIGHTS_BANK_ALLOC"};
+namespace ov::intel_npu::npuw {
-/**
- * @brief
- * Type: ov::FileHandleProvider.
- * Callback function to get file handle for weights (cross-platform).
- * The callback takes no arguments and returns a platform-specific file handle.
- * On Linux/Unix: returns int (file descriptor)
- * On Windows: returns void* (HANDLE)
- * This is useful for scenarios where file access needs to be controlled externally,
- * such as Android content providers or restricted file access scenarios.
- * Default value: nullptr.
- */
-static constexpr ov::Property<ov::FileHandleProvider> weights_handle_provider{"NPUW_WEIGHTS_HANDLE_PROVIDER"};
+inline constexpr ov::Property<ov::FileHandleProvider> weights_handle_provider{"NPUW_WEIGHTS_HANDLE_PROVIDER"};
-/**
- * @brief
- * Type: std::string.
- * Specify a directory where to store cached submodels.
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> cache_dir{"NPUW_CACHE_DIR"};
+} // namespace ov::intel_npu::npuw
-namespace partitioning {
-namespace online {
-/**
- * @brief
- * Type: std::string.
- * Specify which partitioning pipeline to run.
- * Possible values: "NONE", "INIT", "JUST", "REP", "REG", "COMPUTE", "SPATIAL".
- * Default value: "REG".
- */
-static constexpr ov::Property<std::string> pipeline{"NPUW_ONLINE_PIPELINE"};
+#define INTEL_NPU_NPUW_DECLARE_PROPERTY_ALIAS(OPT, NS_PATH, NAME) \
+ namespace NS_PATH { \
+ inline constexpr const auto& NAME = ::ov::intel_npu::detail::npuw_property<::intel_npu::OPT>; \
+ }
-/**
- * @brief
- * Type: std::string.
- * Forbids operation(s) and/or predefined pattern(s) to compile and run on a
- * specified device. Only compatible with online partitioning.
- * Possible values: comma-separated list of operations slash device, e.g.
- * "Op:Select/NPU,P:RMSNorm/NPU".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> avoid{"NPUW_ONLINE_AVOID"};
+#define INTEL_NPU_NPUW_IF_BUILD_ALL(OPT, NS_PATH, NAME) INTEL_NPU_NPUW_DECLARE_PROPERTY_ALIAS(OPT, NS_PATH, NAME)
+#ifdef NPU_PLUGIN_DEVELOPER_BUILD
+# define INTEL_NPU_NPUW_IF_BUILD_DEV(OPT, NS_PATH, NAME) INTEL_NPU_NPUW_DECLARE_PROPERTY_ALIAS(OPT, NS_PATH, NAME)
+#else
+# define INTEL_NPU_NPUW_IF_BUILD_DEV(OPT, NS_PATH, NAME)
+#endif
-/**
- * @brief
- * Type: std::string.
- * Isolates predefined pattern(s) to compile and run separately from other isolated tags and no tags.
- * Only compatible with online partitioning.
- * Possible values: comma-separated list of layer or pattern name slash tag, e.g.
- * "Op:Select/compute2,P:DQMatMulGQ/compute,P:DQMatMulCW/compute,P:RMSNorm/compute".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> isolate{"NPUW_ONLINE_ISOLATE"};
-
-/**
- * @brief
- * Type: std::string.
- * Make a specific tag introduced via NPUW_ONLINE_ISOLATE a non-foldable one.
- * Only compatible with online partitioning.
- * Possible values: comma-separated list of tags, e.g.
- * "compute,compute2".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> nofold{"NPUW_ONLINE_NO_FOLD"};
-
-/**
- * @brief
- * Type: std::size_t.
- * Lower boundary of partition graph size the plugin can generate.
- * Used to control fusion term criteria in online partitioning.
- * Only compatible with online partitioning.
- * Possible values: Integer >= 10.
- * Default value: 10.
- */
-static constexpr ov::Property<std::size_t> min_size{"NPUW_ONLINE_MIN_SIZE"};
-
-/**
- * @brief
- * Type: std::size_t.
- * Sets the minimum number of repeating groups of the same pattern the plugin will keep in the partitioning.
- * Used to control fusion term criteria in online partitioning.
- * Only compatible with online partitioning.
- * Possible values: Integer > 0.
- * Default value: 5.
- */
-static constexpr ov::Property<std::size_t> keep_blocks{"NPUW_ONLINE_KEEP_BLOCKS"};
-
-/**
- * @brief
- * Type: std::size_t.
- * Sets the minimum group size (in layers) within the same pattern the plugin will keep in the partitioning.
- * Used to control fusion term criteria in online partitioning.
- * Only compatible with online partitioning.
- * Possible values: Integer > 0.
- * Default value: 10.
- */
-static constexpr ov::Property<std::size_t> keep_block_size{"NPUW_ONLINE_KEEP_BLOCK_SIZE"};
-
-/**
- * @brief
- * Type: std::string.
- * Dump online partitioning to the specified file.
- * This partitioning can be reused via NPUW_PLAN property later.
- * Possible values: Path to .xml file.
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> dump_plan{"NPUW_ONLINE_DUMP_PLAN"};
-} // namespace online
-
-/**
- * @brief
- * Type: std::string.
- * Set plan file to use by offline partitioning.
- * Possible values: Path to .xml file.
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> plan{"NPUW_PLAN"};
-
-/**
- * @brief
- * Type: bool.
- * Perform function call folding if there are repeating blocks in the graph.
- * Default value: false.
- */
-static constexpr ov::Property<bool> fold{"NPUW_FOLD"};
-
-/**
- * @brief
- * Type: bool.
- * Cut-off weights from repeating blocks, but don't do folding.
- * Decompression cut-off may still happen. Conflicts with NPUW_FOLD.
- * Default value: false.
- */
-static constexpr ov::Property<bool> cwai{"NPUW_CWAI"};
-
-/**
- * @brief
- * Type: bool.
- * Apply dynamic quantization transformations at the plugin side.
- * Default value: false.
- */
-static constexpr ov::Property<bool> dyn_quant{"NPUW_DQ"};
-
-/**
- * @brief
- * Type: bool.
- * Apply the full DQ transformation pipeline in the plugin.
- * Default value: true.
- */
-static constexpr ov::Property<bool> dyn_quant_full{"NPUW_DQ_FULL"};
-
-/**
- * @brief
- * Type: string.
- * Identify and merge parallel MatMuls over dimension(s) specified.
- * When set to YES, applies transformation for all dimensions.
- * Works with FOLD enabled only.
- * Set to NO or pass empty value to disable the option.
- * Default value: 2.
- */
-static constexpr ov::Property<std::string> par_matmul_merge_dims{"NPUW_PMM"};
-
-/**
- * @brief
- * Type: bool.
- * whether to preserve constants for gated version of matmul
- * on some version of compiler - might produce incorrect results when enabled
- * Default value: YES
- */
-static constexpr ov::Property<bool> matmul_gate_preserve_constants{"NPUW_MM_GATED"};
-
-/**
- * @brief
- * Type: bool.
- * Add Slice before the last MatMul reducing output's dimention.
- * Default value: false.
- */
-static constexpr ov::Property<bool> slice_out{"NPUW_SLICE_OUT"};
-
-/**
- * @brief
- * Type: boolean.
- * Enable spatial execution for selected subgraphs. Requires COMPUTE isolation.
- * Default value: false
- */
-static constexpr ov::Property<bool> spatial{"NPUW_SPATIAL"};
-
-/**
- * @brief
- * Type: std::size_t.
- * Submission size for the spatial execution.
- * Default value: 128
- */
-static constexpr ov::Property<std::size_t> spatial_nway{"NPUW_SPATIAL_NWAY"};
-
-/**
- * @brief
- * Type: boolean.
- * Enable dynamic submission for spatial subgraphs. Requires SPATIAL pipeline to be selected.
- * Default value: true
- */
-static constexpr ov::Property<bool> spatial_dyn{"NPUW_SPATIAL_DYN"};
-
-/**
- * @brief
- * Type: uint64_t.
- * MoE expert model compilation strategy for prefill stage token chunking.
- *
- * When set to 0 (default): Compiles multiple expert models with different chunk sizes
- * {16, 32, 64, 128, 256} for dynamic chunk selection at runtime. This provides optimal
- * performance by selecting the best chunk size based on remaining tokens.
- *
- * When set to a specific value (e.g., 128, 256): Compiles only a single expert model
- * with the specified fixed chunk size. This reduces compilation time and memory usage but
- * may not be optimal for all token counts.
- *
- * The chunk size should be a power of two for best hardware utilization.
- * Note: This only affects prefill stage (multi-token inference). Decoding stage (single token)
- * always uses a dedicated model regardless of this setting.
- *
- * Default value: 0 (dynamic multi-model compilation).
- */
-static constexpr ov::Property<uint64_t> moe_token_chunk_size{"NPUW_MOE_TOKEN_CHUNK_SIZE"};
-
-/**
- * @brief Configure MoE request pool size per layer for caching expert configurations.
- *
- * Controls the number of pre-allocated inference requests per MoE layer to cache
- * different expert combinations. Using LRU eviction when pool is full.
- * Setting to 0 disables the MoE request cache entirely.
- *
- * Type: std::size_t.
- * Default value: 8 (cache up to 8 expert configurations per layer).
- */
-static constexpr ov::Property<std::size_t> moe_pool_size{"NPUW_MOE_POOL_SIZE"};
-
-/**
- * @brief
- * Type: std::string.
- * Select attention optimization mode when attention block detected.
- * Possible values: "DYNAMIC", "STATIC", "PYRAMID", "HFA"
- * Default value: "STATIC"
- */
-static constexpr ov::Property<std::string> attn{"NPUW_ATTN"};
-
-/**
- * @brief
- * Type: boolean.
- * Enable dynamic dispatch for the attention block, if detected
- * Default value: true
- */
-static constexpr ov::Property<bool> attn_dyn{"NPUW_ATTN_DYN"};
-
-/**
- * @brief
- * Type: boolean.
- * Force no-copy mode for the attention block, if detected
- * Default value: false
- */
-static constexpr ov::Property<bool> attn_no_copy{"NPUW_ATTN_NO_COPY"};
-
-/**
- * @brief
- * Type: boolean.
- * Use flash attention implementation from the compiler for the attention block, if attn set to HFA
- * Default value: true
- */
-static constexpr ov::Property<bool> attn_hfa_fused{"NPUW_ATTN_HFA_FUSED"};
-
-/**
- * @brief
- * Type: boolean
- * Force subgraph interconnect tensors to f16 precision if those are in f32
- * Default value: false
- */
-static constexpr ov::Property<bool> f16_interconnect{"NPUW_F16IC"};
-
-/**
- * @brief
- * Type: boolean
- * When applicable, do embedding gather on host.
- * Default value: true.
- */
-static constexpr ov::Property<bool> host_gather{"NPUW_HOST_GATHER"};
-
-/**
- * @brief
- * Type: std::string.
- * Promotional data type for weights decompression. Works only with function "NPUW_FOLD"ing.
- * Possible values: "i8", "f16"
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> dcoff_type{"NPUW_DCOFF_TYPE"};
-
-/**
- * @brief
- * Type: bool.
- * Include weights scaling into the decompression procedure (and exclude it from function bodies).
- * Works only with function "NPUW_FOLD"ing.
- * Default value: false.
- */
-static constexpr ov::Property<bool> dcoff_with_scale{"NPUW_DCOFF_SCALE"};
-
-/**
- * @brief
- * Type: bool.
- * Every subgraph will be turned into a function.
- * Warning: May cause performance issues!
- * Default value: false.
- */
-static constexpr ov::Property<bool> funcall_for_all{"NPUW_FUNCALL_FOR_ALL"};
-} // namespace partitioning
-
-/**
- * @brief
- * Type: bool.
- * Employ parallel subgraph compilation. Disabled by default due to instabilities.
- * Default value: false.
- */
-static constexpr ov::Property<bool> parallel_compilation{"NPUW_PARALLEL_COMPILE"};
-
-/**
- * @brief
- * Type: bool.
- * Pipeline execution of functions (repeating blocks) and their prologues
- * (e.g., where weights decompression may happen).
- * Default value: false.
- */
-static constexpr ov::Property<bool> funcall_async{"NPUW_FUNCALL_ASYNC"};
-
-/**
- * @brief
- * Type: boolean
- * Create individual infer requests for partitiongs, even repeating.
- * Default value: false.
- */
-static constexpr ov::Property<bool> unfold_ireqs{"NPUW_UNFOLD_IREQS"};
-
-/**
- * @brief
- * Type: boolean
- * Fallback in case of runtime failure
- * Default value: true.
- */
-static constexpr ov::Property<bool> fallback_exec{"NPUW_FALLBACK_EXEC"};
-
-namespace accuracy {
-/**
- * @brief
- * Type: bool.
- * Enable accuracy check for inference to make infer requests
- * tolerant to accuracy fails
- * Default value: false.
- */
-static constexpr ov::Property<bool> check{"NPUW_ACC_CHECK"};
-
-/**
- * @brief
- * Type: double.
- * Threshold for accuracy validators, to indicate that metric
- * returns successfull comparison.
- * Possible values: Double floating-point value from 0.0 to 1.0.
- * Default value: 0.1.
- */
-static constexpr ov::Property<double> threshold{"NPUW_ACC_THRESH"};
-
-/**
- * @brief
- * Type: std::string.
- * Reference device, giving accurate results for given model(s).
- * Possible values: device name, e.g. "CPU".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> reference_device{"NPUW_ACC_DEVICE"};
-} // namespace accuracy
-
-namespace dump {
-/**
- * @brief
- * Type: std::string.
- * Dump the whole model in its original form (as plugin gets it, before any partitioning is done).
- * Default value: false.
- */
-static constexpr ov::Property<bool> full{"NPUW_DUMP_FULL"};
-
-/**
- * @brief
- * Type: std::string.
- * Dump the specified subgraph(s) in OpenVINO IR form in the current directory.
- * Possible values: Comma-separated list of subgraph indices ("last" can be used
- * for dumping last subgraph without specifying it by specific index), "YES" for
- * all subgraphs, "MIN" for representative subgraph subset (all non-repeated and
- * one instance of repeated block), "NO" or just empty value to turn option off.
- * E.g. "0,1" or "0,1,last" or "YES".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> subgraphs{"NPUW_DUMP_SUBS"};
-
-/**
- * @brief
- * Type: std::string.
- * Directory path for dumping subgraph models (.xml).
- * Default behavior: when this property is not set or set to an empty string,
- * the current working directory is used. Any non-empty value is interpreted
- * as a directory path.
- */
-static constexpr ov::Property<std::string> subgraphs_dir{"NPUW_DUMP_SUBS_DIR"};
-
-/**
- * @brief
- * Type: std::string.
- * Dump subgraph on disk if a compilation failure happens.
- * Possible values: Comma-separated list of subgraph indices ("last" can be used
- * for dumping last subgraph) or "YES" for all subgraphs, "MIN" for representative
- * subgraph subset, "NO" or just empty value to turn option off. E.g. "0,1" or
- * "0,1,last" or "YES".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> subgraphs_on_fail{"NPUW_DUMP_SUBS_ON_FAIL"};
-
-/**
- * @brief
- * Type: std::string.
- * Dump input & output tensors for subgraph(s).
- * Possible values: Comma-separated list of subgraph indices ("last" can be used for
- * last subgraph) or "YES" for all subgraphs, "MIN" for representative subgraph subset,
- * "NO" or just empty value to turn option off. E.g. "0,1" or "0,1,last" or "YES".
- * Default value: empty.
- */
-static constexpr ov::Property<std::string> inputs_outputs{"NPUW_DUMP_IO"};
-
-/**
- * @brief
- * Type: std::string.
- * Dump input & output tensors for subgraph(s) for every iteration.
- * WARNING: may exhaust the disk space quickly.
- * Default value: false.
- */
-static constexpr ov::Property<std::string> io_iters{"NPUW_DUMP_IO_ITERS"};
-} // namespace dump
-
-namespace llm {
-/**
- * @brief
- * Type: bool.
- * Tell NPUW that you want to pass dynamic stateful LLM model.
- * Default value: false.
- */
-static constexpr ov::Property<bool> enabled{"NPUW_LLM"};
-
-/**
- * @brief
- * FIXME: Should be removed.
- * Type: uint32_t.
- * Dimension of the batch in input tensor shape.
- * Default value: 0.
- */
-static constexpr ov::Property<uint32_t> batch_dim{"NPUW_LLM_BATCH_DIM"};
-
-/**
- * @brief
- * FIXME: Should be removed.
- * Type: uint32_t.
- * Dimension of KV-Cache size in input tensor shape.
- * Default value: 2.
- */
-static constexpr ov::Property<uint32_t> seq_len_dim{"NPUW_LLM_SEQ_LEN_DIM"};
-
-/**
- * @brief
- * Type: uint32_t.
- * Desirable max prompt length.
- * Default value: 1024.
- */
-static constexpr ov::Property<uint32_t> max_prompt_len{"NPUW_LLM_MAX_PROMPT_LEN"};
-
-/**
-+ * @brief
-+ * Type: uint32_t.
-+ * Desirable max input token length for generation.
-+ * Default value: 1.
-+ */
-static constexpr ov::Property<uint32_t> max_generation_token_len{"NPUW_LLM_MAX_GENERATION_TOKEN_LEN"};
-
-/**
- * @brief
- * Type: uint32_t.
- * Desirable min response length.
- * Default value: 128.
- */
-static constexpr ov::Property<uint32_t> min_response_len{"NPUW_LLM_MIN_RESPONSE_LEN"};
-
-/**
- * @brief
- * Type: uint32_t.
- * Desirable max LoRA rank.
- * Default value: 32.
- */
-static constexpr ov::Property<uint32_t> max_lora_rank{"NPUW_LLM_MAX_LORA_RANK"};
-
-/**
- * @brief
- * FIXME: Should be removed.
- * Type: bool.
- * Tell NPUW to apply values transpose optimization for the model.
- * Default value: false.
- */
-static constexpr ov::Property<bool> optimize_v_tensors{"NPUW_LLM_OPTIMIZE_V_TENSORS"};
-
-/**
- * @brief
- * Type: bool.
- * Tell NPUW to apply fp8 static quantisation pass from openvino low_precision library
- * Default value: false.
- */
-static constexpr ov::Property<bool> optimize_fp8{"NPUW_LLM_OPTIMIZE_FP8"};
-
-/**
- * @brief
- * Type: boolean
- * Substitute part of the RoPE with compile-time precalculation in higher precision
- * Default value: true.
- */
-static constexpr ov::Property<bool> cache_rope{"NPUW_LLM_CACHE_ROPE"};
-
-/**
- * @brief
- * Type: ::intel_npu::npuw::llm::MoEHint
- * Specify MoE (Mixture of Experts) implementation strategy for prefill stage
- * Possible values: DENSE, HOST_ROUTED, DEVICE_ROUTED
- * Default value: HOST_ROUTED (recommended for prefill to avoid NPU-unfriendly operations)
- */
-static constexpr ov::Property<std::string> prefill_moe_hint{"NPUW_LLM_PREFILL_MOE_HINT"};
-
-/**
- * @brief
- * Type: ::intel_npu::npuw::llm::MoEHint
- * Specify MoE (Mixture of Experts) implementation strategy for generate/decoding stage
- * Possible values: DENSE, HOST_ROUTED, DEVICE_ROUTED
- * Default value: HOST_ROUTED (DEVICE_ROUTED recommended for better decoding performance)
- */
-static constexpr ov::Property<std::string> generate_moe_hint{"NPUW_LLM_GENERATE_MOE_HINT"};
-
-/**
- * @brief
- * Type: boolean
- * Enable multiple generate model variants with different static shapes (1K, 2K, 4K, 8K stepping).
- * When enabled, multiple generate models will be compiled and the appropriate one will be
- * selected at runtime based on the required KV cache size.
- * Default value: false.
- */
-static constexpr ov::Property<bool> generate_pyramid{"NPUW_LLM_GENERATE_PYRAMID"};
-
-/**
- * @brief
- * Type: uint64_t.
- * Prompt chunk size for chunk prefill.
- * The chunk size should be a power of two.
- * Chunk prefill feature is disabled in case the value is 0.
- * Default value: 1024.
- */
-static constexpr ov::Property<uint64_t> prefill_chunk_size{"NPUW_LLM_PREFILL_CHUNK_SIZE"};
-
-/**
- * @brief
- * Type: bool.
- * This toggle enables the prefix caching feature.
- * When activated, it stores the prefilled key-value pairs (KV) for current prompts in the cache during each
- * conversation round.
- * In subsequent rounds, if the prompt's KV is found in the cache, it allows skipping the prefill for certain tokens,
- * thereby enhancing the latency of the first token.
- * Default value: false.
- */
-static constexpr ov::Property<uint64_t> enable_prefix_caching{"NPUW_LLM_ENABLE_PREFIX_CACHING"};
-
-/**
- * @brief
- * Type: uint64_t.
- * Prefilled KV tensors are cached in blocks when prefix caching is enabled.
- * This value describes the number of tokens in each block.
- * This value should be not greater than prefill_chunk_size.
- * Default value: 256.
- */
-static constexpr ov::Property<uint64_t> prefix_caching_block_size{"NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE"};
-
-/**
- * @brief
- * Type: uint64_t.
- * Prefilled KV tensors are cached in blocks when prefix caching is enabled.
- * This value describes the maximum number of blocks in cache.
- * Default value: 128.
- */
-static constexpr ov::Property<uint64_t> prefix_caching_max_num_blocks{"NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS"};
-
-/**
- * @brief
- * Type: std::string.
- * Hint for prefill stage. NPUW will use optimal configuration based on the passed preference via hint.
- * Passing this hint with "NPUW_LLM_PREFILL_CONFIG" will generate a error.
- * Possible values: "DYNAMIC", "STATIC".
- * Default value: "DYNAMIC".
- */
-static constexpr ov::Property<std::string> prefill_hint{"NPUW_LLM_PREFILL_HINT"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Configuration for compilation/execution of prefill model. If specified, it will override default
- * config, prepared by NPUW specifically for this model.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> prefill_config{"NPUW_LLM_PREFILL_CONFIG"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Additional configuration for compilation/execution of prefill model. If specified, it
- * will be appended to the default configuration, prepared by NPUW.
- * For duplicated options, preference will be given to values from given map.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> additional_prefill_config{"++NPUW_LLM_PREFILL_CONFIG"};
-
-/**
- * @brief
- * Type: std::string.
- * Hint for the attention handling in prefill stage. NPUW will use optimal configuration based on the passed preference
- * via hint. Possible values: "DYNAMIC", "STATIC". Default value: "STATIC".
- */
-static constexpr ov::Property<std::string> prefill_attn_hint{"NPUW_LLM_PREFILL_ATTENTION_HINT"};
-
-/**
- * @brief
- * Type: std::string.
- * Hint for generation stage. NPUW will use optimal configuration based on the passed preference via hint.
- * Passing this hint with "NPUW_LLM_GENERATE_CONFIG" will generate a error.
- * Possible values: "FAST_COMPILE", "BEST_PERF".
- * Default value: "FAST_COMPILE".
- */
-static constexpr ov::Property<std::string> generate_hint{"NPUW_LLM_GENERATE_HINT"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Configuration for compilation/execution of generate model. If specified, it will override default
- * config, prepared by NPUW specifically for this model.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> generate_config{"NPUW_LLM_GENERATE_CONFIG"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Configuration for compilation/execution of generate model. If specified, it
- * will be appended to the default configuration, prepared by NPUW.
- * For duplicated options, preference will be given to values from given map.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> additional_generate_config{"++NPUW_LLM_GENERATE_CONFIG"};
-
-/**
- * @brief
- * Type: std::string.
- * Hint for the attention handling in generate stage. NPUW will use optimal configuration based on the passed preference
- * via hint. Possible values: "DYNAMIC", "STATIC". Default value: "STATIC".
- */
-static constexpr ov::Property<std::string> generate_attn_hint{"NPUW_LLM_GENERATE_ATTENTION_HINT"};
-
-/**
- * @brief
- * Type: bool.
- * Tell NPUW to separate LM head into the 3rd model, that will be shared between
- * prefill and generate.
- * Default value: true.
- */
-static constexpr ov::Property<bool> shared_lm_head{"NPUW_LLM_SHARED_HEAD"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Configuration for compilation/execution of shared LM head model. If specified, it will override
- * default config, prepared by NPUW specifically for this model.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> shared_lm_head_config{"NPUW_LLM_SHARED_HEAD_CONFIG"};
-
-/**
- * @brief
- * Type: ov::AnyMap.
- * Configuration for compilation/execution of shared LM head model. If specified, it
- * will be appended to the default configuration, prepared by NPUW.
- * For duplicated options, preference will be given to values from given map.
- *
- * NOTE: !! Write-only !!
- */
-static constexpr ov::Property<ov::AnyMap> additional_shared_lm_head_config{"++NPUW_LLM_SHARED_HEAD_CONFIG"};
-} // namespace llm
-
-namespace whisper {
-/**
- * @brief
- * Type: bool.
- * Tell NPUW that you want to pass Whisper model.
- * Default value: false.
- */
-static constexpr ov::Property<bool> enabled{"NPUW_WHISPER"};
-
-/**
- * @brief
- * Type: uint64_t.
- * Provide eos_token for Whisper model (WA).
- * Default value: 50257.
- */
-static constexpr ov::Property<uint64_t> whisper_eos_token{"NPUW_WHISPER_EOS_TOKEN"};
-} // namespace whisper
-
-namespace eagle {
-/**
- * @brief
- * Type: bool.
- * Tell NPUW that you want to pass Eagle3 model for speculative decoding.
- * Default value: false.
- */
-static constexpr ov::Property<bool> enabled{"NPUW_EAGLE"};
-} // namespace eagle
-
-namespace text_embed {
-/**
- * @brief
- * Type: bool.
- * Tell NPUW that you want to pass text-embedding model.
- * Default value: false.
- */
-static constexpr ov::Property<bool> enabled{"NPUW_TEXT_EMBED"};
-
-} // namespace text_embed
-
-namespace kokoro {
-/**
- * @brief
- * Type: bool
- * Set this option to true to utilize Kokoro pipeline
- * Default value: false
- */
-static constexpr ov::Property<bool> enabled{"NPUW_KOKORO"};
-
-/**
- * @brief
- * Type: size_t (uint64_t)
- * Set the block size for Kokoro pipeline
- * Default value: 200
- */
-static constexpr ov::Property<uint64_t> block_size{"NPUW_KOKORO_BLOCK_SIZE"};
-
-/**
- * @brief
- * Type: size_t (uint64_t)
- * Set the overlap size for Kokoro pipeline
- * Default value: 20
- */
-static constexpr ov::Property<uint64_t> overlap_size{"NPUW_KOKORO_OVERLAP_SIZE"};
-} // namespace kokoro
-
-} // namespace npuw
-} // namespace intel_npu
-} // namespace ov
+#define INTEL_NPU_NPUW_SIMPLE_OPT(OPT, TYPE, DEFAULT, NS_PATH, NAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ INTEL_NPU_NPUW_IF_BUILD_##BUILD(OPT, NS_PATH, NAME)
+#define INTEL_NPU_NPUW_STRING_ENUM_OPT(OPT, TYPE, TRAITS, NS_PATH, NAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ INTEL_NPU_NPUW_IF_BUILD_##BUILD(OPT, NS_PATH, NAME)
+#define INTEL_NPU_NPUW_ANYMAP_OPT(OPT, NS_PATH, NAME, KEY, GROUP, SURFACE, CACHING, BUILD) \
+ INTEL_NPU_NPUW_IF_BUILD_##BUILD(OPT, NS_PATH, NAME)
+#include "intel_npu/config/npuw_option_defs.inc"
+#undef INTEL_NPU_NPUW_ANYMAP_OPT
+#undef INTEL_NPU_NPUW_STRING_ENUM_OPT
+#undef INTEL_NPU_NPUW_SIMPLE_OPT
+#undef INTEL_NPU_NPUW_IF_BUILD_DEV
+#undef INTEL_NPU_NPUW_IF_BUILD_ALL
+#undef INTEL_NPU_NPUW_DECLARE_PROPERTY_ALIAS
diff --git a/src/plugins/intel_npu/src/al/src/config/npuw.cpp b/src/plugins/intel_npu/src/al/src/config/npuw.cpp
index 79e72f405d5..f72d02e45fa 100644
--- a/src/plugins/intel_npu/src/al/src/config/npuw.cpp
+++ b/src/plugins/intel_npu/src/al/src/config/npuw.cpp
@@ -12,92 +12,24 @@ using namespace ov::intel_npu;
//
void intel_npu::registerNPUWOptions(OptionsDesc& desc) {
- desc.add<NPU_USE_NPUW>();
- desc.add<NPUW_DEVICES>();
- desc.add<NPUW_SUBMODEL_DEVICE>();
- desc.add<NPUW_ONLINE_PIPELINE>();
- desc.add<NPUW_ONLINE_AVOID>();
- desc.add<NPUW_ONLINE_ISOLATE>();
- desc.add<NPUW_ONLINE_NO_FOLD>();
- desc.add<NPUW_ONLINE_MIN_SIZE>();
- desc.add<NPUW_ONLINE_KEEP_BLOCKS>();
- desc.add<NPUW_ONLINE_KEEP_BLOCK_SIZE>();
- desc.add<NPUW_ONLINE_DUMP_PLAN>();
- desc.add<NPUW_PLAN>();
- desc.add<NPUW_FOLD>();
- desc.add<NPUW_CWAI>();
- desc.add<NPUW_DQ>();
- desc.add<NPUW_DQ_FULL>();
- desc.add<NPUW_PMM>();
- desc.add<NPUW_MM_GATED>();
- desc.add<NPUW_SLICE_OUT>();
- desc.add<NPUW_SPATIAL>();
- desc.add<NPUW_SPATIAL_NWAY>();
- desc.add<NPUW_SPATIAL_DYN>();
- desc.add<NPUW_MOE_TOKEN_CHUNK_SIZE>();
- desc.add<NPUW_MOE_POOL_SIZE>();
- desc.add<NPUW_ATTN>();
- desc.add<NPUW_ATTN_DYN>();
- desc.add<NPUW_ATTN_NO_COPY>();
- desc.add<NPUW_ATTN_HFA_FUSED>();
- desc.add<NPUW_HOST_GATHER>();
- desc.add<NPUW_F16IC>();
- desc.add<NPUW_DCOFF_TYPE>();
- desc.add<NPUW_DCOFF_SCALE>();
- desc.add<NPUW_FUNCALL_FOR_ALL>();
- desc.add<NPUW_PARALLEL_COMPILE>();
- desc.add<NPUW_FUNCALL_ASYNC>();
- desc.add<NPUW_UNFOLD_IREQS>();
- desc.add<NPUW_FALLBACK_EXEC>();
- desc.add<NPUW_WEIGHTS_BANK>();
- desc.add<NPUW_WEIGHTS_BANK_ALLOC>();
- desc.add<NPUW_CACHE_DIR>();
- desc.add<NPUW_ACC_CHECK>();
- desc.add<NPUW_ACC_THRESH>();
- desc.add<NPUW_ACC_DEVICE>();
-#ifdef NPU_PLUGIN_DEVELOPER_BUILD
- desc.add<NPUW_DUMP_FULL>();
- desc.add<NPUW_DUMP_SUBS>();
- desc.add<NPUW_DUMP_SUBS_DIR>();
- desc.add<NPUW_DUMP_SUBS_ON_FAIL>();
- desc.add<NPUW_DUMP_IO>();
- desc.add<NPUW_DUMP_IO_ITERS>();
-#endif
+ for_each_npuw_option<NPUWOptionGroup::ROOT>([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ desc.add<Opt>();
+ });
}
void intel_npu::registerNPUWLLMOptions(OptionsDesc& desc) {
- desc.add<NPUW_LLM>();
- desc.add<NPUW_LLM_BATCH_DIM>();
- desc.add<NPUW_LLM_SEQ_LEN_DIM>();
- desc.add<NPUW_LLM_MAX_PROMPT_LEN>();
- desc.add<NPUW_LLM_MIN_RESPONSE_LEN>();
- desc.add<NPUW_LLM_MAX_LORA_RANK>();
- desc.add<NPUW_LLM_OPTIMIZE_V_TENSORS>();
- desc.add<NPUW_LLM_OPTIMIZE_FP8>();
- desc.add<NPUW_LLM_CACHE_ROPE>();
- desc.add<NPUW_LLM_PREFILL_MOE_HINT>();
- desc.add<NPUW_LLM_GENERATE_MOE_HINT>();
- desc.add<NPUW_LLM_GENERATE_PYRAMID>();
- desc.add<NPUW_LLM_PREFILL_CHUNK_SIZE>();
- desc.add<NPUW_LLM_ENABLE_PREFIX_CACHING>();
- desc.add<NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE>();
- desc.add<NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS>();
- desc.add<NPUW_LLM_MAX_GENERATION_TOKEN_LEN>();
- desc.add<NPUW_LLM_PREFILL_HINT>();
- desc.add<NPUW_LLM_GENERATE_HINT>();
- desc.add<NPUW_LLM_PREFILL_ATTENTION_HINT>();
- desc.add<NPUW_LLM_GENERATE_ATTENTION_HINT>();
- desc.add<NPUW_LLM_SHARED_HEAD>();
- desc.add<NPUW_WHISPER>();
- desc.add<NPUW_WHISPER_EOS_TOKEN>();
- desc.add<NPUW_EAGLE>();
- desc.add<NPUW_TEXT_EMBED>();
+ for_each_npuw_option<NPUWOptionGroup::LLM>([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ desc.add<Opt>();
+ });
}
void intel_npu::registerNPUWKokoroOptions(OptionsDesc& desc) {
- desc.add<NPUW_KOKORO>();
- desc.add<NPUW_KOKORO_BLOCK_SIZE>();
- desc.add<NPUW_KOKORO_OVERLAP_SIZE>();
+ for_each_npuw_option<NPUWOptionGroup::KOKORO>([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ desc.add<Opt>();
+ });
}
std::string ov::npuw::s11n::anyToString(const ov::Any& var) {
diff --git a/src/plugins/intel_npu/src/plugin/include/properties.hpp b/src/plugins/intel_npu/src/plugin/include/properties.hpp
index 057bafbf1cb..90f015f5f5a 100644
--- a/src/plugins/intel_npu/src/plugin/include/properties.hpp
+++ b/src/plugins/intel_npu/src/plugin/include/properties.hpp
@@ -6,7 +6,7 @@
#include "intel_npu/common/filtered_config.hpp"
#include "intel_npu/common/icompiler_adapter.hpp"
-#include "intel_npu/npuw_private_properties.hpp"
+#include "intel_npu/config/npuw.hpp"
#include "metrics.hpp"
namespace intel_npu {
@@ -129,95 +129,37 @@ private:
void registerPluginProperties();
void registerCompiledModelProperties();
- const std::vector<ov::PropertyName> _cachingProperties = {
- ov::cache_mode.name(),
- ov::enable_profiling.name(),
- ov::device::architecture.name(),
- ov::hint::execution_mode.name(),
- ov::hint::inference_precision.name(),
- ov::hint::performance_mode.name(),
- ov::intel_npu::batch_compiler_mode_settings.name(),
- ov::intel_npu::batch_mode.name(),
- ov::intel_npu::compilation_mode.name(),
- ov::intel_npu::compilation_mode_params.name(),
- ov::intel_npu::compiler_dynamic_quantization.name(),
- ov::intel_npu::compiler_type.name(),
- ov::intel_npu::dma_engines.name(),
- ov::intel_npu::driver_version.name(),
- ov::intel_npu::dynamic_shape_to_static.name(),
- ov::intel_npu::enable_strides_for.name(),
- ov::intel_npu::max_tiles.name(),
- ov::intel_npu::stepping.name(),
- ov::intel_npu::tiles.name(),
- ov::intel_npu::turbo.name(),
- ov::intel_npu::qdq_optimization.name(),
- ov::intel_npu::qdq_optimization_aggressive.name(),
- // NPUW caching properties
- ov::intel_npu::use_npuw.name(),
- ov::intel_npu::npuw::devices.name(),
- ov::intel_npu::npuw::submodel_device.name(),
- ov::intel_npu::npuw::weights_bank.name(),
- ov::intel_npu::npuw::weights_bank_alloc.name(),
- ov::intel_npu::npuw::partitioning::online::pipeline.name(),
- ov::intel_npu::npuw::partitioning::online::avoid.name(),
- ov::intel_npu::npuw::partitioning::online::isolate.name(),
- ov::intel_npu::npuw::partitioning::online::nofold.name(),
- ov::intel_npu::npuw::partitioning::online::min_size.name(),
- ov::intel_npu::npuw::partitioning::online::keep_blocks.name(),
- ov::intel_npu::npuw::partitioning::online::keep_block_size.name(),
- ov::intel_npu::npuw::partitioning::attn.name(),
- ov::intel_npu::npuw::partitioning::attn_hfa_fused.name(),
- ov::intel_npu::npuw::partitioning::fold.name(),
- ov::intel_npu::npuw::partitioning::cwai.name(),
- ov::intel_npu::npuw::partitioning::dyn_quant.name(),
- ov::intel_npu::npuw::partitioning::dyn_quant_full.name(),
- ov::intel_npu::npuw::partitioning::par_matmul_merge_dims.name(),
- ov::intel_npu::npuw::partitioning::matmul_gate_preserve_constants.name(),
- ov::intel_npu::npuw::partitioning::slice_out.name(),
- ov::intel_npu::npuw::partitioning::spatial.name(),
- ov::intel_npu::npuw::partitioning::spatial_nway.name(),
- ov::intel_npu::npuw::partitioning::spatial_dyn.name(),
- ov::intel_npu::npuw::partitioning::f16_interconnect.name(),
- ov::intel_npu::npuw::partitioning::host_gather.name(),
- ov::intel_npu::npuw::partitioning::dcoff_type.name(),
- ov::intel_npu::npuw::partitioning::dcoff_with_scale.name(),
- ov::intel_npu::npuw::partitioning::funcall_for_all.name(),
- ov::intel_npu::npuw::partitioning::moe_token_chunk_size.name(),
- ov::intel_npu::npuw::partitioning::moe_pool_size.name(),
- ov::intel_npu::npuw::funcall_async.name(),
- ov::intel_npu::npuw::unfold_ireqs.name(),
- ov::intel_npu::npuw::fallback_exec.name(),
- ov::intel_npu::npuw::llm::enabled.name(),
- ov::intel_npu::npuw::llm::batch_dim.name(),
- ov::intel_npu::npuw::llm::seq_len_dim.name(),
- ov::intel_npu::npuw::llm::max_prompt_len.name(),
- ov::intel_npu::npuw::llm::max_generation_token_len.name(),
- ov::intel_npu::npuw::llm::min_response_len.name(),
- ov::intel_npu::npuw::llm::optimize_v_tensors.name(),
- ov::intel_npu::npuw::llm::cache_rope.name(),
- ov::intel_npu::npuw::llm::generate_pyramid.name(),
- ov::intel_npu::npuw::llm::prefill_chunk_size.name(),
- ov::intel_npu::npuw::llm::shared_lm_head.name(),
- ov::intel_npu::npuw::llm::max_lora_rank.name(),
- ov::intel_npu::npuw::llm::enable_prefix_caching.name(),
- ov::intel_npu::npuw::llm::prefix_caching_block_size.name(),
- ov::intel_npu::npuw::llm::prefix_caching_max_num_blocks.name(),
- ov::intel_npu::npuw::llm::prefill_hint.name(),
- ov::intel_npu::npuw::llm::prefill_config.name(),
- ov::intel_npu::npuw::llm::additional_prefill_config.name(),
- ov::intel_npu::npuw::llm::prefill_attn_hint.name(),
- ov::intel_npu::npuw::llm::generate_hint.name(),
- ov::intel_npu::npuw::llm::generate_config.name(),
- ov::intel_npu::npuw::llm::additional_generate_config.name(),
- ov::intel_npu::npuw::llm::generate_attn_hint.name(),
- ov::intel_npu::npuw::llm::shared_lm_head_config.name(),
- ov::intel_npu::npuw::llm::additional_shared_lm_head_config.name(),
- ov::intel_npu::npuw::llm::optimize_fp8.name(),
- ov::intel_npu::npuw::eagle::enabled.name(),
- ov::intel_npu::npuw::llm::prefill_moe_hint.name(),
- ov::intel_npu::npuw::llm::generate_moe_hint.name(),
- ov::intel_npu::npuw::whisper::enabled.name(),
- ov::intel_npu::npuw::text_embed::enabled.name()};
+ const std::vector<ov::PropertyName> _cachingProperties = [] {
+ std::vector<ov::PropertyName> properties = {
+ ov::cache_mode.name(),
+ ov::enable_profiling.name(),
+ ov::device::architecture.name(),
+ ov::hint::execution_mode.name(),
+ ov::hint::inference_precision.name(),
+ ov::hint::performance_mode.name(),
+ ov::intel_npu::batch_compiler_mode_settings.name(),
+ ov::intel_npu::batch_mode.name(),
+ ov::intel_npu::compilation_mode.name(),
+ ov::intel_npu::compilation_mode_params.name(),
+ ov::intel_npu::compiler_dynamic_quantization.name(),
+ ov::intel_npu::compiler_type.name(),
+ ov::intel_npu::dma_engines.name(),
+ ov::intel_npu::driver_version.name(),
+ ov::intel_npu::dynamic_shape_to_static.name(),
+ ov::intel_npu::enable_strides_for.name(),
+ ov::intel_npu::max_tiles.name(),
+ ov::intel_npu::stepping.name(),
+ ov::intel_npu::tiles.name(),
+ ov::intel_npu::turbo.name(),
+ ov::intel_npu::qdq_optimization.name(),
+ ov::intel_npu::qdq_optimization_aggressive.name(),
+ };
+ for_each_cached_npuw_option([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ properties.emplace_back(std::string{Opt::key()});
+ });
+ return properties;
+ }();
const std::vector<ov::PropertyName> _internalSupportedProperties = {ov::internal::caching_properties.name(),
ov::internal::caching_with_mmap.name(),
diff --git a/src/plugins/intel_npu/src/plugin/src/plugin.cpp b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
index e4beaaf25f9..75c0e82d5b6 100644
--- a/src/plugins/intel_npu/src/plugin/src/plugin.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/plugin.cpp
@@ -273,75 +273,10 @@ void init_config(const IEngineBackend* backend, OptionsDesc& options, FilteredCo
// NPUW properties are requested by OV Core during caching and have no effect on the NPU plugin. But we still need
// to enable those for OV Core to query. Note: do this last to not filter them out. register npuw caching properties
- REGISTER_OPTION(NPU_USE_NPUW);
- REGISTER_OPTION(NPUW_DEVICES);
- REGISTER_OPTION(NPUW_SUBMODEL_DEVICE);
- REGISTER_OPTION(NPUW_WEIGHTS_BANK);
- REGISTER_OPTION(NPUW_WEIGHTS_BANK_ALLOC);
- REGISTER_OPTION(NPUW_ONLINE_PIPELINE);
- REGISTER_OPTION(NPUW_ONLINE_AVOID);
- REGISTER_OPTION(NPUW_ONLINE_ISOLATE);
- REGISTER_OPTION(NPUW_ONLINE_NO_FOLD);
- REGISTER_OPTION(NPUW_ONLINE_MIN_SIZE);
- REGISTER_OPTION(NPUW_ONLINE_KEEP_BLOCKS);
- REGISTER_OPTION(NPUW_ONLINE_KEEP_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_ATTN);
- REGISTER_OPTION(NPUW_ATTN_HFA_FUSED);
- REGISTER_OPTION(NPUW_FOLD);
- REGISTER_OPTION(NPUW_CWAI);
- REGISTER_OPTION(NPUW_DQ);
- REGISTER_OPTION(NPUW_DQ_FULL);
- REGISTER_OPTION(NPUW_PMM);
- REGISTER_OPTION(NPUW_MM_GATED);
- REGISTER_OPTION(NPUW_SLICE_OUT);
- REGISTER_OPTION(NPUW_SPATIAL);
- REGISTER_OPTION(NPUW_SPATIAL_NWAY);
- REGISTER_OPTION(NPUW_SPATIAL_DYN);
- REGISTER_OPTION(NPUW_F16IC);
- REGISTER_OPTION(NPUW_HOST_GATHER);
- REGISTER_OPTION(NPUW_DCOFF_TYPE);
- REGISTER_OPTION(NPUW_DCOFF_SCALE);
- REGISTER_OPTION(NPUW_FUNCALL_FOR_ALL);
- REGISTER_OPTION(NPUW_FUNCALL_ASYNC);
- REGISTER_OPTION(NPUW_UNFOLD_IREQS);
- REGISTER_OPTION(NPUW_FALLBACK_EXEC);
- REGISTER_OPTION(NPUW_LLM);
- REGISTER_OPTION(NPUW_LLM_BATCH_DIM);
- REGISTER_OPTION(NPUW_LLM_SEQ_LEN_DIM);
- REGISTER_OPTION(NPUW_LLM_MAX_PROMPT_LEN);
- REGISTER_OPTION(NPUW_LLM_MAX_GENERATION_TOKEN_LEN);
- REGISTER_OPTION(NPUW_LLM_MIN_RESPONSE_LEN);
- REGISTER_OPTION(NPUW_LLM_OPTIMIZE_V_TENSORS);
- REGISTER_OPTION(NPUW_LLM_OPTIMIZE_FP8);
- REGISTER_OPTION(NPUW_LLM_CACHE_ROPE);
- REGISTER_OPTION(NPUW_LLM_PREFILL_MOE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_MOE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_PYRAMID);
- REGISTER_OPTION(NPUW_LLM_PREFILL_CHUNK_SIZE);
- REGISTER_OPTION(NPUW_LLM_SHARED_HEAD);
- REGISTER_OPTION(NPUW_LLM_MAX_LORA_RANK);
- REGISTER_OPTION(NPUW_LLM_ENABLE_PREFIX_CACHING);
- REGISTER_OPTION(NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS);
- REGISTER_OPTION(NPUW_WHISPER);
- REGISTER_OPTION(NPUW_WHISPER_EOS_TOKEN);
- REGISTER_OPTION(NPUW_EAGLE);
- REGISTER_OPTION(NPUW_TEXT_EMBED);
- REGISTER_OPTION(NPUW_LLM_PREFILL_HINT);
- REGISTER_OPTION(NPUW_LLM_PREFILL_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_PREFILL_CONFIG);
- REGISTER_OPTION(NPUW_LLM_PREFILL_ATTENTION_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_GENERATE_CONFIG);
- REGISTER_OPTION(NPUW_LLM_GENERATE_ATTENTION_HINT);
- REGISTER_OPTION(NPUW_LLM_SHARED_LM_HEAD_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_SHARED_LM_HEAD_CONFIG);
- REGISTER_OPTION(NPUW_KOKORO);
- REGISTER_OPTION(NPUW_KOKORO_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_KOKORO_OVERLAP_SIZE);
- REGISTER_OPTION(NPUW_MOE_TOKEN_CHUNK_SIZE);
- REGISTER_OPTION(NPUW_MOE_POOL_SIZE);
+ for_each_exposed_npuw_option([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ REGISTER_OPTION(Opt);
+ });
config.enableRuntimeOptions();
diff --git a/src/plugins/intel_npu/src/plugin/src/properties.cpp b/src/plugins/intel_npu/src/plugin/src/properties.cpp
index 56fd7268f83..d7c2f256dd5 100644
--- a/src/plugins/intel_npu/src/plugin/src/properties.cpp
+++ b/src/plugins/intel_npu/src/plugin/src/properties.cpp
@@ -181,6 +181,21 @@ namespace intel_npu {
} \
} while (0)
+#define TRY_REGISTER_NPUW_OPTION_PROPERTY(OPT_TYPE) \
+ do { \
+ std::string o_name = std::string(OPT_TYPE::key()); \
+ 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 registering simple get<> properties which have been previously set. For COMPILED_MODEL
*
@@ -586,81 +601,10 @@ void Properties::registerPluginProperties() {
// NPUW properties are requested by OV Core during caching and have no effect on the NPU plugin. But we still need
// to enable those for OV Core to query.
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::use_npuw, NPU_USE_NPUW);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::devices, NPUW_DEVICES);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::submodel_device, NPUW_SUBMODEL_DEVICE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::weights_bank, NPUW_WEIGHTS_BANK);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::weights_bank_alloc, NPUW_WEIGHTS_BANK_ALLOC);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::pipeline, NPUW_ONLINE_PIPELINE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::avoid, NPUW_ONLINE_AVOID);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::isolate, NPUW_ONLINE_ISOLATE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::nofold, NPUW_ONLINE_NO_FOLD);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::min_size, NPUW_ONLINE_MIN_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::keep_blocks, NPUW_ONLINE_KEEP_BLOCKS);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::online::keep_block_size,
- NPUW_ONLINE_KEEP_BLOCK_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::attn, NPUW_ATTN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::attn_hfa_fused, NPUW_ATTN_HFA_FUSED);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::fold, NPUW_FOLD);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::cwai, NPUW_CWAI);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::dyn_quant, NPUW_DQ);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::dyn_quant_full, NPUW_DQ_FULL);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::par_matmul_merge_dims, NPUW_PMM);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::matmul_gate_preserve_constants, NPUW_MM_GATED);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::slice_out, NPUW_SLICE_OUT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::spatial, NPUW_SPATIAL);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::spatial_nway, NPUW_SPATIAL_NWAY);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::spatial_dyn, NPUW_SPATIAL_DYN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::f16_interconnect, NPUW_F16IC);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::host_gather, NPUW_HOST_GATHER);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::dcoff_type, NPUW_DCOFF_TYPE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::dcoff_with_scale, NPUW_DCOFF_SCALE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::funcall_for_all, NPUW_FUNCALL_FOR_ALL);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::funcall_async, NPUW_FUNCALL_ASYNC);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::unfold_ireqs, NPUW_UNFOLD_IREQS);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::fallback_exec, NPUW_FALLBACK_EXEC);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::enabled, NPUW_LLM);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::batch_dim, NPUW_LLM_BATCH_DIM);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::seq_len_dim, NPUW_LLM_SEQ_LEN_DIM);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::max_prompt_len, NPUW_LLM_MAX_PROMPT_LEN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::max_generation_token_len, NPUW_LLM_MAX_GENERATION_TOKEN_LEN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::min_response_len, NPUW_LLM_MIN_RESPONSE_LEN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::optimize_v_tensors, NPUW_LLM_OPTIMIZE_V_TENSORS);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::optimize_fp8, NPUW_LLM_OPTIMIZE_FP8);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::cache_rope, NPUW_LLM_CACHE_ROPE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefill_moe_hint, NPUW_LLM_PREFILL_MOE_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::generate_moe_hint, NPUW_LLM_GENERATE_MOE_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::generate_pyramid, NPUW_LLM_GENERATE_PYRAMID);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefill_chunk_size, NPUW_LLM_PREFILL_CHUNK_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::shared_lm_head, NPUW_LLM_SHARED_HEAD);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::max_lora_rank, NPUW_LLM_MAX_LORA_RANK);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::enable_prefix_caching, NPUW_LLM_ENABLE_PREFIX_CACHING);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefix_caching_block_size,
- NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefix_caching_max_num_blocks,
- NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefill_hint, NPUW_LLM_PREFILL_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefill_config, NPUW_LLM_PREFILL_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::additional_prefill_config,
- NPUW_LLM_ADDITIONAL_PREFILL_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::prefill_attn_hint, NPUW_LLM_PREFILL_ATTENTION_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::generate_hint, NPUW_LLM_GENERATE_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::generate_config, NPUW_LLM_GENERATE_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::additional_generate_config,
- NPUW_LLM_ADDITIONAL_GENERATE_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::generate_attn_hint, NPUW_LLM_GENERATE_ATTENTION_HINT);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::shared_lm_head_config, NPUW_LLM_SHARED_LM_HEAD_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::llm::additional_shared_lm_head_config,
- NPUW_LLM_ADDITIONAL_SHARED_LM_HEAD_CONFIG);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::whisper::enabled, NPUW_WHISPER);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::whisper::whisper_eos_token, NPUW_WHISPER_EOS_TOKEN);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::eagle::enabled, NPUW_EAGLE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::text_embed::enabled, NPUW_TEXT_EMBED);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::kokoro::enabled, NPUW_KOKORO);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::kokoro::block_size, NPUW_KOKORO_BLOCK_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::kokoro::overlap_size, NPUW_KOKORO_OVERLAP_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::moe_token_chunk_size, NPUW_MOE_TOKEN_CHUNK_SIZE);
- TRY_REGISTER_SIMPLE_PROPERTY(ov::intel_npu::npuw::partitioning::moe_pool_size, NPUW_MOE_POOL_SIZE);
+ for_each_exposed_npuw_option([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ TRY_REGISTER_NPUW_OPTION_PROPERTY(Opt);
+ });
// 2. Metrics (static device and enviroment properties)
// ========
diff --git a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.hpp b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.hpp
index 5f07b5b2262..8a8127e915f 100644
--- a/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.hpp
+++ b/src/plugins/intel_npu/tests/functional/internal/plugin/test_properties.hpp
@@ -180,75 +180,10 @@ public:
}
}
- REGISTER_OPTION(NPU_USE_NPUW);
- REGISTER_OPTION(NPUW_DEVICES);
- REGISTER_OPTION(NPUW_SUBMODEL_DEVICE);
- REGISTER_OPTION(NPUW_WEIGHTS_BANK);
- REGISTER_OPTION(NPUW_WEIGHTS_BANK_ALLOC);
- REGISTER_OPTION(NPUW_ONLINE_PIPELINE);
- REGISTER_OPTION(NPUW_ONLINE_AVOID);
- REGISTER_OPTION(NPUW_ONLINE_ISOLATE);
- REGISTER_OPTION(NPUW_ONLINE_NO_FOLD);
- REGISTER_OPTION(NPUW_ONLINE_MIN_SIZE);
- REGISTER_OPTION(NPUW_ONLINE_KEEP_BLOCKS);
- REGISTER_OPTION(NPUW_ONLINE_KEEP_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_ATTN);
- REGISTER_OPTION(NPUW_ATTN_HFA_FUSED);
- REGISTER_OPTION(NPUW_FOLD);
- REGISTER_OPTION(NPUW_CWAI);
- REGISTER_OPTION(NPUW_DQ);
- REGISTER_OPTION(NPUW_DQ_FULL);
- REGISTER_OPTION(NPUW_PMM);
- REGISTER_OPTION(NPUW_MM_GATED);
- REGISTER_OPTION(NPUW_SLICE_OUT);
- REGISTER_OPTION(NPUW_SPATIAL);
- REGISTER_OPTION(NPUW_SPATIAL_NWAY);
- REGISTER_OPTION(NPUW_SPATIAL_DYN);
- REGISTER_OPTION(NPUW_F16IC);
- REGISTER_OPTION(NPUW_HOST_GATHER);
- REGISTER_OPTION(NPUW_DCOFF_TYPE);
- REGISTER_OPTION(NPUW_DCOFF_SCALE);
- REGISTER_OPTION(NPUW_FUNCALL_FOR_ALL);
- REGISTER_OPTION(NPUW_FUNCALL_ASYNC);
- REGISTER_OPTION(NPUW_UNFOLD_IREQS);
- REGISTER_OPTION(NPUW_FALLBACK_EXEC);
- REGISTER_OPTION(NPUW_LLM);
- REGISTER_OPTION(NPUW_LLM_BATCH_DIM);
- REGISTER_OPTION(NPUW_LLM_SEQ_LEN_DIM);
- REGISTER_OPTION(NPUW_LLM_MAX_PROMPT_LEN);
- REGISTER_OPTION(NPUW_LLM_MAX_GENERATION_TOKEN_LEN);
- REGISTER_OPTION(NPUW_LLM_MIN_RESPONSE_LEN);
- REGISTER_OPTION(NPUW_LLM_OPTIMIZE_V_TENSORS);
- REGISTER_OPTION(NPUW_LLM_OPTIMIZE_FP8);
- REGISTER_OPTION(NPUW_LLM_CACHE_ROPE);
- REGISTER_OPTION(NPUW_LLM_PREFILL_MOE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_MOE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_PYRAMID);
- REGISTER_OPTION(NPUW_LLM_PREFILL_CHUNK_SIZE);
- REGISTER_OPTION(NPUW_LLM_SHARED_HEAD);
- REGISTER_OPTION(NPUW_LLM_MAX_LORA_RANK);
- REGISTER_OPTION(NPUW_LLM_ENABLE_PREFIX_CACHING);
- REGISTER_OPTION(NPUW_LLM_PREFIX_CACHING_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_LLM_PREFIX_CACHING_MAX_NUM_BLOCKS);
- REGISTER_OPTION(NPUW_WHISPER);
- REGISTER_OPTION(NPUW_WHISPER_EOS_TOKEN);
- REGISTER_OPTION(NPUW_EAGLE);
- REGISTER_OPTION(NPUW_TEXT_EMBED);
- REGISTER_OPTION(NPUW_LLM_PREFILL_HINT);
- REGISTER_OPTION(NPUW_LLM_PREFILL_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_PREFILL_CONFIG);
- REGISTER_OPTION(NPUW_LLM_PREFILL_ATTENTION_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_HINT);
- REGISTER_OPTION(NPUW_LLM_GENERATE_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_GENERATE_CONFIG);
- REGISTER_OPTION(NPUW_LLM_GENERATE_ATTENTION_HINT);
- REGISTER_OPTION(NPUW_LLM_SHARED_LM_HEAD_CONFIG);
- REGISTER_OPTION(NPUW_LLM_ADDITIONAL_SHARED_LM_HEAD_CONFIG);
- REGISTER_OPTION(NPUW_KOKORO);
- REGISTER_OPTION(NPUW_KOKORO_BLOCK_SIZE);
- REGISTER_OPTION(NPUW_KOKORO_OVERLAP_SIZE);
- REGISTER_OPTION(NPUW_MOE_TOKEN_CHUNK_SIZE);
- REGISTER_OPTION(NPUW_MOE_POOL_SIZE);
+ for_each_exposed_npuw_option([&](auto tag) {
+ using Opt = typename decltype(tag)::type;
+ REGISTER_OPTION(Opt);
+ });
npu_config.enableRuntimeOptions();
diff --git a/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_factory_options_test.cpp b/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_factory_options_test.cpp
index 99ac37d0457..83cd18b3db2 100644
--- a/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_factory_options_test.cpp
+++ b/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_factory_options_test.cpp
@@ -5,6 +5,7 @@
#include <gtest/gtest.h>
#include <algorithm>
+#include <array>
#include <memory>
#include <string>
#include <string_view>
@@ -63,6 +64,12 @@ protected:
return *call;
}
+ static const CompileCall& require_call_containing(const RecordingFactory& recorder, std::string_view fragment) {
+ const auto* call = recorder.find_contains(fragment);
+ OPENVINO_ASSERT(call != nullptr, "Missing compile call containing: ", std::string(fragment));
+ return *call;
+ }
+
static std::string prop_string(const ov::AnyMap& props, const std::string& key) {
const auto it = props.find(key);
OPENVINO_ASSERT(it != props.end(), "Missing property: ", key);
@@ -100,19 +107,19 @@ protected:
std::shared_ptr<ov::IPlugin> m_plugin;
};
-TEST_F(LLMCompiledModelFactoryOptionsTest, TwoModelPipeline) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, SharedHeadDisabledBuildsPrefillAndGenerateStagesOnly) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(), {{"NPUW_LLM_SHARED_HEAD", "NO"}}, recorder));
ASSERT_NE(compiled, nullptr);
EXPECT_EQ(recorder.calls().size(), 2u);
- EXPECT_EQ(recorder.count_suffix("_kv192"), 1u);
+ EXPECT_EQ(recorder.count_contains("_kv"), 1u);
EXPECT_EQ(recorder.count_suffix("_prefill"), 1u);
EXPECT_EQ(recorder.find_suffix("_lm_head"), nullptr);
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, ThreeModelPipeline) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, SharedHeadEnabledBuildsPrefillGenerateAndHeadStages) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
@@ -121,9 +128,10 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, ThreeModelPipeline) {
EXPECT_EQ(recorder.calls().size(), 3u);
EXPECT_EQ(recorder.count_suffix("_prefill"), 1u);
EXPECT_EQ(recorder.count_suffix("_lm_head"), 1u);
+ EXPECT_EQ(recorder.count_contains("_kv"), 1u);
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, GeneratePyramidCompilesMultipleGenerateVariants) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, GeneratePyramidBuildsExpectedGenerateStageCount) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
@@ -134,11 +142,9 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, GeneratePyramidCompilesMultipleGenera
ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(), props, recorder));
ASSERT_NE(compiled, nullptr);
- EXPECT_GT(recorder.calls().size(), 2u);
- EXPECT_GT(std::count_if(recorder.calls().begin(), recorder.calls().end(), [](const CompileCall& call) {
- return call.friendly_name.find("_kv") != std::string::npos;
- }),
- 1);
+ EXPECT_EQ(recorder.calls().size(), 3u);
+ EXPECT_EQ(recorder.count_suffix("_prefill"), 1u);
+ EXPECT_EQ(recorder.count_contains("_kv"), 2u);
EXPECT_TRUE(compiled->get_property("NPUW_LLM_GENERATE_PYRAMID").as<bool>());
}
@@ -165,7 +171,7 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, ConfigOverridesAndAdditionsArePassedT
expect_prop(prefill.props, "NPUW_DEVICES", "CPU,NPU");
expect_prop(prefill.props, "NPUW_UNFOLD_IREQS", "YES");
- const auto& generate = require_call(recorder, "_kv192");
+ const auto& generate = require_call_containing(recorder, "_kv");
expect_prop(generate.props, "NPUW_ONLINE_PIPELINE", "NONE");
expect_prop(generate.props, "NPUW_FALLBACK_EXEC", "NO");
expect_prop(generate.props, "NPUW_FUNCALL_ASYNC", "NO");
@@ -193,7 +199,7 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, AttentionHintsPropagateToStageConfigs
expect_prop(prefill.props, "NPUW_UNFOLD_IREQS", "NO");
expect_prop(prefill.props, "NPUW_FALLBACK_EXEC", "NO");
- const auto& generate = require_call(recorder, "_kv192");
+ const auto& generate = require_call_containing(recorder, "_kv");
expect_prop(generate.props, "NPUW_ATTN", "DYNAMIC");
expect_prop(generate.props, "NPUW_ONLINE_PIPELINE", "REP");
expect_prop(generate.props, "NPUW_ONLINE_ISOLATE", "ATTN");
@@ -239,7 +245,7 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, DefaultStageConfigsCarryBaselineNpuwO
ASSERT_NE(compiled, nullptr);
const auto& prefill = require_call(recorder, "_prefill");
- const auto& generate = require_call(recorder, "_kv192");
+ const auto& generate = require_call_containing(recorder, "_kv");
const auto& head = require_call(recorder, "_lm_head");
for (const auto* call : {&prefill, &generate, &head}) {
@@ -294,150 +300,145 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, CommonRuntimeAndDebugOptionsForwardTo
ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(), props, recorder));
ASSERT_NE(compiled, nullptr);
- for (const auto& suffix : {"_prefill", "_kv192", "_lm_head"}) {
- const auto& call = require_call(recorder, suffix);
- expect_prop(call.props, "NPU_USE_NPUW", "YES");
- expect_prop(call.props, "NPUW_DEVICES", "CPU,NPU");
- expect_prop(call.props, "NPUW_SUBMODEL_DEVICE", "0:CPU,last:NPU");
- expect_prop(call.props, "NPUW_WEIGHTS_BANK_ALLOC", "CPU");
- expect_prop(call.props, "NPUW_CACHE_DIR", "/tmp/npuw-cache");
- expect_prop(call.props, "NPUW_PARALLEL_COMPILE", "YES");
- expect_prop(call.props, "NPUW_FUNCALL_ASYNC", "NO");
- expect_prop(call.props, "NPUW_UNFOLD_IREQS", "YES");
- expect_prop(call.props, "NPUW_FALLBACK_EXEC", "YES");
- expect_prop(call.props, "NPUW_ACC_CHECK", "YES");
- expect_prop(call.props, "NPUW_ACC_THRESH", "0.25");
- expect_prop(call.props, "NPUW_ACC_DEVICE", "CPU");
- expect_prop(call.props, "NPUW_DUMP_FULL", "YES");
- expect_prop(call.props, "NPUW_DUMP_SUBS", "YES");
- expect_prop(call.props, "NPUW_DUMP_SUBS_DIR", "/tmp/npuw-dumps");
- expect_prop(call.props, "NPUW_DUMP_SUBS_ON_FAIL", "last");
- expect_prop(call.props, "NPUW_DUMP_IO", "0,last");
- expect_prop(call.props, "NPUW_DUMP_IO_ITERS", "YES");
+ const std::array<const CompileCall*, 3> calls = {&require_call(recorder, "_prefill"),
+ &require_call_containing(recorder, "_kv"),
+ &require_call(recorder, "_lm_head")};
+ for (const auto* call : calls) {
+ expect_prop(call->props, "NPU_USE_NPUW", "YES");
+ expect_prop(call->props, "NPUW_DEVICES", "CPU,NPU");
+ expect_prop(call->props, "NPUW_SUBMODEL_DEVICE", "0:CPU,last:NPU");
+ expect_prop(call->props, "NPUW_WEIGHTS_BANK_ALLOC", "CPU");
+ expect_prop(call->props, "NPUW_CACHE_DIR", "/tmp/npuw-cache");
+ expect_prop(call->props, "NPUW_PARALLEL_COMPILE", "YES");
+ expect_prop(call->props, "NPUW_FUNCALL_ASYNC", "NO");
+ expect_prop(call->props, "NPUW_UNFOLD_IREQS", "YES");
+ expect_prop(call->props, "NPUW_FALLBACK_EXEC", "YES");
+ expect_prop(call->props, "NPUW_ACC_CHECK", "YES");
+ expect_prop(call->props, "NPUW_ACC_THRESH", "0.25");
+ expect_prop(call->props, "NPUW_ACC_DEVICE", "CPU");
+ expect_prop(call->props, "NPUW_DUMP_FULL", "YES");
+ expect_prop(call->props, "NPUW_DUMP_SUBS", "YES");
+ expect_prop(call->props, "NPUW_DUMP_SUBS_DIR", "/tmp/npuw-dumps");
+ expect_prop(call->props, "NPUW_DUMP_SUBS_ON_FAIL", "last");
+ expect_prop(call->props, "NPUW_DUMP_IO", "0,last");
+ expect_prop(call->props, "NPUW_DUMP_IO_ITERS", "YES");
}
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, GenerateHintModesSelectDifferentGenerateDefaults) {
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_GENERATE_HINT", "FAST_COMPILE"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- const auto& generate = require_call(recorder, "_kv192");
- expect_prop(generate.props, "NPUW_UNFOLD_IREQS", "YES");
- expect_missing_prop(generate.props, "NPUW_SLICE_OUT");
- }
+TEST_F(LLMCompiledModelFactoryOptionsTest, FastCompileGenerateHintKeepsUnfoldedGenerateDefaults) {
+ RecordingFactory recorder;
+ std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_GENERATE_HINT", "BEST_PERF"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- const auto& generate = require_call(recorder, "_kv192");
- expect_prop(generate.props, "NPUW_ONLINE_PIPELINE", "NONE");
- expect_missing_prop(generate.props, "NPUW_SLICE_OUT");
- }
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_GENERATE_HINT", "FAST_COMPILE"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ const auto& generate = require_call_containing(recorder, "_kv");
+ expect_prop(generate.props, "NPUW_UNFOLD_IREQS", "YES");
+ expect_missing_prop(generate.props, "NPUW_SLICE_OUT");
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, StaticAndHfaAttentionHintsCoverDistinctValuePaths) {
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_PREFILL_ATTENTION_HINT", "STATIC"},
- {"NPUW_LLM_GENERATE_ATTENTION_HINT", "STATIC"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- const auto& prefill = require_call(recorder, "_prefill");
- const auto& generate = require_call(recorder, "_kv192");
- expect_prop(prefill.props, "NPUW_ATTN", "STATIC");
- expect_prop(generate.props, "NPUW_ATTN", "STATIC");
- // Static attention must not inject REP partitioning knobs into the stage configs.
- EXPECT_EQ(prefill.props.count("NPUW_ONLINE_PIPELINE"), 0u);
- EXPECT_EQ(generate.props.count("NPUW_ONLINE_PIPELINE"), 0u);
- }
+TEST_F(LLMCompiledModelFactoryOptionsTest, BestPerfGenerateHintForcesStandaloneGeneratePartitioning) {
+ RecordingFactory recorder;
+ std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_PREFILL_ATTENTION_HINT", "HFA"},
- {"NPUW_LLM_GENERATE_ATTENTION_HINT", "HFA"},
- {"NPUW_ATTN_HFA_FUSED", "YES"},
- {"NPUW_ATTN_DYN", "YES"},
- {"NPUW_ATTN_NO_COPY", "YES"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- const auto& prefill = require_call(recorder, "_prefill");
- const auto& generate = require_call(recorder, "_kv192");
- for (const auto* call : {&prefill, &generate}) {
- expect_prop(call->props, "NPUW_ATTN", "HFA");
- expect_prop(call->props, "NPUW_ONLINE_PIPELINE", "REP");
- expect_prop(call->props, "NPUW_ONLINE_ISOLATE", "ATTN");
- expect_prop(call->props, "NPUW_ONLINE_KEEP_BLOCK_SIZE", "4");
- expect_prop(call->props, "NPUW_UNFOLD_IREQS", "NO");
- expect_prop(call->props, "NPUW_ATTN_HFA_FUSED", "YES");
- expect_prop(call->props, "NPUW_ATTN_DYN", "YES");
- expect_prop(call->props, "NPUW_ATTN_NO_COPY", "YES");
- }
- }
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_GENERATE_HINT", "BEST_PERF"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ const auto& generate = require_call_containing(recorder, "_kv");
+ expect_prop(generate.props, "NPUW_ONLINE_PIPELINE", "NONE");
+ expect_missing_prop(generate.props, "NPUW_SLICE_OUT");
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, CacheRopePropertyRoundTripsForEnabledAndDisabledValues) {
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_CACHE_ROPE", "YES"},
- {"NPUW_LLM_MAX_PROMPT_LEN", "2048"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- EXPECT_TRUE(compiled->get_property("NPUW_LLM_CACHE_ROPE").as<bool>());
- EXPECT_NE(recorder.find_suffix("_prefill"), nullptr);
- EXPECT_NE(recorder.find_suffix("_kv2112"), nullptr);
- }
+TEST_F(LLMCompiledModelFactoryOptionsTest, StaticAttentionHintsAvoidAttentionIsolationPipelineOverrides) {
+ RecordingFactory recorder;
+ std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- {
- RecordingFactory recorder;
- std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
- {{"NPUW_LLM_SHARED_HEAD", "NO"},
- {"NPUW_LLM_CACHE_ROPE", "NO"},
- {"NPUW_LLM_MAX_PROMPT_LEN", "2048"}},
- recorder));
- ASSERT_NE(compiled, nullptr);
- EXPECT_FALSE(compiled->get_property("NPUW_LLM_CACHE_ROPE").as<bool>());
- EXPECT_NE(recorder.find_suffix("_prefill"), nullptr);
- EXPECT_NE(recorder.find_suffix("_kv2112"), nullptr);
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_PREFILL_ATTENTION_HINT", "STATIC"},
+ {"NPUW_LLM_GENERATE_ATTENTION_HINT", "STATIC"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ const auto& prefill = require_call(recorder, "_prefill");
+ const auto& generate = require_call_containing(recorder, "_kv");
+ expect_prop(prefill.props, "NPUW_ATTN", "STATIC");
+ expect_prop(generate.props, "NPUW_ATTN", "STATIC");
+ // Static attention should leave partitioning defaults unchanged rather than forcing attention isolation.
+ EXPECT_EQ(prefill.props.count("NPUW_ONLINE_PIPELINE"), 0u);
+ EXPECT_EQ(generate.props.count("NPUW_ONLINE_PIPELINE"), 0u);
+}
+
+TEST_F(LLMCompiledModelFactoryOptionsTest, HfaAttentionHintsEnableAttentionIsolationSettings) {
+ RecordingFactory recorder;
+ std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
+
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_PREFILL_ATTENTION_HINT", "HFA"},
+ {"NPUW_LLM_GENERATE_ATTENTION_HINT", "HFA"},
+ {"NPUW_ATTN_HFA_FUSED", "YES"},
+ {"NPUW_ATTN_DYN", "YES"},
+ {"NPUW_ATTN_NO_COPY", "YES"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ const auto& prefill = require_call(recorder, "_prefill");
+ const auto& generate = require_call_containing(recorder, "_kv");
+ for (const auto* call : {&prefill, &generate}) {
+ expect_prop(call->props, "NPUW_ATTN", "HFA");
+ expect_prop(call->props, "NPUW_ONLINE_PIPELINE", "REP");
+ expect_prop(call->props, "NPUW_ONLINE_ISOLATE", "ATTN");
+ expect_prop(call->props, "NPUW_ONLINE_KEEP_BLOCK_SIZE", "4");
+ expect_prop(call->props, "NPUW_UNFOLD_IREQS", "NO");
+ expect_prop(call->props, "NPUW_ATTN_HFA_FUSED", "YES");
+ expect_prop(call->props, "NPUW_ATTN_DYN", "YES");
+ expect_prop(call->props, "NPUW_ATTN_NO_COPY", "YES");
}
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperOptionRejectsCurrentSyntheticDecoderModel) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, CacheRopeEnabledRoundsTripThroughCompiledModel) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- EXPECT_ANY_THROW(compiled = create_compiled_model(build_whisper_decoder_model(),
- {{"NPUW_WHISPER", "YES"}, {"NPUW_WHISPER_EOS_TOKEN", "42"}},
- recorder));
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_CACHE_ROPE", "YES"},
+ {"NPUW_LLM_MAX_PROMPT_LEN", "2048"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ EXPECT_TRUE(compiled->get_property("NPUW_LLM_CACHE_ROPE").as<bool>());
+ EXPECT_NE(recorder.find_suffix("_prefill"), nullptr);
+ EXPECT_EQ(recorder.count_contains("_kv"), 1u);
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, TextEmbeddingOptionRejectsCurrentSyntheticEmbeddingModel) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, CacheRopeDisabledRoundsTripThroughCompiledModel) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
- EXPECT_ANY_THROW(compiled = create_compiled_model(build_embedding_model(), {{"NPUW_TEXT_EMBED", "YES"}}, recorder));
+ ASSERT_NO_THROW(compiled = create_compiled_model(build_llm_model(),
+ {{"NPUW_LLM_SHARED_HEAD", "NO"},
+ {"NPUW_LLM_CACHE_ROPE", "NO"},
+ {"NPUW_LLM_MAX_PROMPT_LEN", "2048"}},
+ recorder));
+ ASSERT_NE(compiled, nullptr);
+ EXPECT_FALSE(compiled->get_property("NPUW_LLM_CACHE_ROPE").as<bool>());
+ EXPECT_NE(recorder.find_suffix("_prefill"), nullptr);
+ EXPECT_EQ(recorder.count_contains("_kv"), 1u);
+}
+
+TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperOptionRejectsCurrentSyntheticDecoderModel) {
+ RecordingFactory recorder;
+ std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
+
+ EXPECT_ANY_THROW(compiled = create_compiled_model(build_whisper_decoder_model(),
+ {{"NPUW_WHISPER", "YES"}, {"NPUW_WHISPER_EOS_TOKEN", "42"}},
+ recorder));
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperKvCachePreparationAddsCacheInputsAndPresentOutputs) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperPreparationAddsKvCacheInputsAndPresentOutputs) {
auto model = build_whisper_decoder_model();
ov::pass::StatefulToStateless().run_on_model(model);
model = model->clone();
@@ -457,7 +458,7 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperKvCachePreparationAddsCacheInp
EXPECT_EQ(prepared->input("input_ids").get_partial_shape()[1].get_length(), 1);
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperPrefillPreparationAddsCrossAttentionMaskAndKeepsNoCachePosition) {
+TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperPrefillPreparationAddsCrossAttentionMaskWithoutCachePosition) {
auto model = build_whisper_decoder_model();
ov::pass::StatefulToStateless().run_on_model(model);
model = model->clone();
@@ -470,9 +471,4 @@ TEST_F(LLMCompiledModelFactoryOptionsTest, WhisperPrefillPreparationAddsCrossAtt
EXPECT_TRUE(has_output_name(prepared, "present"));
}
-TEST_F(LLMCompiledModelFactoryOptionsTest, TextEmbeddingPreparationRejectsCurrentSyntheticEmbeddingModel) {
- auto model = build_embedding_model();
- EXPECT_ANY_THROW(ov::npuw::util::PrepareTextEmbeddingModel(2).run_on_model(model));
-}
-
} // namespace
diff --git a/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_graph_options_test.cpp b/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_graph_options_test.cpp
index 49cef8d4199..0de86160d97 100644
--- a/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_graph_options_test.cpp
+++ b/src/plugins/intel_npu/tests/unit/npuw/llm_compiled_model_graph_options_test.cpp
@@ -47,6 +47,12 @@ protected:
return std::make_unique<ov::npuw::LLMCompiledModel>(build_model(), m_plugin, props, recorder.make_factory());
}
+ static const CompileCall& require_call_containing(const RecordingFactory& recorder, std::string_view fragment) {
+ const auto* call = recorder.find_contains(fragment);
+ OPENVINO_ASSERT(call != nullptr, "Missing compile call containing: ", std::string(fragment));
+ return *call;
+ }
+
template <class Port>
static bool port_has_name(const Port& port, std::string_view needle) {
const auto& names = port.get_names();
@@ -141,14 +147,13 @@ TEST_F(LLMCompiledModelGraphOptionsTest, PromptResponseAndGenerationLengthsDrive
ASSERT_NE(compiled, nullptr);
const auto* prefill = recorder.find_suffix("_prefill");
- const auto* generate = recorder.find_suffix("_kv192");
+ const auto& generate = require_call_containing(recorder, "_kv");
ASSERT_NE(prefill, nullptr);
- ASSERT_NE(generate, nullptr);
const auto prefill_ids = find_input(prefill->model, "input_ids");
const auto prefill_mask = find_input(prefill->model, "attention_mask");
- const auto generate_ids = find_input(generate->model, "input_ids");
- const auto generate_mask = find_input(generate->model, "attention_mask");
+ const auto generate_ids = find_input(generate.model, "input_ids");
+ const auto generate_mask = find_input(generate.model, "attention_mask");
ASSERT_TRUE(prefill_ids.has_value());
ASSERT_TRUE(prefill_mask.has_value());
ASSERT_TRUE(generate_ids.has_value());
@@ -199,7 +204,7 @@ TEST_F(LLMCompiledModelGraphOptionsTest, StaticPrefillRemovesPastKvInputsAndKeep
EXPECT_EQ(ids->get_shape(), (ov::Shape{1, 128}));
}
-TEST_F(LLMCompiledModelGraphOptionsTest, GeneratePyramidCreatesIntermediateKvVariants) {
+TEST_F(LLMCompiledModelGraphOptionsTest, GeneratePyramidBuildsTwoStaticGenerateVariants) {
RecordingFactory recorder;
std::unique_ptr<ov::npuw::LLMCompiledModel> compiled;
@@ -210,14 +215,18 @@ TEST_F(LLMCompiledModelGraphOptionsTest, GeneratePyramidCreatesIntermediateKvVar
recorder));
ASSERT_NE(compiled, nullptr);
- std::vector<std::string> kv_names;
+ std::vector<ov::Shape> generate_attention_mask_shapes;
for (const auto& call : recorder.calls()) {
if (call.friendly_name.find("_kv") != std::string::npos) {
- kv_names.push_back(call.friendly_name);
+ const auto mask = find_input(call.model, "attention_mask");
+ ASSERT_TRUE(mask.has_value());
+ ASSERT_TRUE(mask->get_partial_shape().is_static());
+ generate_attention_mask_shapes.push_back(mask->get_shape());
}
}
- EXPECT_THAT(kv_names, ::testing::UnorderedElementsAre(::testing::EndsWith("_kv1152"),
- ::testing::EndsWith("_kv2176")));
+ EXPECT_EQ(generate_attention_mask_shapes.size(), 2u);
+ EXPECT_THAT(generate_attention_mask_shapes,
+ ::testing::UnorderedElementsAre(ov::Shape({1, 1152}), ov::Shape({1, 2176})));
}
} // namespace
diff --git a/src/plugins/intel_npu/tests/unit/npuw/llm_test_helpers.hpp b/src/plugins/intel_npu/tests/unit/npuw/llm_test_helpers.hpp
index 9b5f05afb45..61d9cee0e11 100644
--- a/src/plugins/intel_npu/tests/unit/npuw/llm_test_helpers.hpp
+++ b/src/plugins/intel_npu/tests/unit/npuw/llm_test_helpers.hpp
@@ -159,6 +159,12 @@ public:
});
}
+ std::size_t count_contains(std::string_view fragment) const {
+ return std::count_if(m_calls.begin(), m_calls.end(), [fragment](const CompileCall& call) {
+ return call.friendly_name.find(fragment) != std::string::npos;
+ });
+ }
+
const CompileCall* find_suffix(std::string_view suffix) const {
const auto it = std::find_if(m_calls.begin(), m_calls.end(), [suffix](const CompileCall& call) {
return call.friendly_name.size() >= suffix.size() &&
@@ -167,6 +173,13 @@ public:
return it == m_calls.end() ? nullptr : &(*it);
}
+ const CompileCall* find_contains(std::string_view fragment) const {
+ const auto it = std::find_if(m_calls.begin(), m_calls.end(), [fragment](const CompileCall& call) {
+ return call.friendly_name.find(fragment) != std::string::npos;
+ });
+ return it == m_calls.end() ? nullptr : &(*it);
+ }
+
private:
std::vector<CompileCall> m_calls;
};