-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
base: master
Are you sure you want to change the base?
NPUW: Deref #27767
Conversation
- LazyTensor wasn't prepared to all cases and was crashing in Unpack - Weight bank had a race (device bank was not protected)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be removed
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
template<typename F> | ||
void non_parallel_for(std::size_t count, F &&f) { | ||
for (std::size_t idx = 0u; idx < count; idx++) { | ||
f(idx); | ||
} | ||
} |
There was a problem hiding this comment.
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)
// 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; | ||
// } |
There was a problem hiding this comment.
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
// 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:}}} |
There was a problem hiding this comment.
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
Details:
Tickets:
Related: