Skip to content

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

Merged
lhutton1 merged 3 commits intoapache:mainfrom
Anndrey24:main
Jul 25, 2023
Merged

[TVMC] Add tvmc flag to print compilation time per pass#15349
lhutton1 merged 3 commits intoapache:mainfrom
Anndrey24:main

Conversation

@Anndrey24
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

Comment thread tests/python/driver/tvmc/test_command_line.py Outdated
Comment thread python/tvm/driver/tvmc/compiler.py Outdated
Comment thread python/tvm/driver/tvmc/compiler.py Outdated
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
Copy Markdown
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