tkonolige commented on a change in pull request #7797:
URL: https://github.com/apache/tvm/pull/7797#discussion_r616001810
##########
File path: src/runtime/profiling.cc
##########
@@ -234,135 +391,59 @@ std::string FormatTable(const
std::vector<std::unordered_map<std::string, Object
return s.str();
}
-String Profiler::Report(bool aggregate, bool sort) {
+std::string DeviceString(Device dev) {
+ return DeviceName(dev.device_type) + std::to_string(dev.device_id);
+}
+
+Report Profiler::Report(bool aggregate, bool sort) {
std::vector<std::pair<Device, double>> global_times;
for (auto p : global_timers_) {
global_times.emplace_back(p.first, p.second->SyncAndGetElapsedNanos() /
1e3);
}
- double overall_time = 0.;
+
+ std::unordered_map<String, Map<String, ObjectRef>> overall;
for (auto p : global_times) {
- overall_time = std::max(overall_time, p.second);
+ std::unordered_map<String, ObjectRef> row;
+ row["Name"] = String("Total");
+ row["Duration (us)"] = ObjectRef(make_object<DurationNode>(p.second));
+ row["Percent"] = ObjectRef(make_object<PercentNode>(100));
Review comment:
I fixed the calculation to now be a percent of the longest runtime.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]