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

[TVMC] Workspace Pools Parameters #11427

Merged
merged 16 commits into from
Jul 25, 2022
Merged

Conversation

dchauhan-arm
Copy link
Contributor

@dchauhan-arm dchauhan-arm commented May 24, 2022

Attributes from tvmc are now passable into the created PoolInfo objects
inside WorkspaceMemoryPools. This is passed in to relay.build that get
attached to IRModule attribute.

cc @Mousius @gromero

Attributes from tvmc are now passable into the created PoolInfo objects
inside WorkspaceMemoryPools. This is passed in to relay.build that get
attached to IRModule attribute.
@dchauhan-arm
Copy link
Contributor Author

cc @leandron @manupa-arm @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.

Nice work @dchauhan-arm, just took a quick pass but will take a deeper look later 😸

tests/python/driver/tvmc/test_command_line.py Outdated Show resolved Hide resolved
tests/python/driver/tvmc/test_command_line.py Outdated Show resolved Hide resolved
tests/python/driver/tvmc/test_command_line.py Outdated Show resolved Hide resolved
dchauhan-arm and others added 2 commits May 24, 2022 15:32
Address comments, fix linting. Testing improved.
Change-Id: Iea79329b6b9ec1cbc51e5c293449bf6dd43b00c5
@github-actions github-actions bot requested a review from gromero May 24, 2022 14:33
Change-Id: Ib0ef594a04d3a0ac0e901e856ee73a37809db880
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 @dchauhan-arm , a couple questions. don't take these as prescriptive, just wondering if we have thoughts in those directions right now


def workspace_pools_recombobulate(parsed, targets):
"""Reconstructs the Workspace Pools args and returns a WorkspaceMemoryPool object"""
WORKSPACE_POOL_PARAMS = [
Copy link
Contributor

Choose a reason for hiding this comment

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

could we mark where this list comes from and include "keep in sync with" comments in both places?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If they get out of sync, I agree with the comment you left below that PoolInfo should complain as that's what tvmc is wrapping


return WorkspaceMemoryPools(
[
PoolInfo(
Copy link
Contributor

Choose a reason for hiding this comment

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

alternatively if this thing complained when a parameters was missing or invalidly named, that would be ok as a way to resolve my earlier comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with this approach, if PoolInfo complained about an incorrect parameter being supplied then TVMC should complain as well

Copy link
Contributor

@manupak manupak Jun 22, 2022

Choose a reason for hiding this comment

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

I think we still need the keep-in-sync comment because PoolInfo could be added with arguments with defaults and tvmc support for that could be missed out.

Copy link
Member

@Mousius Mousius Jun 22, 2022

Choose a reason for hiding this comment

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

  1. PoolInfo has documented properties
  2. PoolInfo will get upset if you pass incorrect properties
  3. tvmc arguments are documented

I don't really see the need to add an additional comment to link these together? I don't think we do this for the tuning parameters either: https://github.com/apache/tvm/blob/main/python/tvm/driver/tvmc/autotuner.py ?

Copy link
Contributor

Choose a reason for hiding this comment

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

My concern was PoolInfo could be augmented with new parameters with defaults and we could easily miss those out in the tvmc layer. Having the comment will help the author and the reviewer to not to miss them out in the tvmc layer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh we only need the keep-in-sync comment at the PoolInfo side and not here, because "PoolInfo will get upset if you pass incorrect properties".

python/tvm/driver/tvmc/workspace_pools.py Show resolved Hide resolved
@areusch
Copy link
Contributor

areusch commented Jun 10, 2022

@dchauhan-arm mention me when you're ready for another look here.

Copy link
Contributor

@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.

Broadly looking good!
Only comment from my side would be, is there a test to check whether pool parameter overrides are working ? (I might've missed it)


return WorkspaceMemoryPools(
[
PoolInfo(
Copy link
Contributor

@manupak manupak Jun 22, 2022

Choose a reason for hiding this comment

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

I think we still need the keep-in-sync comment because PoolInfo could be added with arguments with defaults and tvmc support for that could be missed out.

Add test for parameter overrides.

Change-Id: I67d5470dcfbfbc9ab27f34e20a9269d2070193ca
@manupak manupak added the status: need update need update based on feedbacks label Jun 29, 2022
@manupak
Copy link
Contributor

manupak commented Jun 29, 2022

@tvm-bot rerun

dchauhan-arm and others added 2 commits July 6, 2022 15:00
Rebasing over apache#10189
Updates to the way a WorkspaceMemoryPool object is created
Change-Id: I1f0e1d240343af311ddb3ed5c564cc1ab329f463
@manupak
Copy link
Contributor

manupak commented Jul 7, 2022

@tvm-bot rerun

Fix linting, fix CI
Change-Id: If75f8709ac4ad925655eca54b3e5c1bb09d025e8
Add mcpu and mattr to target registry for cmsis-nn
Change-Id: I15257b8d01624c071c738cab6d12ecb84ed6cb16
Copy link
Contributor

@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 @dchauhan-arm !

Only a small thing -- we need to make sure single pool overrides work.

Added test for override on single pool when multiple pools are present
Updated functionality of parsing multiple attributes
Change-Id: I2c0745051b7a923dd7f75040bfb89bbc99376a11
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.

This LGTM, @manupa-arm can you take another look?

Copy link
Contributor

@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.

LGTM!

@manupak
Copy link
Contributor

manupak commented Jul 21, 2022

@leandron as a codeowner, could you take a final look ?

@manupak manupak added status: need review and removed status: need update need update based on feedbacks labels Jul 25, 2022
Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @dchauhan-arm!

@leandron leandron merged commit 75ec1cf into apache:main Jul 25, 2022
@dchauhan-arm dchauhan-arm deleted the pers-params branch July 25, 2022 16:30
lhutton1 added a commit to lhutton1/tvm that referenced this pull request Aug 1, 2022
After apache#11427, `tvmc compile` wouldn't work for external codegens that
don't have a `Target` registered by `TVM_REGISTER_TARGET_KIND`. Such
external codegens can be expected to have no workspace pools and may not
always have a target associated as their implementation predates this
mechanism. While it is likely a `Target` is specified for all external
codegens in the future, we should still support external codegens
without an associated `Target` until this is enforced.

Change-Id: Ida8bf85ed1cafd301b9465641c66a5370d73c429
Mousius added a commit that referenced this pull request Aug 2, 2022
After #11427, `tvmc compile` wouldn't work for external codegens that
don't have a `Target` registered by `TVM_REGISTER_TARGET_KIND`. Such
external codegens can be expected to have no workspace pools and may not
always have a target associated as their implementation predates this
mechanism. While it is likely a `Target` is specified for all external
codegens in the future, we should still support external codegens
without an associated `Target` until this is enforced.

Co-authored-by: Chris Sidebottom <chris.sidebottom@arm.com>
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
* [TVMC] Workspace Pools Parameters

Attributes from tvmc are now passable into the created PoolInfo objects
inside WorkspaceMemoryPools. This is passed in to relay.build that get
attached to IRModule attribute.

* [TVMC] Workspace Pools Parameters

Address comments, fix linting. Testing improved.
Change-Id: Iea79329b6b9ec1cbc51e5c293449bf6dd43b00c5

* [TVMC] Workspace Pools Parameters

Update workspace pools test naming
Change-Id: Ib698d6248be1e6f44340f27db3641c985bc5c5d8

* [TVMC] Workspace Pools Parameters

Add test for parameter overrides.

Change-Id: I67d5470dcfbfbc9ab27f34e20a9269d2070193ca

* [TVMC] Workspace Pools Parameters

Rebasing over apache#10189
Updates to the way a WorkspaceMemoryPool object is created
Change-Id: I1f0e1d240343af311ddb3ed5c564cc1ab329f463

* [TVMC] Workspace Pools Parameters

Fix linting, fix CI
Change-Id: If75f8709ac4ad925655eca54b3e5c1bb09d025e8

* [TVMC] Workspace Pools Parameters

Add mcpu and mattr to target registry for cmsis-nn
Change-Id: I15257b8d01624c071c738cab6d12ecb84ed6cb16

* [TVMC] Workspace Pools Parameters

Added test for override on single pool when multiple pools are present
Updated functionality of parsing multiple attributes
Change-Id: I2c0745051b7a923dd7f75040bfb89bbc99376a11
xinetzone pushed a commit to daobook/tvm that referenced this pull request Nov 25, 2022
…#12253)

After apache#11427, `tvmc compile` wouldn't work for external codegens that
don't have a `Target` registered by `TVM_REGISTER_TARGET_KIND`. Such
external codegens can be expected to have no workspace pools and may not
always have a target associated as their implementation predates this
mechanism. While it is likely a `Target` is specified for all external
codegens in the future, we should still support external codegens
without an associated `Target` until this is enforced.

Co-authored-by: Chris Sidebottom <chris.sidebottom@arm.com>
mikeseven pushed a commit to mikeseven/tvm that referenced this pull request Sep 27, 2023
* [TVMC] Workspace Pools Parameters

Attributes from tvmc are now passable into the created PoolInfo objects
inside WorkspaceMemoryPools. This is passed in to relay.build that get
attached to IRModule attribute.

* [TVMC] Workspace Pools Parameters

Address comments, fix linting. Testing improved.
Change-Id: Iea79329b6b9ec1cbc51e5c293449bf6dd43b00c5

* [TVMC] Workspace Pools Parameters

Update workspace pools test naming
Change-Id: Ib698d6248be1e6f44340f27db3641c985bc5c5d8

* [TVMC] Workspace Pools Parameters

Add test for parameter overrides.

Change-Id: I67d5470dcfbfbc9ab27f34e20a9269d2070193ca

* [TVMC] Workspace Pools Parameters

Rebasing over apache#10189
Updates to the way a WorkspaceMemoryPool object is created
Change-Id: I1f0e1d240343af311ddb3ed5c564cc1ab329f463

* [TVMC] Workspace Pools Parameters

Fix linting, fix CI
Change-Id: If75f8709ac4ad925655eca54b3e5c1bb09d025e8

* [TVMC] Workspace Pools Parameters

Add mcpu and mattr to target registry for cmsis-nn
Change-Id: I15257b8d01624c071c738cab6d12ecb84ed6cb16

* [TVMC] Workspace Pools Parameters

Added test for override on single pool when multiple pools are present
Updated functionality of parsing multiple attributes
Change-Id: I2c0745051b7a923dd7f75040bfb89bbc99376a11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants