Skip to content

Conversation

@lhutton1
Copy link
Contributor

@lhutton1 lhutton1 commented Mar 3, 2023

Currently dumps the TIR code after the final phase of lowering (phase 3 from

# Here are the essential transformations done by each phase:
) before codegen. This is done by running a pass to capture the TIR module as it is not saved during the build. The result is saved to file similar to the other code dumps.

In the future it seems good to have more granularity in the IR that is being dumped, e.g. print IR before/after named pass. I thought this might be helpful in the meantime.

cc @ekalda @ashutosh-arm @neildhickey

Currently dumps the TIR code after the final phase of lowering (phase
3 from https://github.com/apache/tvm/blob/665dd413bc85d14f7836324daf7cc0dd9281c85a/gallery/how_to/extend_tvm/low_level_custom_pass.py#L152)
before codegen. This is done by running a pass to capture the TIR
module as it is not saved during the build. The result is saved to
file similar to the other code dumps.

Change-Id: I6da7df8f87ba4d91215adc679d926d4f0ca89019
@tvm-bot
Copy link
Collaborator

tvm-bot commented Mar 3, 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

@github-actions github-actions bot requested review from asparkhi and ekalda March 3, 2023 10:37
Change-Id: I0d1dc761b66c9f41592992580e2ccc0bad8f4769
Copy link
Contributor

@asparkhi asparkhi left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you 😄

@neildhickey
Copy link
Contributor

LGTM too. Thanks

Copy link
Contributor

@echuraev echuraev 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

@asparkhi asparkhi merged commit a15ade3 into apache:main Mar 6, 2023
@asparkhi
Copy link
Contributor

asparkhi commented Mar 6, 2023

Thanks @lhutton1, @neildhickey and @echuraev for the commits and the reviews 😄

@lhutton1 lhutton1 deleted the tvmc-dump-tir branch March 6, 2023 21:13
@PhilippvK
Copy link
Contributor

In the future it seems good to have more granularity in the IR that is being dumped, e.g. print IR before/after named pass. I thought this might be helpful in the meantime.

@lhutton1 I really like these changes. Are you going to do a followup for this soon? If not it would be great if we could open up an issue to collect some ideas. I plan to do something similar for the RelayIR dump (allow dumping post/pre-partitioning IR) and would like to follow a similar approach.

@lhutton1
Copy link
Contributor Author

Hi @PhilippvK, thanks for the interest! I'm hoping to have a follow-up soon (~1wk) but I have another commitment I need to work on first. I'll summarise the thoughts I have in a discuss post - it would be good to see if they align to your thoughts/requirements before diving in

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.

6 participants