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

[microNPU] Fixed MergeConstants pass on striped networks #13281

Merged

Conversation

sergio-grovety
Copy link
Contributor

This PR fixes the bug in MergeConstants pass on striped networks on Ethos-U NPU.

The issue was caused by DivideConstants pass which is introducing new mod parameters and changing their order. So ethosu_write parameter in some cases is moved from the end of the list to the middle.
E.g. from:
[ethos-u_0_i0, p1, p2, p3, p4, p5, p6, ethosu_write]
To:
[ethos-u_0_i0, p1, p2, ethosu_write, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder]

Updated version of the GetArgsToMergeWithoutArgsNotInConstDict and MakeNewConstDict methods in passes.cc can now correctly modify const_dict according to the new parameter list.

cc @leandron

@tvm-bot
Copy link
Collaborator

tvm-bot commented Nov 3, 2022

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@github-actions github-actions bot requested a review from leandron November 3, 2022 15:04
@sergio-grovety sergio-grovety force-pushed the ethosu-mergeconstant-striped-networks branch from d651284 to fd1f6d7 Compare November 7, 2022 09:15
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

Thanks @sergey-grovety looks great! LGTM providing CI passes. Also cc @ekalda, @NicolaLancellotti who might have more context on this

Copy link
Contributor

@NicolaLancellotti NicolaLancellotti left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@lhutton1 lhutton1 merged commit 54bd5e1 into apache:main Nov 10, 2022
@lhutton1
Copy link
Contributor

Thanks @sergey-grovety @NicolaLancellotti!

xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 10, 2022
This PR fixes the bug in MergeConstants pass on striped networks on Ethos-U NPU.

The issue was caused by _DivideConstants_ pass which is introducing new mod parameters and changing their order. So ethosu_write parameter in some cases is moved from the end of the list to the middle.
E.g. from:
`[ethos-u_0_i0, p1, p2, p3, p4, p5, p6, ethosu_write]`
To:
`[ethos-u_0_i0, p1, p2, ethosu_write, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder]`

Updated version of the  _GetArgsToMergeWithoutArgsNotInConstDict_ and _MakeNewConstDict_ methods in passes.cc can now correctly modify const_dict according to the new parameter list.
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
This PR fixes the bug in MergeConstants pass on striped networks on Ethos-U NPU.

The issue was caused by _DivideConstants_ pass which is introducing new mod parameters and changing their order. So ethosu_write parameter in some cases is moved from the end of the list to the middle.
E.g. from:
`[ethos-u_0_i0, p1, p2, p3, p4, p5, p6, ethosu_write]`
To:
`[ethos-u_0_i0, p1, p2, ethosu_write, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder, placeholder]`

Updated version of the  _GetArgsToMergeWithoutArgsNotInConstDict_ and _MakeNewConstDict_ methods in passes.cc can now correctly modify const_dict according to the new parameter list.
@sergio-grovety sergio-grovety deleted the ethosu-mergeconstant-striped-networks branch May 20, 2023 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants