-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
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.
There was a problem hiding this 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 😸
Address comments, fix linting. Testing improved. Change-Id: Iea79329b6b9ec1cbc51e5c293449bf6dd43b00c5
Change-Id: Ib0ef594a04d3a0ac0e901e856ee73a37809db880
Update workspace pools test naming Change-Id: Ib698d6248be1e6f44340f27db3641c985bc5c5d8
There was a problem hiding this 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 = [ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PoolInfo
has documented propertiesPoolInfo
will get upset if you pass incorrect propertiestvmc
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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".
@dchauhan-arm mention me when you're ready for another look here. |
There was a problem hiding this 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( |
There was a problem hiding this comment.
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
8a7f9db
to
31cc299
Compare
@tvm-bot rerun |
Rebasing over apache#10189 Updates to the way a WorkspaceMemoryPool object is created Change-Id: I1f0e1d240343af311ddb3ed5c564cc1ab329f463
@tvm-bot rerun |
Fix linting, fix CI Change-Id: If75f8709ac4ad925655eca54b3e5c1bb09d025e8
Add mcpu and mattr to target registry for cmsis-nn Change-Id: I15257b8d01624c071c738cab6d12ecb84ed6cb16
There was a problem hiding this 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
There was a problem hiding this 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@leandron as a codeowner, could you take a final look ? |
There was a problem hiding this 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!
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
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>
* [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
…#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>
* [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
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