Skip to content

[TVMScript] Syntax sugar for reads & writes#9634

Merged
vinx13 merged 8 commits into
apache:mainfrom
shingjan:tir-reads-writes-syntax-sugar
Dec 7, 2021
Merged

[TVMScript] Syntax sugar for reads & writes#9634
vinx13 merged 8 commits into
apache:mainfrom
shingjan:tir-reads-writes-syntax-sugar

Conversation

@shingjan

@shingjan shingjan commented Dec 2, 2021

Copy link
Copy Markdown

This PR intends to add syntax sugar for T.reads and T.writes
Before this PR:

T.reads([C[vi, vj], A_shared[vk, vi], B[vk, vj]])
T.writes([C[vi, vj]])

After this PR:

T.reads(C[vi, vj], A_shared[vk, vi], B[vk, vj])
T.writes(C[vi, vj])

cc: @vinx13 @junrushao1994 @Hzfengsy

@shingjan shingjan changed the title [TVMScript] Syntax sugar for reads & writes [WIP][TVMScript] Syntax sugar for reads & writes Dec 2, 2021
@shingjan shingjan requested a review from zhiics as a code owner December 2, 2021 21:14
@vinx13

vinx13 commented Dec 2, 2021

Copy link
Copy Markdown
Member

please also update type stubs (adding an overload like reads(*read_regions: BufferSlice)

@shingjan

shingjan commented Dec 3, 2021

Copy link
Copy Markdown
Author

@vinx13 stub is updated

@vinx13

vinx13 commented Dec 3, 2021

Copy link
Copy Markdown
Member

please fix CI error

@shingjan

shingjan commented Dec 4, 2021

Copy link
Copy Markdown
Author

@vinx13 I fixed the CI error by removing the test_mismatch_args in test_tvmscript_error_report as the error condition of that test, T.reads(A[...], A[...]) ----> error on mismatch args no longer holds after this PR. @Hzfengsy It would be great if you can take a look and confirm it. Thanks!

Comment thread python/tvm/script/tir/__init__.pyi Outdated
@junrushao

Copy link
Copy Markdown
Member

Let's also improve the printer to print the sugared syntax by default :-)

@shingjan shingjan changed the title [WIP][TVMScript] Syntax sugar for reads & writes [TVMScript] Syntax sugar for reads & writes Dec 6, 2021
Comment thread python/tvm/script/tir/__init__.pyi Outdated

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

Okay. Let's move quickly to get this PR in, and improve the printer in a subsequent PR.

@vinx13 vinx13 merged commit 459563d into apache:main Dec 7, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 7, 2022
* add test file

* add syntax sugar support

* add comments

* cleanup

* update stub

* remove failed tests

* update stub with overload

* address comments
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 11, 2022
* add test file

* add syntax sugar support

* add comments

* cleanup

* update stub

* remove failed tests

* update stub with overload

* address comments
yangulei pushed a commit to yangulei/tvm that referenced this pull request Jan 12, 2022
* add test file

* add syntax sugar support

* add comments

* cleanup

* update stub

* remove failed tests

* update stub with overload

* address comments
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
* add test file

* add syntax sugar support

* add comments

* cleanup

* update stub

* remove failed tests

* update stub with overload

* address comments
qsqqsqqsq-intellif pushed a commit to qsqqsqqsq-intellif/tvm that referenced this pull request Apr 29, 2022
* add test file

* add syntax sugar support

* add comments

* cleanup

* update stub

* remove failed tests

* update stub with overload

* address comments
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.

3 participants