OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
NPUW: Added possibility to set "NO" to string properties, accepting "YES" (#26762)
Anastasiya(Asya) Pronina8a04a657a2c5
diff --git a/src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp b/src/plugins/intel_npu/src/al/include/npuw_private_properties.hppindex 039c3abdf67..4ccb29469e9 100644--- a/src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp+++ b/src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp@@ -173,6 +173,7 @@ static constexpr ov::Property<bool> dyn_quant{"NPUW_DQ"};* 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"};@@ -274,7 +275,7 @@ static constexpr ov::Property<bool> full{"NPUW_DUMP_FULL"};* Type: std::string.* Dump the specified subgraph(s) in OpenVINO IR form in the current directory.* Possible values: Comma-separated list of subgraph indices or "YES" for all- * subgraphs, e.g. "0,1" or "YES".+ * subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".* Default value: empty.*/static constexpr ov::Property<std::string> subgraphs{"NPUW_DUMP_SUBS"};@@ -284,7 +285,7 @@ static constexpr ov::Property<std::string> subgraphs{"NPUW_DUMP_SUBS"};* Type: std::string.* Dump subgraph on disk if a compilation failure happens.* Possible values: Comma-separated list of subgraph indices or "YES" for all- * subgraphs, e.g. "0,1" or "YES".+ * subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".* Default value: empty.*/static constexpr ov::Property<std::string> subgraphs_on_fail{"NPUW_DUMP_SUBS_ON_FAIL"};@@ -294,7 +295,7 @@ static constexpr ov::Property<std::string> subgraphs_on_fail{"NPUW_DUMP_SUBS_ON_* Type: std::string.* Dump input & output tensors for subgraph(s).* Possible values: Comma-separated list of subgraph indices or "YES" for all- * subgraphs, e.g. "0,1" or "YES".+ * subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".* Default value: empty.*/static constexpr ov::Property<std::string> inputs_outputs{"NPUW_DUMP_IO"};diff --git a/src/plugins/intel_npu/src/plugin/npuw/util.cpp b/src/plugins/intel_npu/src/plugin/npuw/util.cppindex c67b0c62d08..abb7e5841a9 100644--- a/src/plugins/intel_npu/src/plugin/npuw/util.cpp+++ b/src/plugins/intel_npu/src/plugin/npuw/util.cpp@@ -23,7 +23,7 @@#endifbool ov::npuw::util::is_set(const std::size_t sub_idx, const std::string& opt) {- if (opt.empty()) {+ if (opt.empty() || opt == "NO") {return false;}if (opt == "YES") {diff --git a/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.cpp b/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.cppindex 31d83e4f0d2..093e3235afb 100644--- a/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.cpp+++ b/src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.cpp@@ -674,3 +674,22 @@ TEST(BehaviorTestsNPUWAccuracy, RepAndNonePartPipesGiveSameResults) {EXPECT_TRUE(nrmse(rep_tensor, none_tensor));}}++TEST_F(BehaviorTestsNPUW, CanSayNoToPMMProperty) {+ // Create model:+ model = model_generator.get_model_with_one_op();++ // Set expectation to npu plugin:+ EXPECT_COMPILE_MODEL(mock_npu, TIMES(1));++ // Register mock npu plugin in OpenVINO:+ register_mock_plugins_in_ov();++ use_npuw_props.emplace(devices("MockNPU"));+ use_npuw_props.emplace(partitioning::par_matmul_merge_dims("NO"));++ ov::CompiledModel compiled_model;+ EXPECT_NO_THROW(compiled_model = core.compile_model(model, "NPU", use_npuw_props));+ auto prop = compiled_model.get_property(partitioning::par_matmul_merge_dims.name());+ EXPECT_EQ("NO", prop.as<std::string>());+}