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
[TIR] Refactor BlockScope outside schedule #15034
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR does 2 major changes to TIR. 1. Move stage_pipeline member into `BlockInfo` from `BlockScope` 2. Extract `BlockScope` outside schedule This is the first step of a change to expose block level dependence analysis to TIR passes. This PR moves BlockScope to be outside schedules so that it can be used in a follow-up analysis pass to compute block level dependences if needed for a transformation pass. There is some extra discussion about this change in [this discussion forum post](https://discuss.tvm.apache.org/t/why-is-block-dependency-info-attached-to-schedules/14975)
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
Hzfengsy
approved these changes
Jun 8, 2023
junrushao
pushed a commit
to junrushao/tvm
that referenced
this pull request
Jun 22, 2023
This PR does 2 major changes to TIR. 1. Move stage_pipeline member into `BlockInfo` from `BlockScope` 2. Extract `BlockScope` outside schedule This is the first step of a change to expose block level dependence analysis to TIR passes. This PR moves BlockScope to be outside schedules so that it can be used in a follow-up analysis pass to compute block level dependences if needed for a transformation pass. There is some extra discussion about this change in [this discussion forum post](https://discuss.tvm.apache.org/t/why-is-block-dependency-info-attached-to-schedules/14975)
quic-sanirudh
added a commit
to quic-sanirudh/tvm
that referenced
this pull request
Jun 23, 2023
This work introduces a new object called `BlockDependenceInfo` that computes and returns block dependences. The idea is to be able to expose block level dependences to TIR passes without having to create an explicit schedules. The patch introduces 2 main classes: 1. `SRefTreeCreator` - This creates and returns a new SRefTree and returns a map from original statements to corresponding srefs 2. `BlockDependenceInfo` - This object computes the actual dependences between blocks within a block scope and returns it for access in TIR passes This is a continuation to [PR apache#15034](apache#15034) and completes the work started there to expose block level dependences to TIR passes Note: One major difference between the SRef Tree created for dependence analysis here versus the one already present in schedules is that this SRef tree only contains block nodes and not loops. This makes it easier to find the parent blocks (by just accessing `parent` member)
Hzfengsy
pushed a commit
that referenced
this pull request
Jun 24, 2023
* [TIR] Block dependence analysis without schedules This work introduces a new object called `BlockDependenceInfo` that computes and returns block dependences. The idea is to be able to expose block level dependences to TIR passes without having to create an explicit schedules. The patch introduces 2 main classes: 1. `SRefTreeCreator` - This creates and returns a new SRefTree and returns a map from original statements to corresponding srefs 2. `BlockDependenceInfo` - This object computes the actual dependences between blocks within a block scope and returns it for access in TIR passes This is a continuation to [PR #15034](#15034) and completes the work started there to expose block level dependences to TIR passes Note: One major difference between the SRef Tree created for dependence analysis here versus the one already present in schedules is that this SRef tree only contains block nodes and not loops. This makes it easier to find the parent blocks (by just accessing `parent` member) * Fix lint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR does 2 major changes to TIR.
stage_pipeline
member intoBlockInfo
fromBlockScope
BlockScope
outside scheduleThis is the first step of a change to expose block level dependence analysis to TIR passes. This PR moves BlockScope to be outside schedules so that it can be used in a follow-up analysis pass to compute block level dependences if needed for a transformation pass.
There is some extra discussion about this change in this discussion forum post