Skip to content

Commit 0d9a56c

Browse files
[NPUW] Support enable_weightless property (#32555)
Depends on #32345 CVS-169440
1 parent 475fbb7 commit 0d9a56c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,12 @@ void ov::npuw::CompiledModel::export_model(std::ostream& stream) const {
794794

795795
// Identify either full flow or weightless
796796
bool is_weightless = true;
797-
if (auto it = m_non_npuw_props.find(ov::cache_mode.name());
798-
it != m_non_npuw_props.end() && it->second.as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
797+
if (auto it = m_non_npuw_props.find(ov::enable_weightless.name()); it != m_non_npuw_props.end()) {
798+
if (!it->second.as<bool>()) {
799+
is_weightless = false;
800+
}
801+
} else if (auto it = m_non_npuw_props.find(ov::cache_mode.name());
802+
it != m_non_npuw_props.end() && it->second.as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
799803
LOG_INFO("Serialization will be done via flow with weights.");
800804
is_weightless = false;
801805
}
@@ -999,8 +1003,12 @@ void ov::npuw::CompiledModel::serialize(std::ostream& stream, const ov::npuw::s1
9991003

10001004
// Write flow identifier
10011005
bool is_weightless = true;
1002-
if (m_non_npuw_props.count(ov::cache_mode.name()) &&
1003-
m_non_npuw_props.at(ov::cache_mode.name()).as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
1006+
if (auto it = m_non_npuw_props.find(ov::enable_weightless.name()); it != m_non_npuw_props.end()) {
1007+
if (!it->second.as<bool>()) {
1008+
is_weightless = false;
1009+
}
1010+
} else if (m_non_npuw_props.count(ov::cache_mode.name()) &&
1011+
m_non_npuw_props.at(ov::cache_mode.name()).as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
10041012
is_weightless = false;
10051013
}
10061014
write(model_stream, is_weightless);

0 commit comments

Comments
 (0)