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

[TensorIR] [Script] adding support for opaque block #7829

Merged
merged 5 commits into from Apr 13, 2021

Conversation

Hzfengsy
Copy link
Member

In this PR, we add script support for opaque blocks.

An opaque block is a block without any block iterations and we need to specify the read/write region manually.

cc @junrushao1994 @spectrometerHBH @tqchen

python/tvm/script/scope_handler.py Outdated Show resolved Hide resolved
python/tvm/script/scope_handler.py Outdated Show resolved Hide resolved
include/tvm/tir/stmt.h Show resolved Hide resolved
@@ -1316,6 +1316,14 @@ constexpr const char* fragment_layout = "fragment_layout";
* \brief Mark that the kernel is hand threaded and doesn't need syncs inserted
*/
constexpr const char* hand_threaded = "hand_threaded";

/*!
* \brief Mark that whether a block need to be complete access region during script parsing.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* \brief Mark that whether a block need to be complete access region during script parsing.
* \brief Mark whether a block need to be complete access region during script parsing.

Can you clarify this part? to be complete access region this doesn't parse in English for me.

Copy link
Member

Choose a reason for hiding this comment

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

Mark whether the auto-completer need to fill in missing access region during script parsing.

// ignore root block or blocks which already has reads/writes regions
if (block->reads.empty() || block->writes.empty()) {
if (mask != 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we moved away from high level checks like this? the masking logic is way less clear from my PoV.

Copy link
Member

Choose a reason for hiding this comment

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

The reason being the that the reads/write empty may not be a good indicator(since user might indicated the reads write being empty explicitly) and we need requests from the parser side.

Copy link
Member

Choose a reason for hiding this comment

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

Can we potentially wrap the masking logic? I think its a bit of a leaky abstraction for end users to need to understand low level bit masking, happy to have this be a follow up item.

Copy link
Member

Choose a reason for hiding this comment

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

This is an abstraction being used by the parser(during parsing), but not being used as part of standard TIR, so it might be fine here. Happy to change to two boolean flags if needed

@tqchen
Copy link
Member

tqchen commented Apr 13, 2021

@jroesch please take another look if you have time

@tqchen tqchen self-assigned this Apr 13, 2021
@jroesch
Copy link
Member

jroesch commented Apr 13, 2021

I left one more comment we can resolve async.

@jroesch jroesch merged commit 7f56726 into apache:main Apr 13, 2021
@Hzfengsy Hzfengsy deleted the enhance_script branch April 15, 2021 05:56
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* change complete tag

* add parsing support for opaque block

* address and add testcase

* address

* address
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* change complete tag

* add parsing support for opaque block

* address and add testcase

* address

* address
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request May 6, 2021
* change complete tag

* add parsing support for opaque block

* address and add testcase

* address

* address
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request May 11, 2021
* change complete tag

* add parsing support for opaque block

* address and add testcase

* address

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

None yet

3 participants