-
Notifications
You must be signed in to change notification settings - Fork 315
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
Handling the measurements associated with multiple runs #2547
Handling the measurements associated with multiple runs #2547
Conversation
Signed-off-by: Alexandre Eichenberger <[email protected]>
@tungld trying to average the results of multiple runs. Technical question, is there an easy way to add instruction to be the first and the last when inserting instrumentation so that I may initialize/close a file? Right now I only initialize during the first... which is ok but not great. Thanks |
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
I don't know how to determine the last instrument point, but we can call a function to close the file at the end of the entry point |
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
Signed-off-by: Alexandre Eichenberger <[email protected]>
@tungld its ready to be reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -1,12 +1,14 @@ | |||
// RUN: onnx-mlir --mcpu=z16 --maccel=NNPA --printIR --EmitZHighIR --instrument-stage=Onnx --instrument-ops=onnx.* --InstrumentBeforeOp --InstrumentAfterOp --InstrumentReportTime -tag="test" %s | FileCheck %s | |||
// RUN: onnx-mlir --mcpu=z16 --maccel=NNPA --printIR --EmitZHighIR -profile-ir=Onnx %s | FileCheck %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this!
@@ -550,6 +550,9 @@ def warning(msg): | |||
def data_without_top_bottom_quartile(data, percent): | |||
data = np.array(sorted(data)) | |||
trim = int(percent * data.size / 100.0) | |||
if trim == 0 or data.size - 2 * trim < 1: | |||
# Want at least one element, return as is. | |||
return data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I sometimes got the error here with a small number of iterations, say 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So did I :-)
Jenkins Linux s390x Build #12952 [push] Handling the measurement... started at 14:15 |
Jenkins Linux amd64 Build #12928 [push] Handling the measurement... started at 13:15 |
Jenkins Linux ppc64le Build #11945 [push] Handling the measurement... started at 14:23 |
Jenkins Linux amd64 Build #12928 [push] Handling the measurement... passed after 1 hr 3 min |
Jenkins Linux s390x Build #12952 [push] Handling the measurement... passed after 1 hr 16 min |
Jenkins Linux ppc64le Build #11945 [push] Handling the measurement... passed after 1 hr 47 min |
Using the
RunONNXModel.py
, we can generate several perf results which are listed in the measurement file (or stdout) separated by==START-REPORT==
strings.resulting in this
You can then feed it to the
make-report.py
which will remove the top/bottom quartile and then report the average of the remaining one. The same-warmup
option is used to discard the initial runs.