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] Fix for weights bank UIDs #28297

Merged

Conversation

smirnov-alexey
Copy link
Contributor

Previous PR #28282

@smirnov-alexey smirnov-alexey added this to the 2025.0 milestone Jan 7, 2025
@smirnov-alexey smirnov-alexey requested review from a team as code owners January 7, 2025 13:39
Comment on lines +85 to +90
std::unique_lock storage_guard(device_bank.mutex);
vec.reserve(device_bank.storage.size());
for (const auto& el : device_bank.storage) {
vec.push_back(el.second.lt);
}
storage_guard.unlock();
Copy link
Contributor

Choose a reason for hiding this comment

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

So if I understand this code correctly (aside of the lock guards), it seems to me you first iterate over all (say, 400) registered lazy tensors in the bank to make a job list, and then run over it in parallel_for() to evaluate and allocate.

Under the parallel_for(), you check if the tensor is already allocated.

On the first run (prefill compile), this code will work as expected - you will evaluate, allocate, and copy all ~400 tensors.

On the second run you have these 400 tensors in the bank already and you add it to the list regardless, then fire up all the threads to basically do a no-op.

I'd recommend to only add tensors which were not allocated to this list.

@smirnov-alexey smirnov-alexey added this pull request to the merge queue Jan 7, 2025
Merged via the queue into openvinotoolkit:master with commit c0650a0 Jan 7, 2025
161 checks passed
@smirnov-alexey smirnov-alexey deleted the as/npuw_uids_hotfix branch January 7, 2025 19:52
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants