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

[wip] NPUW: Handle closures just once for single-shot functions #27132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dmatveev
Copy link
Contributor

Details:

  • item1
  • ...

Tickets:

  • ticket-id

@dmatveev dmatveev requested review from a team as code owners October 18, 2024 13:32
@github-actions github-actions bot added category: NPU OpenVINO NPU plugin category: NPUW NPUW plugin labels Oct 18, 2024
@dmatveev dmatveev changed the title NPUW: Handle closures just once for single-shot functions [wip] NPUW: Handle closures just once for single-shot functions Oct 18, 2024
// So - closure update is NOT required, OR the function is SINGLE -
// just handle it's closure here and don't do it in runtime
if (!m_closure_update_required || func_desc.forced_to_fcall) {
unpack_closure(i, m_subrequests[real_idx]);
Copy link
Contributor

Choose a reason for hiding this comment

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

So it'll be called in CWAI case or in forced case. Why do we change set_tensor to unpack_closure for CWAI case?

@@ -718,7 +707,7 @@ void ov::npuw::JustInferRequest::function_prologue(std::size_t idx) {
// 2. Unpack the function closure -- right here, if pipelining if not enabled.
// If it is enabled, the flow is a little bit different - see run_subrequest_for_success()
// for details.
if (!is_pipelined(idx)) {
if (!is_pipelined(idx) && m_closure_update_required && !func_desc.forced_to_fcall) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait... is_pipelined checks && !desc.forced_to_fcall - how does it work with && !func_desc.forced_to_fcall?

@@ -765,7 +754,7 @@ void ov::npuw::JustInferRequest::unpack_closure(std::size_t idx, RqPtr request)
if (closure.get_element_type() != clparam->get_element_type()) {
// Remember where the unpack is required
closure_unpack_required.push_back(cidx);
} else if (m_npuw_model->m_update_required) {
Copy link
Contributor

@smirnov-alexey smirnov-alexey Oct 18, 2024

Choose a reason for hiding this comment

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

Could you explain this?

Before we had

  1. CWAI (forced to fcall) - set_tensor
  2. Ordinary rep block, not forced - copy
  3. Single block, forced - unpack

Now

  1. CWAI (forced to fcall) - unpack
  2. Ordinary rep block, not forced - unpack
  3. Single block, forced - copy

Right?

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.

2 participants