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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect AOT Memory Planning #8926

Merged
merged 1 commit into from Sep 7, 2021
Merged

Conversation

Mousius
Copy link
Member

@Mousius Mousius commented Sep 3, 2021

This change introduces a second memory planning phase in the AOT code
generator once the storage rewrite pass has been completed, fixing
incorrectly sized workspaces for a variety of models.

It comes with accompanying tests so we can safely refactor this later.

Also corrected a typo in the TE compiler regards the memory alignment
argument 馃樃

Co-authored-by: Manupa Karunaratne Manupa.Karunaratne@arm.com

@Mousius
Copy link
Member Author

Mousius commented Sep 3, 2021

CC @manupa-arm

@Mousius
Copy link
Member Author

Mousius commented Sep 3, 2021

Also CC @mbs-octoml @electriclilies for reviews 馃樃

@Mousius Mousius force-pushed the aot-memory-planning branch 3 times, most recently from 4fbb9f5 to cc0c43b Compare September 3, 2021 18:51
Copy link
Contributor

@electriclilies electriclilies left a comment

Choose a reason for hiding this comment

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

Overall, LGTM! I'd like to see CalculateWorkspaceBytes in a pass in the future instead of being run directly in the exectutor, but this is fine for now

src/relay/backend/aot_executor_codegen.cc Show resolved Hide resolved
@Mousius Mousius force-pushed the aot-memory-planning branch 3 times, most recently from aea2a68 to 97401c5 Compare September 6, 2021 08:51
This change introduces a second memory planning phase in the AOT code
generator once the storage rewrite pass has been completed, fixing
incorrectly sized workspaces for a variety of models.

It comes with accompanying tests so we can safely refactor this later.

Also corrected a typo in the TE compiler regards the memory alignment
argument 馃樃

Co-authored-by: Manupa Karunaratne <Manupa.Karunaratne@arm.com>
@jroesch
Copy link
Member

jroesch commented Sep 7, 2021

Overall, LGTM! I'd like to see CalculateWorkspaceBytes in a pass in the future instead of being run directly in the exectutor, but this is fine for now

@Mousius is it possible for you guys to put this as a backlog item? will land this version but in general better to try and split these things into passes so we can make the executor code gens function more uniform instead of each one having different arguments/return values, etc.

@jroesch jroesch merged commit 53a3cba into apache:main Sep 7, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
This change introduces a second memory planning phase in the AOT code
generator once the storage rewrite pass has been completed, fixing
incorrectly sized workspaces for a variety of models.

It comes with accompanying tests so we can safely refactor this later.

Also corrected a typo in the TE compiler regards the memory alignment
argument 馃樃

Co-authored-by: Manupa Karunaratne <Manupa.Karunaratne@arm.com>

Co-authored-by: Manupa Karunaratne <Manupa.Karunaratne@arm.com>
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
This change introduces a second memory planning phase in the AOT code
generator once the storage rewrite pass has been completed, fixing
incorrectly sized workspaces for a variety of models.

It comes with accompanying tests so we can safely refactor this later.

Also corrected a typo in the TE compiler regards the memory alignment
argument 馃樃

Co-authored-by: Manupa Karunaratne <Manupa.Karunaratne@arm.com>

Co-authored-by: Manupa Karunaratne <Manupa.Karunaratne@arm.com>
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.

None yet

5 participants