-
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
Adding annotations for tir.allocate #9168
Conversation
9081089
to
506c2f2
Compare
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.
Makes sense to me 😸
8e4a870
to
f4f916d
Compare
please tag the tracking issue @manupa-arm |
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.
deferring to @vinx13 for approval but lgtm
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.
Some minor comments, otherwise LGTM
This commit is adding annotations for tir.allocate node to be used as hints for future transformations. Change-Id: I02a3a875c38c3edd449385da5b741ef4958bb47f
f4f916d
to
4971d09
Compare
Thanks @vinx13 . |
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.
Please also update the Script syntax and add a testcase.
The related codes are here:
tvm/python/tvm/script/tir/scope_handler.py
Lines 106 to 115 in d9a5ff5
class Allocate(WithScopeHandler): | |
"""With scope handler T.allocate(extents, dtype, scope, condition)""" | |
def __init__(self): | |
def allocate(extents, dtype, scope, condition=True, span=None): | |
condition = tvm.runtime.convert(condition) | |
scope = tvm.runtime.convert(scope) | |
return tvm.tir.Allocate( | |
self.buffer_var, dtype, extents, condition, self.body, span=span | |
) |
Please also update the three printers: Line 385 in d9a5ff5
tvm/src/printer/tvmscript_printer.cc Line 762 in d9a5ff5
tvm/src/printer/tir_text_printer.cc Line 449 in d9a5ff5
|
@Hzfengsy thanks for the review! I think I've done the necessary changes now. PTAL. |
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, @manupa-arm
00d2218
to
31d8db9
Compare
31d8db9
to
5ff4f7f
Compare
* adding tvmscript support * adding tir text printing support Change-Id: Id0b6725b2e79c23f6b8ff192772f1ea4125a27c2
5ff4f7f
to
94b7435
Compare
Sorry for the late response. Thanks @manupa-arm. |
* Adding annotation for tir.allocate This commit is adding annotations for tir.allocate node to be used as hints for future transformations. Change-Id: I02a3a875c38c3edd449385da5b741ef4958bb47f * Adding annotation for tir.allocate * adding tvmscript support * adding tir text printing support Change-Id: Id0b6725b2e79c23f6b8ff192772f1ea4125a27c2
* Adding annotation for tir.allocate This commit is adding annotations for tir.allocate node to be used as hints for future transformations. Change-Id: I02a3a875c38c3edd449385da5b741ef4958bb47f * Adding annotation for tir.allocate * adding tvmscript support * adding tir text printing support Change-Id: Id0b6725b2e79c23f6b8ff192772f1ea4125a27c2
This commit is adding annotations for tir.allocate node to be used as hints for future transformations.
Please refer to the discussion : apache/tvm-rfcs#23
cc: @tqchen @junrushao1994 @areusch