Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPUW: Deref #27767

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

NPUW: Deref #27767

wants to merge 7 commits into from

Conversation

dmatveev
Copy link
Contributor

@dmatveev dmatveev commented Nov 27, 2024

@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Nov 27, 2024
Copy link
Contributor Author

@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.

Self-review

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be removed too

if (proto_comp_model_desc.device_it + 1 == m_dev_list.end()) {
LOG_INFO("No fallback expected - clear the OV model for Subgraph[" << idx << "]");
proto_comp_model_desc.model.reset();
// proto_comp_model_desc.compiled_model = {}; // Shouldn't be here, CPU only
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NB: It seems CPU's compiled models hold the pointer to the ov::Model - so to the original weights. Shouldn't be the case for NPU

Copy link
Contributor Author

Choose a reason for hiding this comment

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

UPD. Also the case for CPU

Comment on lines 71 to 76
template<typename F>
void non_parallel_for(std::size_t count, F &&f) {
for (std::size_t idx = 0u; idx < count; idx++) {
f(idx);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can be removed (or moved to util as a debug replacement to ov::parallel_for)

Comment on lines 158 to 163
// FIXME: Uncomment it later (after the CPU copy revert)
// const auto &device_str = bank.first;
// if (device_str == "CPU") {
// // CPU memory is non-detachable
// continue;
// }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be uncommented once tested on device

Comment on lines 113 to 126
// REVERTME:{{{
// Store a copy of the tensor memory even on CPU - to simulate
// bank load.

ov::Tensor new_tensor(transformed_tensor.get_element_type(), transformed_tensor.get_shape());
dbank.storage[tensor] = new_tensor;
guard.unlock();

transformed_tensor.copy_to(new_tensor);
return new_tensor;
// Old code here:
// m_device_bank[device_for_alloc][tensor] = transformed_tensor;
// return transformed_tensor;
// REVERTME:}}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be reverted once tested on-device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant