Skip to content

Commit 8a04a65

Browse files
NPUW: Added possibility to set "NO" to string properties, accepting "YES" (#26762)
### Details: - *Added possibility to say "NO" to properties* ### Tickets: - *ticket-id* Co-authored-by: Dmitry Matveev <dmitry.matveev@intel.com>
1 parent 1eac8d6 commit 8a04a65

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/plugins/intel_npu/src/al/include/npuw_private_properties.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static constexpr ov::Property<bool> dyn_quant{"NPUW_DQ"};
173173
* Identify and merge parallel MatMuls over dimension(s) specified.
174174
* When set to YES, applies transformation for all dimensions.
175175
* Works with FOLD enabled only.
176+
* Set to NO or pass empty value to disable the option.
176177
* Default value: 2.
177178
*/
178179
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"};
274275
* Type: std::string.
275276
* Dump the specified subgraph(s) in OpenVINO IR form in the current directory.
276277
* Possible values: Comma-separated list of subgraph indices or "YES" for all
277-
* subgraphs, e.g. "0,1" or "YES".
278+
* subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".
278279
* Default value: empty.
279280
*/
280281
static constexpr ov::Property<std::string> subgraphs{"NPUW_DUMP_SUBS"};
@@ -284,7 +285,7 @@ static constexpr ov::Property<std::string> subgraphs{"NPUW_DUMP_SUBS"};
284285
* Type: std::string.
285286
* Dump subgraph on disk if a compilation failure happens.
286287
* Possible values: Comma-separated list of subgraph indices or "YES" for all
287-
* subgraphs, e.g. "0,1" or "YES".
288+
* subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".
288289
* Default value: empty.
289290
*/
290291
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_
294295
* Type: std::string.
295296
* Dump input & output tensors for subgraph(s).
296297
* Possible values: Comma-separated list of subgraph indices or "YES" for all
297-
* subgraphs, e.g. "0,1" or "YES".
298+
* subgraphs, "NO" or just empty value to turn option off. E.g. "0,1" or "YES".
298299
* Default value: empty.
299300
*/
300301
static constexpr ov::Property<std::string> inputs_outputs{"NPUW_DUMP_IO"};

src/plugins/intel_npu/src/plugin/npuw/util.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424

2525
bool ov::npuw::util::is_set(const std::size_t sub_idx, const std::string& opt) {
26-
if (opt.empty()) {
26+
if (opt.empty() || opt == "NO") {
2727
return false;
2828
}
2929
if (opt == "YES") {

src/plugins/intel_npu/tests/functional/behavior/npuw/behavior_tests.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -674,3 +674,22 @@ TEST(BehaviorTestsNPUWAccuracy, RepAndNonePartPipesGiveSameResults) {
674674
EXPECT_TRUE(nrmse(rep_tensor, none_tensor));
675675
}
676676
}
677+
678+
TEST_F(BehaviorTestsNPUW, CanSayNoToPMMProperty) {
679+
// Create model:
680+
model = model_generator.get_model_with_one_op();
681+
682+
// Set expectation to npu plugin:
683+
EXPECT_COMPILE_MODEL(mock_npu, TIMES(1));
684+
685+
// Register mock npu plugin in OpenVINO:
686+
register_mock_plugins_in_ov();
687+
688+
use_npuw_props.emplace(devices("MockNPU"));
689+
use_npuw_props.emplace(partitioning::par_matmul_merge_dims("NO"));
690+
691+
ov::CompiledModel compiled_model;
692+
EXPECT_NO_THROW(compiled_model = core.compile_model(model, "NPU", use_npuw_props));
693+
auto prop = compiled_model.get_property(partitioning::par_matmul_merge_dims.name());
694+
EXPECT_EQ("NO", prop.as<std::string>());
695+
}

0 commit comments

Comments
 (0)