Skip to content

Commit c8458d7

Browse files
razvanapetroaienikita-kud
authored andcommitted
Cloning a model for each compileWS_v3 call
1 parent b31d2c5 commit c8458d7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/plugins/intel_npu/src/compiler_adapter/src/plugin_compiler_adapter.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,14 @@ std::vector<std::shared_ptr<IGraph>> PluginCompilerAdapter::compileWS(const std:
160160
//mainNetworkDescription = _compiler->compileWS_v3(model, config, 1);
161161

162162
std::vector<std::shared_ptr<NetworkDescription>> initDscrs;
163+
const std::shared_ptr<ov::Model> originalModel = model->clone();
164+
std::shared_ptr<ov::Model> targetModel = model;
163165
size_t i = 0;
164-
while(auto networkDescription = _compiler->compileWS_v3(model, config, i++)) {
165-
if(isInit(networkDescription->metadata.name)) {
166+
167+
while (auto networkDescription = _compiler->compileWS_v3(targetModel, config, i++)) {
168+
if (isInit(networkDescription->metadata.name)) {
166169
initDscrs.push_back(networkDescription);
170+
targetModel = originalModel->clone();
167171
continue;
168172
}
169173
if(!isMain(networkDescription->metadata.name)) {

0 commit comments

Comments
 (0)