Skip to content

Added support for plot #2825

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

Merged
merged 5 commits into from
May 14, 2024
Merged

Conversation

AlexandreEichenberger
Copy link
Collaborator

Added the possibility to generate a jpg with the plot of the result of the analysis of a run.

Recall how to gather data of a run (here run Roberta, gather compile time info on parallel (-opt-report=Parallel, saved with --log-to-file compile.log ) and runtime info (--profile-ir=ZHigh saved with ONNX_MLIR_INSTRUMENT_FILE=run.log).

ONNX_MLIR_INSTRUMENT_FILE=run.log RunONNXModel.py -m roberta-base-11.onnx -c "-O3 -mcpu=z16 -maccel=NNPA -parallel -opt-report=Parallel --profile-ir=ZHigh" --shape-info=0:6x384  --log-to-file compile.log -w 3 -n 16

Then you may view and print statistics as follow

python3 ~/OM/onnx-mlir/utils/make-report.py -ums -r run.log -w 3 -p output -ums

where the raw data is taken from a run-file named run.log skipping the first 3 warmup runs (-w 3) with output in miliseconds (-ums for unit in ms). The resulting graph is:

image

Say you would like to focus the results on operations that take at least 1% of execution time, and report the ops in alphabetical order (default is by decreasing order of execution time). Add the -m 1 --sort name and you get this graph

image

Say you now want to correlate the runtime info with statistics of operations that ran in parallel or not. Update the command to provide the compile-time log:

python3 ~/OM/onnx-mlir/utils/make-report.py -ums -r run.log -c compile.log -s par -p output -m 1 --sort name

image

Signed-off-by: Alexandre Eichenberger <[email protected]>
Copy link
Collaborator

@cjvolzka cjvolzka left a comment

Choose a reason for hiding this comment

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

One typo but otherwise looks great. Thanks for adding the plots!

Parameters to focus analysis:
-f/--focus <regexp>: Focus only on ops that match the regexp pattern.
-m/--min <num>: Focus on operations with at least <num>% of exec time.
-supported: Focus only on ops that are supported. Namely, the report
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Typo, should be --supported:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nice catch, thanks

@AlexandreEichenberger AlexandreEichenberger merged commit 1a0fb56 into onnx:main May 14, 2024
6 of 7 checks passed
@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #14825 [push] Added support for plot (... started at 13:40

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #14830 [push] Added support for plot (... started at 14:40

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #13855 [push] Added support for plot (... started at 14:53

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #14825 [push] Added support for plot (... passed after 1 hr 3 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #14830 [push] Added support for plot (... passed after 1 hr 28 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #13855 [push] Added support for plot (... passed after 1 hr 56 min

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