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

[TVMC] Add tvmc flag to print compilation time per pass #15349

Merged
merged 3 commits into from
Jul 25, 2023

Conversation

Anndrey24
Copy link
Contributor

@Anndrey24 Anndrey24 commented Jul 18, 2023

Added a new flag --print-pass-times for tvmc compile to provide debugging information for tvmc users using PassTimingInstrument.
Also added a test to check the printing of timing results.
Example output:

Compilation time breakdown by pass:
sequential: 431498us [48us] (88.48%; 88.48%)
	RemoveUnusedFunctions: 14us [14us] (0.00%; 0.00%)
	ToBasicBlockNormalForm: 66us [66us] (0.01%; 0.02%)
	qnn.Legalize: 2167us [24us] (0.44%; 0.50%)
		InferType: 617us [617us] (0.13%; 28.48%)

Added a new flag `--print-pass-times` for tvmc compile to provide debugging information for tvmc users using `PassTimingInstrument`.
Also added a test to check the printing of timing results.
@tvm-bot
Copy link
Collaborator

tvm-bot commented Jul 18, 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

Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

Thanks @Anndrey24, I think this will be a really useful feature for debugging compilation performance issues! The patch looks great, I just had some small questions/comments below. If possible could you add a small example of the output to the PR description?

tests/python/driver/tvmc/test_command_line.py Outdated Show resolved Hide resolved
python/tvm/driver/tvmc/compiler.py Outdated Show resolved Hide resolved
python/tvm/driver/tvmc/compiler.py Outdated Show resolved Hide resolved
Moved patch functionality inside `compile_model` to allow printing pass times from both TVMC Python API and command line API.
Changed test to search for timing-specific keywords.
Copy link
Contributor

@lhutton1 lhutton1 left a comment

Choose a reason for hiding this comment

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

Thanks @Anndrey24, LGTM!

@lhutton1 lhutton1 merged commit 9ff74fb into apache:main Jul 25, 2023
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