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

[CPU] Drop redundant MemoryOutput nodes #27189

Merged
merged 17 commits into from
Oct 29, 2024

Conversation

maxnick
Copy link
Contributor

@maxnick maxnick commented Oct 22, 2024

Details:

In direct ReadValue->Assign pairs the Assign node is practically useless as there are no other layers that might modify data in between. Therefore, it does make sense to remove corresponding MemoryOutput nodes to eliminate additional overheads on their processing.

Tickets:

@maxnick maxnick requested review from a team as code owners October 22, 2024 14:34
@github-actions github-actions bot added the category: CPU OpenVINO CPU plugin label Oct 22, 2024
@maxnick maxnick added the pr: needs tests PR needs tests updating label Oct 22, 2024
@maxnick maxnick added this to the 2024.5 milestone Oct 22, 2024
@maxnick maxnick requested review from a team as code owners October 22, 2024 17:32
@github-actions github-actions bot added category: IE Tests OpenVINO Test: plugins and common category: TEMPLATE OpenVINO Template plugin labels Oct 22, 2024

ov::test::utils::compare(tx_result, tx_result_ref, 1e-4, 1e-4);
ov::test::utils::compare(tz_result, tz_result_ref, 1e-4, 1e-4);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we also need to add check if exist MemoryOutput in compiledModel.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, for sure, but this is a common test, therefore we cannot add plugin specific checks there. To test the topology we have to introduce a dedicated CPU SL test, and I'm going to do this soon.

Comment on lines 3209 to 3215
if (Type::MemoryOutput == childNode->getType()) {
if (MemoryOutput && MemoryOutput != childNode) {
//only one child MemoryOutput is expected
return false;
}
MemoryOutput = childNode;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible there is a case that ReadValue follows 2 Assginns, only 1 Assgin have same variable ID with current ReadValue?
If yes, I suggest only check if exist ReadValue follow Assgin with same Variable Id. What's your idea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably it does make sense, you're right. I will extend the condition.

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

@maxnick maxnick requested a review from itikhono October 23, 2024 11:01
@maxnick maxnick requested a review from xipingyan October 24, 2024 15:40
@maxnick maxnick removed the pr: needs tests PR needs tests updating label Oct 24, 2024
Copy link
Contributor

@itikhono itikhono left a comment

Choose a reason for hiding this comment

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

the changes in the template plugin LGTM

@maxnick
Copy link
Contributor Author

maxnick commented Oct 25, 2024

@xipingyan , do you have any further comments?

Copy link
Contributor

@xipingyan xipingyan left a comment

Choose a reason for hiding this comment

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

LGTM

@maxnick
Copy link
Contributor Author

maxnick commented Oct 28, 2024

@dmitry-gorokhov , the PR is ready for the final review.

@dmitry-gorokhov dmitry-gorokhov added this pull request to the merge queue Oct 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2024
@wenjiew wenjiew added this pull request to the merge queue Oct 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2024
@dmitry-gorokhov dmitry-gorokhov added this pull request to the merge queue Oct 29, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2024
@maxnick maxnick added this pull request to the merge queue Oct 29, 2024
Merged via the queue into openvinotoolkit:master with commit c7d8e03 Oct 29, 2024
166 checks passed
@maxnick maxnick deleted the Drop_Assign branch October 29, 2024 12:06
CuriousPanCake pushed a commit to CuriousPanCake/openvino that referenced this pull request Nov 6, 2024
### Details:
In direct ReadValue->Assign pairs the Assign node is practically useless
as there are no other layers that might modify data in between.
Therefore, it does make sense to remove corresponding MemoryOutput nodes
to eliminate additional overheads on their processing.

### Tickets:
 - CVS-153035
 - CVS-155112
github-merge-queue bot pushed a commit that referenced this pull request Dec 24, 2024
### Details:
 - *New `ReadValueWithSubgraph` node.* 
- *Move `ReadValue`'s initial subgraph nodes to `ReadValueWithSubgraph`*
 - *Mirror `ReadValueWithSubgraph `to `MemoryInput`*
- *Upgrade MemoryInput and MemoryInputBase in order to let them support
multiple inputs"
- *Call new interface `Init` and `Activate` of ov::intel_cpu::Graph,
avoid to memory copy. Refer:
#25385
 - *Depends on #27189

### Tickets:
 - *128743*

---------

Signed-off-by: xipingya <[email protected]>
Co-authored-by: Egor Duplensky <[email protected]>
Co-authored-by: Maksim Kutakov <[email protected]>
Co-authored-by: Maksim Kutakov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: CPU OpenVINO CPU plugin category: IE Tests OpenVINO Test: plugins and common category: TEMPLATE OpenVINO Template plugin Code Freeze
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants