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

[TIR] Block dependence analysis without schedules #15146

Merged
merged 2 commits into from
Jun 24, 2023

Conversation

quic-sanirudh
Copy link
Contributor

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 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)

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)
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jun 23, 2023

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

@quic-sanirudh
Copy link
Contributor Author

cc @Hzfengsy @junrushao

Copy link
Member

@Hzfengsy Hzfengsy left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @quic-sanirudh for the great effort on the refactoring

@Hzfengsy Hzfengsy merged commit d26dc44 into apache:main Jun 24, 2023
@quic-sanirudh
Copy link
Contributor Author

LGTM. Thanks @quic-sanirudh for the great effort on the refactoring

Thanks for all your help in design and reviews

@quic-sanirudh quic-sanirudh deleted the add_dependence_info_analysis branch November 15, 2023 02:39
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