Skip to content

Conversation

@smirnov-alexey
Copy link
Contributor

Follow-up on #31792

@github-actions github-actions bot added category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Sep 9, 2025
if (tensor->is_continuous()) {
m_input_allocated.insert(tensor->data());
} else {
LOG_WARN("Strided remote tensor is not supported on the device! Expect worse performance due "
Copy link
Contributor

Choose a reason for hiding this comment

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

ok in case of strided tensor - shouldn't we clear m_input_allocated - so undo what we did in line 198?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. It doesn't occur in the use-case I'm considering, but generally it could happen. I've removed the old check

@smirnov-alexey smirnov-alexey added this pull request to the merge queue Sep 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2025
@smirnov-alexey smirnov-alexey added this pull request to the merge queue Sep 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2025
@smirnov-alexey smirnov-alexey added this pull request to the merge queue Sep 10, 2025
Merged via the queue into openvinotoolkit:master with commit e9ab56b Sep 10, 2025
198 of 200 checks passed
@smirnov-alexey smirnov-alexey deleted the as/npuw_set_tensor_device_mem branch September 10, 2025 17:34
@dmatveev dmatveev added this to the 2025.4 milestone Sep 15, 2025
Copy link
Contributor

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

Some post-merge comments here

// ZeroRemoteTensor and ZeroHostTensor should guarantee the correct memory allocation
m_input_allocated.insert(tensor->data());
// Also we can get a strided remote tensor. In this case the copy cannot be avoided for now.
if (m_npuw_model->global_mem_device() == "NPU") {
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if this check is right here.

Comment on lines +197 to +198
auto remote_ctx =
m_npuw_model->get_plugin()->get_core()->get_default_context(m_npuw_model->global_mem_device())._ptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Having this on every set_tensor may be expensive.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants