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] LazyTensor refactoring #27108

Merged

Conversation

smirnov-alexey
Copy link
Contributor

No description provided.

@smirnov-alexey smirnov-alexey added category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Oct 17, 2024
@smirnov-alexey smirnov-alexey added this to the 2024.5 milestone Oct 17, 2024
@smirnov-alexey smirnov-alexey requested review from a team as code owners October 17, 2024 15:21
@@ -193,18 +211,10 @@ ov::Tensor LazyTensorImpl::eval() const {
const auto& shape = std::get<3>(unpack_meta);
const auto& type = std::get<4>(unpack_meta);
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like variable1, variable2, ... = std::tie(unpack_meta) will be useful here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks!

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.

Provided my comments on the first two files, let's align this for now and see what to do next.

src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
Comment on lines 42 to 43
LazyTensor permute(const std::vector<std::size_t>& axes);
LazyTensor convert();
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's the question, where the operations can be defined.

Things like .permute() and .tof16() can stay non-static members - they will use this as an operand to construct a new LT.

Things like .unpack(w,z,s) or .concat([...]) you may want to make static.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are constructors above for Concat, Unpack, etc. Do you want to change them to new_tensor = LazyTensor::concat(to_concat, axis), etc?

@dmatveev dmatveev removed this from the 2024.5 milestone Nov 13, 2024
@dmatveev
Copy link
Contributor

Any updates here @smirnov-alexey ?

@smirnov-alexey
Copy link
Contributor Author

Note: there is a problem with shapes (or it's a side-effect) after the last commit. Debug WIP

@smirnov-alexey smirnov-alexey force-pushed the as/npuw_lazy_tensor_refactor branch from 3d94b6d to 6421c75 Compare November 22, 2024 18:41
@smirnov-alexey
Copy link
Contributor Author

Note: there is a problem with shapes (or it's a side-effect) after the last commit. Debug WIP

Fixed

Comment on lines 21 to 23
struct Tensor {
ov::Tensor tensor;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Where this one comes from? Isn't Const enough for the purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

E.g. with Unpack we introduce new input tensors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
src/plugins/intel_npu/src/plugin/npuw/lazy_tensor.cpp Outdated Show resolved Hide resolved
@dmatveev dmatveev added this to the 2024.6 milestone Nov 26, 2024
@dmatveev dmatveev enabled auto-merge November 26, 2024 15:55
@dmatveev dmatveev added this pull request to the merge queue Nov 26, 2024
Merged via the queue into openvinotoolkit:master with commit 4ca1437 Nov 26, 2024
148 checks passed
@dmatveev dmatveev deleted the as/npuw_lazy_tensor_refactor branch November 26, 2024 21:52
github-merge-queue bot pushed a commit that referenced this pull request Nov 29, 2024
smirnov-alexey added a commit to smirnov-alexey/openvino that referenced this pull request Nov 29, 2024
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