-
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
[PROFILING] Add ability to profile a single function_profiling #9553
Conversation
Add a new function `tvm.runtime.profiling.profile_function` which collects performance metrics for a single function in an IRModule. For example, collecting performance counters using `PAPIMetricCollector`. This is helpful for optimizing kernels and schedules for a single operator.
6f217ec
to
327fcaa
Compare
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.
couple questions @tkonolige
src/runtime/profiling.cc
Outdated
Device dev{static_cast<DLDeviceType>(device_type), device_id}; | ||
|
||
// warmup | ||
for (size_t i = 0; i < 10; i++) { |
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.
seems like this one should be configurable?
src/runtime/profiling.cc
Outdated
std::unordered_map<String, ObjectRef> results; | ||
for (size_t i = 0; i < collectors.size(); i++) { | ||
auto r = collectors[i]->Stop(collector_data[i]); | ||
// We might want to do this in a separate loop to avoid unnecessary time |
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.
should we just do that now? seems better...
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.
done
@areusch Could you re-review? |
@areusch gentle ping |
…e#9553) * [PROFILING] Add ability to profile a single function_profiling Add a new function `tvm.runtime.profiling.profile_function` which collects performance metrics for a single function in an IRModule. For example, collecting performance counters using `PAPIMetricCollector`. This is helpful for optimizing kernels and schedules for a single operator. * fix docs * configurable number of warmup iterations. avoid allocating when stopping collectors
…e#9553) * [PROFILING] Add ability to profile a single function_profiling Add a new function `tvm.runtime.profiling.profile_function` which collects performance metrics for a single function in an IRModule. For example, collecting performance counters using `PAPIMetricCollector`. This is helpful for optimizing kernels and schedules for a single operator. * fix docs * configurable number of warmup iterations. avoid allocating when stopping collectors
Add a new function
tvm.runtime.profiling.profile_function
which collects performance metrics for a single function in an IRModule. For example, collecting performance counters usingPAPIMetricCollector
. This is helpful for optimizing kernels and schedules for a single operator.