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 U2 and U3 usecases #10193

Merged
merged 7 commits into from
Feb 14, 2022
Merged

Conversation

manupak
Copy link
Contributor

@manupak manupak commented Feb 8, 2022

This commit adds a MemoryPools argument for
the compilation flow according to RFC0029.

Moreover, it is used to provide support for
external pools from the application layer
that could be pinned for different memories
and/or be reused between multiple inferences.

This commit adds a MemoryPools argument for
the compilation flow according to RFC0029.

Moreover, it is used to provide support for
external pools from the application layer
that could be pinned for different memories
and/or be reused between multiple inferences
of a model.

Change-Id: I7faf88e209cae442241e98b2c94e28da52efff92
* fixing black lint errors

Change-Id: Ifa96f1b5104f8313bb993cde067bd8f0d74a0c3f
* Fixing cpp tests
* Adding more cpp tests for workspace pool struct

Change-Id: I557d5f989b06983927fce7dc820ed106967c595a
* fixing python test descriptions

Change-Id: I9b9809d75b6c2c1de4ef07a7f5429daf215edf7a
* fix qemu tests

Change-Id: Ib534b7f748bf48a100649bf34a46193d79e712e1
* fix aot test utils usages to provide a target

Change-Id: I001696fa103444bbcf3af2cb1bb26d9c33e2f9f1
@manupak
Copy link
Contributor Author

manupak commented Feb 10, 2022

cc : @Mousius @areusch

Copy link
Member

@Mousius Mousius left a comment

Choose a reason for hiding this comment

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

Argh! There's a few typos but after that it looks good, much boilerplate for the nodes 😿

*/

/*!
* \file tvm/relay/executor.h
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* \file tvm/relay/executor.h
* \file tvm/ir/memory_pools.h

Comment on lines 77 to 84
# The string parameter to indicate read and write access to a pool
# This needs to be kept in sync with kTargetPoolReadWriteAccess in
# include/tvm/tir/usmp/utils.h
READ_WRITE_ACCESS = "rw"
# The string parameter to indicate read only access to a pool
# This needs to be kept in sync with kTargetPoolReadOnlyAccess in
# include/tvm/tir/usmp/utils.h
READ_ONLY_ACCESS = "ro"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# The string parameter to indicate read and write access to a pool
# This needs to be kept in sync with kTargetPoolReadWriteAccess in
# include/tvm/tir/usmp/utils.h
READ_WRITE_ACCESS = "rw"
# The string parameter to indicate read only access to a pool
# This needs to be kept in sync with kTargetPoolReadOnlyAccess in
# include/tvm/tir/usmp/utils.h
READ_ONLY_ACCESS = "ro"
# The string parameter to indicate read and write access to a pool
# This needs to be kept in sync with kTargetPoolReadWriteAccess in
# include/tvm/ir/memory_pools.h
READ_WRITE_ACCESS = "rw"
# The string parameter to indicate read only access to a pool
# This needs to be kept in sync with kTargetPoolReadOnlyAccess in
# include/tvm/ir/memory_pools.h
READ_ONLY_ACCESS = "ro"

Comment on lines 108 to 119
/*!
* \brief The string parameter to indicate read and write access to a pool
* This needs to be kept in sync with PoolInfo.READ_WRITE_ACCESS in
* python/tvm/tir/usmp/utils.py
*/
static constexpr const char* kTargetPoolReadWriteAccess = "rw";
/*!
* \brief The string parameter to indicate read only access to a pool
* This needs to be kept in sync with PoolInfo.READ_ONLY_ACCESS in
* python/tvm/tir/usmp/utils.py
*/
static constexpr const char* kTargetPoolReadOnlyAccess = "ro";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/*!
* \brief The string parameter to indicate read and write access to a pool
* This needs to be kept in sync with PoolInfo.READ_WRITE_ACCESS in
* python/tvm/tir/usmp/utils.py
*/
static constexpr const char* kTargetPoolReadWriteAccess = "rw";
/*!
* \brief The string parameter to indicate read only access to a pool
* This needs to be kept in sync with PoolInfo.READ_ONLY_ACCESS in
* python/tvm/tir/usmp/utils.py
*/
static constexpr const char* kTargetPoolReadOnlyAccess = "ro";
/*!
* \brief The string parameter to indicate read and write access to a pool
* This needs to be kept in sync with PoolInfo.READ_WRITE_ACCESS in
* python/tvm/ir/memory_pools.py
*/
static constexpr const char* kTargetPoolReadWriteAccess = "rw";
/*!
* \brief The string parameter to indicate read only access to a pool
* This needs to be kept in sync with PoolInfo.READ_ONLY_ACCESS in
* python/tvm/ir/memory_pools.py
*/
static constexpr const char* kTargetPoolReadOnlyAccess = "ro";

@Mousius Mousius self-assigned this Feb 10, 2022
* fixing typos

Change-Id: Ifd9634983117aba5b7357deaa9c626eee7584de1
@manupak
Copy link
Contributor Author

manupak commented Feb 10, 2022

@Mousius I think I've addressed the comments (Thanks! for catching that!). PTAL when you have some time.

Copy link
Member

@Mousius Mousius left a comment

Choose a reason for hiding this comment

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

LGTM!

@Mousius Mousius merged commit 55849e6 into apache:main Feb 14, 2022
@Mousius
Copy link
Member

Mousius commented Feb 14, 2022

Thanks @manupa-arm 😸

ylc pushed a commit to ylc/tvm that referenced this pull request Feb 16, 2022
This commit adds a MemoryPools argument for
the compilation flow according to RFC0029.

Moreover, it is used to provide support for
external pools from the application layer
that could be pinned for different memories
and/or be reused between multiple inferences
of a model.
yelite added a commit to yelite/tvm that referenced this pull request Feb 16, 2022
This fixes the undefined reference build error again.

This was originally fixed in apache#10147 but was accidentally reverted in apache#10193
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
This commit adds a MemoryPools argument for
the compilation flow according to RFC0029.

Moreover, it is used to provide support for
external pools from the application layer
that could be pinned for different memories
and/or be reused between multiple inferences
of a model.
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