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

[USMP] Adding support for U4 usecase #10785

Merged
merged 3 commits into from
Apr 26, 2022
Merged

[USMP] Adding support for U4 usecase #10785

merged 3 commits into from
Apr 26, 2022

Conversation

manupak
Copy link
Contributor

@manupak manupak commented Mar 25, 2022

This commit adds support for placing I/O
tensors within the workspace buffer.

This is enabled using PassConfig option
tir.usmp.use_workspace_io. Once it is enabled,
it will remove the I/O tensors from the TIR
main PrimFunc and replace them with Allocate
nodes that is annotated to contain Input and
Output tensors.

The USMP will plan memory for them accordingly.
(i.e. it will re-use space used by them for
intermediaries depending on the liveness).

This will only be supported with C Interface API.
Thus, this commit produces two functions to the
metadata sources to obtain input and output structs
that points to location inside the workspace struct.

RFC PR : apache/tvm-rfcs#65

@manupak
Copy link
Contributor Author

manupak commented Mar 25, 2022

cc : @Mousius @areusch @grant-arm

@manupak manupak force-pushed the reusing_io branch 2 times, most recently from f370571 to 1da8837 Compare March 28, 2022 15:56
@manupak manupak requested review from areusch and Mousius March 29, 2022 15:13
Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

here are some early comments on this one

include/tvm/tir/usmp/utils.h Show resolved Hide resolved
src/tir/usmp/transform/create_io_allocates.cc Show resolved Hide resolved
src/tir/usmp/transform/create_io_allocates.cc Outdated Show resolved Hide resolved
Copy link
Contributor Author

@manupak manupak left a comment

Choose a reason for hiding this comment

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

Thanks @areusch for reviews -- sorry took me a while to get back to this.
addressed most of the comments, need a bit more clarification on one.

include/tvm/tir/usmp/utils.h Show resolved Hide resolved
src/tir/usmp/transform/create_io_allocates.cc Show resolved Hide resolved
@manupak
Copy link
Contributor Author

manupak commented Apr 22, 2022

a friendly ping for reviews...

Copy link
Contributor

@areusch areusch left a comment

Choose a reason for hiding this comment

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

thanks @manupa-arm !

src/relay/backend/aot_executor_codegen.cc Outdated Show resolved Hide resolved
manupak added 3 commits April 25, 2022 11:18
This commit adds support for placing I/O
tensors within the workspace buffer.

This is enabled using PassConfig option
tir.usmp.use_workspace_io. Once it is enabled,
it will remove the I/O tensors from the TIR
main PrimFunc and replace them with Allocate
nodes that is annotated to contain Input and
Output tensors.

The USMP will plan memory for them accordingly.
(i.e. it will re-use space used by them for
intermediaries depending on the liveness).

This will only be supported with C Interface API.
Thus, this commit produces two functions to the
metadata sources to obtain input and output structs
that points to location inside the workspace struct.

Change-Id: I4c7e750ead9a880ba900602c17f53a125f97dbf9
Change-Id: I78f03d36b12b4a5e8eae8d11701f51019489defc
Change-Id: I857f3d0ba7bc192d56d750c44b232998b2876e7a
@manupak
Copy link
Contributor Author

manupak commented Apr 25, 2022

Thanks @areusch! I've addressed the comments.
PTAL and feel free to merge :) .

@areusch areusch merged commit ce29f02 into apache:main Apr 26, 2022
shtinsa pushed a commit to Deelvin/tvm that referenced this pull request May 17, 2022
* [USMP] Adding support for U4 usecase

This commit adds support for placing I/O
tensors within the workspace buffer.

This is enabled using PassConfig option
tir.usmp.use_workspace_io. Once it is enabled,
it will remove the I/O tensors from the TIR
main PrimFunc and replace them with Allocate
nodes that is annotated to contain Input and
Output tensors.

The USMP will plan memory for them accordingly.
(i.e. it will re-use space used by them for
intermediaries depending on the liveness).

This will only be supported with C Interface API.
Thus, this commit produces two functions to the
metadata sources to obtain input and output structs
that points to location inside the workspace struct.

Change-Id: I4c7e750ead9a880ba900602c17f53a125f97dbf9

* fixup! [USMP] Adding support for U4 usecase

Change-Id: I78f03d36b12b4a5e8eae8d11701f51019489defc

* fixup! [USMP] Adding support for U4 usecase

Change-Id: I857f3d0ba7bc192d56d750c44b232998b2876e7a
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.

2 participants