-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[MetaSchedule] Add Profiler Support For Tuning Efficiency Optimization #11486
[MetaSchedule] Add Profiler Support For Tuning Efficiency Optimization #11486
Conversation
The annoying logging messages are removed by the #11478, so don't worry about it |
59decb7
to
e9626bc
Compare
a9badbc
to
3c925c8
Compare
Now the profiler supports context from python side.
Output:
|
3c925c8
to
716e15d
Compare
Hi the PR is ready for another round of review. Added a lot of scope timers.
|
Introduced a new macro
Updated the timers to make sure we cover all the parts under task scheduler, without overlapping or missing parts (except minor parts like O(1) level operation). Current table looks like the following one (using dataframe & tabulate).
|
Ready for review. |
An alternate way could be creating a preemptive interface that instead of counting time based solely on scopes, each timer would only count time elapsed in this scope and not in any other timer that created during this scope. For example if we want to count func A & B's time cost, and func A calls B in the scope than we might have to implement it as:
With preemptive timer we can simple implement as
Implementation won’t be super hard, we only need to store current timestamps in a separate stack (I think we cannot reuse the context management timestamp stack because our method will change the semantics of profiler context). The disadvantage is this method introduces some amgiuation in how profiler works and needs an extra stack. |
f1ebebc
to
427f62f
Compare
5e33189
to
b921a16
Compare
b921a16
to
b8cfc67
Compare
# specific language governing permissions and limitations | ||
# under the License. | ||
"""A context manager that profiles tuning time cost for different parts.""" | ||
from __future__ import annotations |
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.
This is only available in Python 3.7+, and fails with 3.6.
This breaks our downstream builds. @zxybazh @junrushao1994
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 reporting this issue! Will remove for compatibility.
Similar to our current performance statistics table, a tuning efficiency statistics table could be extremely helpful. The output result looks like the following example: