-
Notifications
You must be signed in to change notification settings - Fork 336
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
Enable pass timings reporting with NewPassManager #1163
base: main
Are you sure you want to change the base?
Conversation
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 the PR! I have left some comments on the diff - mostly I think there's some inconsistencies in the naming of things.
The main thing I'm unclear about is whether it makes sense to disable pass timing when reporting the timings. The old pass manager seems to have report / reset as being distinct from disabling it. What is the reason for the change in API here?
Alternatively, should the set_time_passes()
method for the new pass manager also handle both enabling and disabling, and reset_and_report_timings()
only reset and report (not disable)?
TP->print(); | ||
os.flush(); | ||
*outmsg = LLVMPY_CreateString(os.str().c_str()); | ||
TimePassesIsEnabled = false; |
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.
Is there some asymmetry here - do pass instrumentation callbacks need to be unregistered if we've disabled pass timing?
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.
No. A unique PICallbacks
object belongs to PassBuilder
object and is used to do stuff like this(hooks to enable/disable pass timings) after the optimisation pipeline has been built.
llvmlite/binding/newpassmanagers.py
Outdated
"""Returns the pass timings report and resets the LLVM internal timers. | ||
Pass timers are enabled by ``set_time_passes()``. If the timers are not | ||
enabled, this function will return an empty string. |
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.
I think this also disables pass timing.
Pass timings monitoring was always reset and disabled after the report generation across all the examples I saw. Hence, I though What do you think about
|
I'd prefer option 1, but call the functions |
Thanks for review :) I have updated all the API names as per your suggestions. |
Enable LLVM Pass timings reporting with NewPassManager, to be used by Numba