Skip to content

Support export_model and import_model for MULTI device mode#33898

Closed
andersendsa wants to merge 6 commits intoopenvinotoolkit:masterfrom
andersendsa:support-multi-export-import-6287962269027407743
Closed

Support export_model and import_model for MULTI device mode#33898
andersendsa wants to merge 6 commits intoopenvinotoolkit:masterfrom
andersendsa:support-multi-export-import-6287962269027407743

Conversation

@andersendsa
Copy link

additions made :
adding export and import functionality to multi-mode
closes issue #33889
hey @mengyays kindly review the pr

Motivation:
Exporting a compiled model in MULTI mode was previously not supported, returning OPENVINO_NOT_IMPLEMENTED. This prevented users from caching or serializing MULTI-device models.

Changes:
- Implemented `AutoCumuCompiledModel::export_model` in `src/plugins/auto/src/cumulative_compiled_model.cpp` to serialize the MULTI configuration (XML) and delegate model export to sub-devices.
- Implemented `Plugin::import_model` in `src/plugins/auto/src/plugin.cpp` to deserialize the MULTI configuration and reconstruct the distributed model state by importing sub-models.
- Updated `CumuSchedule::init` in `src/plugins/auto/src/cumulative_schedule.cpp` to handle initialization during import (skipping compilation tasks when `ov::Model` is null).
- Added `openvino/pass/serialize.hpp` and `openvino/util/xml_parse_utils.hpp` includes where necessary.
- Added a functional test `CanExportImportMultiModel` in `src/plugins/auto/tests/functional/behavior/multi_export_import_test.cpp`.

Verification:
- Compiled `openvino_auto_plugin` and `ov_auto_func_tests`.
- Ran `AutoFuncTests.CanExportImportMultiModel` test, which passed successfully.
- Verified that the exported model can be imported and used for inference with correct results and device utilization.

Co-authored-by: andersendsa <199610634+andersendsa@users.noreply.github.com>
@andersendsa andersendsa requested a review from a team as a code owner January 30, 2026 11:00
@github-actions github-actions bot added the category: AUTO OpenVINO AUTO device selection plugin label Jan 30, 2026
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Jan 30, 2026
@andersendsa
Copy link
Author

hello @praasz , @t-jankowski , @alvoron this is the pr i have made let me know if there any changes to be made or is it good to merge

andersendsa and others added 2 commits February 15, 2026 11:37
Motivation:
Exporting a compiled model in MULTI mode was previously not supported, returning OPENVINO_NOT_IMPLEMENTED. This prevented users from caching or serializing MULTI-device models.

Changes:
- Implemented `AutoCumuCompiledModel::export_model` in `src/plugins/auto/src/cumulative_compiled_model.cpp` to serialize the MULTI configuration (XML) and delegate model export to sub-devices.
- Implemented `Plugin::import_model` in `src/plugins/auto/src/plugin.cpp` to deserialize the MULTI configuration and reconstruct the distributed model state by importing sub-models.
- Updated `CumuSchedule::init` in `src/plugins/auto/src/cumulative_schedule.cpp` to handle initialization during import (skipping compilation tasks when `ov::Model` is null).
- Added `openvino/pass/serialize.hpp` and `openvino/util/xml_parse_utils.hpp` includes where necessary.
- Added a functional test `CanExportImportMultiModel` in `src/plugins/auto/tests/functional/behavior/multi_export_import_test.cpp`.
- Updated copyright years to 2026.

Verification:
- Compiled `openvino_auto_plugin` and `ov_auto_func_tests`.
- Ran `AutoFuncTests.CanExportImportMultiModel` test, which passed successfully.
- Verified that the exported model can be imported and used for inference with correct results and device utilization.

Co-authored-by: andersendsa <199610634+andersendsa@users.noreply.github.com>
@andersendsa andersendsa requested review from a team as code owners February 15, 2026 06:31
@andersendsa andersendsa requested review from artanokhov, p-wysocki and tsavina and removed request for a team February 15, 2026 06:31
@andersendsa andersendsa requested a review from mlukasze February 15, 2026 06:31
@github-actions github-actions bot added category: inference OpenVINO Runtime library - Inference category: Core OpenVINO Core (aka ngraph) category: build OpenVINO cmake script / infra category: Python API OpenVINO Python bindings category: C API OpenVINO C API bindings category: transformations OpenVINO Runtime library - Transformations category: LP transformations OpenVINO Low Precision transformations category: samples OpenVINO Runtime Samples category: CI OpenVINO public CI category: docs OpenVINO documentation category: dependency_changes Pull requests that update a dependency file category: TF FE OpenVINO TensorFlow FrontEnd category: extensions OpenVINO Extensibility Mechanism for custom operations category: CPP API OpenVINO CPP API bindings category: packaging OpenVINO packaging / distribution github_actions Pull requests that update GitHub Actions code category: PyTorch FE OpenVINO PyTorch Frontend category: JS API OpenVino JS API Bindings no-match-files category: docs_snippets OpenVINO docs snippets (docs/snippets) category: licensing Changes in OpenVINO licenses category: docker_env category: dockerfiles category: JAX FE OpenVINO JAX FrontEnd category: snippets and removed category: AUTO OpenVINO AUTO device selection plugin labels Feb 15, 2026
Motivation:
Enable `export_model` and `import_model` functionality for the MULTI device plugin to allow saving and loading compiled models for Cumulative Throughput mode. Also fix a critical CI failure in `Smart_CI` action.

Changes:
- Implemented `AutoCumuCompiledModel::export_model` to serialize device configurations to XML and sub-device binaries to the stream.
- Implemented `Plugin::import_model` to parse the XML and reconstruct the distributed compiled model.
- Updated `CumuSchedule` initialization to support loading without an initial `ov::Model`.
- Added functional test `CanExportImportMultiModel` covering export/import flow.
- Fixed race condition in `export_model` by capturing device state under lock.
- Removed faulty `StreamSerialize` fallback.
- Updated `.github/actions/smart-ci/action.yml` to use isolated paths for internal checkouts, preventing workspace cleanup issues.

Verification:
- Added `AutoFuncTests.CanExportImportMultiModel` passes.
- Verified fix for race condition and XML formatting.
- CI fix addresses `requirements.txt` not found error.

Co-authored-by: andersendsa <199610634+andersendsa@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: build OpenVINO cmake script / infra category: C API OpenVINO C API bindings category: CI OpenVINO public CI category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: dependency_changes Pull requests that update a dependency file category: docker_env category: dockerfiles category: docs_snippets OpenVINO docs snippets (docs/snippets) category: docs OpenVINO documentation category: extensions OpenVINO Extensibility Mechanism for custom operations category: inference OpenVINO Runtime library - Inference category: JAX FE OpenVINO JAX FrontEnd category: JS API OpenVino JS API Bindings category: licensing Changes in OpenVINO licenses category: LP transformations OpenVINO Low Precision transformations category: packaging OpenVINO packaging / distribution category: Python API OpenVINO Python bindings category: PyTorch FE OpenVINO PyTorch Frontend category: samples OpenVINO Runtime Samples category: snippets category: TF FE OpenVINO TensorFlow FrontEnd category: transformations OpenVINO Runtime library - Transformations ExternalPR External contributor github_actions Pull requests that update GitHub Actions code no-match-files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants