Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/plugins/intel_npu/src/plugin/npuw/compiled_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,12 @@ void ov::npuw::CompiledModel::export_model(std::ostream& stream) const {

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

// Write flow identifier
bool is_weightless = true;
if (m_non_npuw_props.count(ov::cache_mode.name()) &&
m_non_npuw_props.at(ov::cache_mode.name()).as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
if (auto it = m_non_npuw_props.find(ov::enable_weightless.name()); it != m_non_npuw_props.end()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const auto is_weightless = ov::util::is_weightless_enabled(m_non_npuw_props).value_or(false);
What about using the helper?

if (!it->second.as<bool>()) {
is_weightless = false;
}
} else if (m_non_npuw_props.count(ov::cache_mode.name()) &&
m_non_npuw_props.at(ov::cache_mode.name()).as<CacheMode>() == CacheMode::OPTIMIZE_SPEED) {
is_weightless = false;
}
write(model_stream, is_weightless);
Expand Down
Loading