Skip to content

[NPUW] Pass import config when deserializing compiled submodels#34174

Open
darius-chirla wants to merge 5 commits intoopenvinotoolkit:masterfrom
darius-chirla:darius-chirla/add_config_when_importing_model
Open

[NPUW] Pass import config when deserializing compiled submodels#34174
darius-chirla wants to merge 5 commits intoopenvinotoolkit:masterfrom
darius-chirla:darius-chirla/add_config_when_importing_model

Conversation

@darius-chirla
Copy link

When importing compiled models during deserialization, pass the import configuration to ensure consistent behavior.

Details:

  • Pass import_config for NPU devices during deserialization
  • Pass NPU_RUN_INFERENCES_SEQUENTIALLY when NPUW_UNFOLD_IREQS is enabled
  • Add import_config parameter to all import_models() calls

Tickets:

@darius-chirla darius-chirla requested review from a team as code owners February 18, 2026 09:15
@github-actions github-actions bot added category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Feb 18, 2026
@sys-openvino-ci sys-openvino-ci added the ExternalIntelPR External contributor from Intel label Feb 18, 2026
@dmatveev
Copy link
Contributor

@esmirno can you please have a look

@dmatveev dmatveev requested a review from esmirno February 23, 2026 14:40
@dmatveev dmatveev added this to the 2026.1 milestone Mar 11, 2026
@dmatveev
Copy link
Contributor

@esmirno please review

if (ov::npuw::util::starts_with(device, "NPU")) {
// Pass NPU_RUN_INFERENCES_SEQUENTIALLY if NPUW_UNFOLD_IREQS is enabled
if (compiled->m_cfg.get<::intel_npu::NPUW_UNFOLD_IREQS>()) {
import_config["NPU_RUN_INFERENCES_SEQUENTIALLY"] = "YES";
Copy link
Contributor

Choose a reason for hiding this comment

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

what i think the source of issue is that we have two initialization places for this device config, and for example in compile_model() there are already one more option:
EXCLUSIVE_ASYNC_REQUESTS that is not deserialized - not sure whether it is relevant to current issue.

I would propose serialize device config that was used to compile model, and avoid ifs on deserialisation path, for that we would need to keep track of pairs: {ov::compiled_model, extra-options} since not options are matter i'm not sure why model serialized cannot imported correctly, and why do we ever need config again.
So please create a follow-up tasks for addressing that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is quite shady if we need to maintain the compilation config on import, I actually find it counter-intuitive.
If the model was compiled with a certain option, its compiled blob should preserve that option.
However, there's a distinction between compile-time and run-time options (despite they all are passed to .compile()) so we have this problem.

What's done in this PR is, I think, okay-ish.. Unless we'll come up with a better, generic solution.

Copy link
Contributor

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

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

Thanks @darius-chirla !

if (ov::npuw::util::starts_with(device, "NPU")) {
// Pass NPU_RUN_INFERENCES_SEQUENTIALLY if NPUW_UNFOLD_IREQS is enabled
if (compiled->m_cfg.get<::intel_npu::NPUW_UNFOLD_IREQS>()) {
import_config["NPU_RUN_INFERENCES_SEQUENTIALLY"] = "YES";
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is quite shady if we need to maintain the compilation config on import, I actually find it counter-intuitive.
If the model was compiled with a certain option, its compiled blob should preserve that option.
However, there's a distinction between compile-time and run-time options (despite they all are passed to .compile()) so we have this problem.

What's done in this PR is, I think, okay-ish.. Unless we'll come up with a better, generic solution.

@dmatveev dmatveev enabled auto-merge March 13, 2026 17:28
@dmatveev
Copy link
Contributor

build_jenkins

@dmatveev
Copy link
Contributor

build_jenkins

1 similar comment
@pereanub
Copy link
Contributor

build_jenkins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin Code Freeze ExternalIntelPR External contributor from Intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants