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

Show the compilation phases #2861

Merged
merged 7 commits into from
Jul 8, 2024
Merged

Show the compilation phases #2861

merged 7 commits into from
Jul 8, 2024

Conversation

tungld
Copy link
Collaborator

@tungld tungld commented Jul 3, 2024

This patch is to show the compilation phases which is helpful when compiling a big model that takes a long time.

This is one example of the printed information:

$ onnx-mlir -mcpu=z16 -maccel=NNPA bert_base_uncased_1.onnx
[1/5] Wed Jul  3 03:36:50 2024 Importing ONNX Model to MLIR Module
[2/5] Wed Jul  3 03:36:51 2024 Compiling and Optimizing MLIR Module
[3/5] Wed Jul  3 03:37:14 2024 Translating MLIR Module to LLVM and Generating LLVM Optimized Bitcode
[4/5] Wed Jul  3 03:37:35 2024 Generating Object from LLVM Bitcode
[5/5] Wed Jul  3 03:37:39 2024 Linking and Generating the Output Shared Library

Starting time is added to each phase so that users know how long the current phase takes

tungld added 2 commits July 3, 2024 03:37
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
@tungld
Copy link
Collaborator Author

tungld commented Jul 3, 2024

FYI @tehbone

Signed-off-by: Tung D. Le <tung@jp.ibm.com>
@tehbone
Copy link
Contributor

tehbone commented Jul 3, 2024

Is this default behavior or enabled via switch?

Copy link
Collaborator

@AlexandreEichenberger AlexandreEichenberger 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 for acting on this quickly.

@tehbone it looks like its on, no matter what, from my read of the diff. Would you like to have a switch?

std::string currentTime(buffer);

// Use blue bold text.
llvm::outs() << "[\033[34;1m" << CURRENT_COMPILE_PHASE++ << "/"
Copy link
Collaborator

Choose a reason for hiding this comment

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

ANSI escape sequence isn't support on all terminal types. And different terminal might even interpret the sequence differently. So unless the color adds a lot of value, I would just leave it out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok. Removed it. Thanks!

tungld added 3 commits July 3, 2024 22:05
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
Signed-off-by: Tung D. Le <tung@jp.ibm.com>
@tungld
Copy link
Collaborator Author

tungld commented Jul 4, 2024

Is this default behavior or enabled via switch?

Yes, it's on by default. Let me know if you want a switch or set it off.

@tungld tungld merged commit 8109542 into onnx:main Jul 8, 2024
7 checks passed
@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #15079 [push] Show the compilation pha... started at 20:37

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #14104 [push] Show the compilation pha... started at 20:47

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #15074 [push] Show the compilation pha... started at 19:37

@jenkins-droid
Copy link
Collaborator

Jenkins Linux amd64 Build #15074 [push] Show the compilation pha... passed after 1 hr 6 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux s390x Build #15079 [push] Show the compilation pha... passed after 1 hr 33 min

@jenkins-droid
Copy link
Collaborator

Jenkins Linux ppc64le Build #14104 [push] Show the compilation pha... passed after 2 hr 7 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.

5 participants