Skip to content

Adding annotations for tir.allocate - #9168

Merged
Hzfengsy merged 2 commits into
apache:mainfrom
manupak:tir_allocate_annotatations
Oct 7, 2021
Merged

Adding annotations for tir.allocate#9168
Hzfengsy merged 2 commits into
apache:mainfrom
manupak:tir_allocate_annotatations

Conversation

@manupak

Copy link
Copy Markdown
Contributor

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

Comment threadpython/tvm/tir/stmt.py Outdated
@manupak
manupakforce-pushed the tir_allocate_annotatations branch from 9081089 to 506c2f2CompareOctober 1, 2021 11:13

@MousiusMousius left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to me 😸

@manupakmanupak changed the title Adding annotation for tir.allocateAdding annotations for tir.allocateOct 2, 2021
@manupak
manupakforce-pushed the tir_allocate_annotatations branch from 8e4a870 to f4f916dCompareOctober 4, 2021 14:36
@areusch

Copy link
Copy Markdown
Contributor

please tag the tracking issue @manupa-arm

@areuschareusch left a comment

Copy link
Copy Markdown
Contributor

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

@vinx13vinx13 left a comment

Copy link
Copy Markdown
Member

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

Comment threadinclude/tvm/tir/stmt.h Outdated
Comment threadinclude/tvm/tir/stmt.h Outdated
This commit is adding annotations for tir.allocate
node to be used as hints for future transformations.
Change-Id: I02a3a875c38c3edd449385da5b741ef4958bb47f
@manupak
manupakforce-pushed the tir_allocate_annotatations branch from f4f916d to 4971d09CompareOctober 5, 2021 10:19
@manupak

Copy link
Copy Markdown
ContributorAuthor

Thanks @vinx13 .
I have addressed them now, PTAL.

@HzfengsyHzfengsy left a comment

Copy link
Copy Markdown
Member

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:

classAllocate(WithScopeHandler):
"""With scope handler T.allocate(extents, dtype, scope, condition)"""
def__init__(self):
defallocate(extents, dtype, scope, condition=True, span=None):
condition=tvm.runtime.convert(condition)
scope=tvm.runtime.convert(scope)
returntvm.tir.Allocate(
self.buffer_var, dtype, extents, condition, self.body, span=span
)

@Hzfengsy

Copy link
Copy Markdown
Member

Please also update the three printers:

.set_dispatch<AllocateNode>([](const ObjectRef& node, ReprPrinter* p) {

Doc TVMScriptPrinter::VisitStmt_(const AllocateNode* op) {

Doc TIRTextPrinter::VisitStmt_(const AllocateNode* op) {

@manupak
manupak requested a review from zhiics as a code ownerOctober 6, 2021 09:54
@manupak

Copy link
Copy Markdown
ContributorAuthor

@Hzfengsy thanks for the review!

I think I've done the necessary changes now. PTAL.

@HzfengsyHzfengsy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks, @manupa-arm

@manupak
manupakforce-pushed the tir_allocate_annotatations branch from 00d2218 to 31d8db9CompareOctober 6, 2021 17:58
@manupak
manupakforce-pushed the tir_allocate_annotatations branch from 31d8db9 to 5ff4f7fCompareOctober 6, 2021 22:28
* adding tvmscript support
* adding tir text printing support
Change-Id: Id0b6725b2e79c23f6b8ff192772f1ea4125a27c2
@manupak
manupakforce-pushed the tir_allocate_annotatations branch from 5ff4f7f to 94b7435CompareOctober 7, 2021 05:35
@manupak

Copy link
Copy Markdown
ContributorAuthor

@vinx13@Hzfengsy merge?

@Hzfengsy
Hzfengsy merged commit 2dae303 into apache:mainOct 7, 2021
@Hzfengsy

Copy link
Copy Markdown
Member

Sorry for the late response. Thanks @manupa-arm.

ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
* 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
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* 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
Sign up for freeto 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

@manupak@areusch@Hzfengsy@Mousius@vinx13