Icemist commented on code in PR #11465:
URL: https://github.com/apache/tvm/pull/11465#discussion_r900010949
##########
src/runtime/graph_executor/debug/graph_executor_debug.cc:
##########
@@ -55,77 +56,96 @@ class GraphExecutorDebug : public GraphExecutor {
* By default, one `repeat` contains `number` runs. If this parameter
is set,
* the parameters `number` will be dynamically adjusted to meet the
* minimum duration requirement of one `repeat`.
+ * \param cooldown_interval_ms The cool down interval between two
measurements in milliseconds.
* \return Comma seperated string containing the elapsed time per op for the
last
* iteration only, because returning a long string over rpc can be
expensive.
*/
- std::string RunIndividual(int number, int repeat, int min_repeat_ms) {
+ std::string RunIndividual(int number, int repeat, int min_repeat_ms, int
cooldown_interval_ms) {
// warmup run
GraphExecutor::Run();
std::string tkey = module_->type_key();
- std::vector<double> time_sec_per_op(op_execs_.size(), 0);
+ std::vector<std::vector<std::vector<double>>>
time_sec_per_op(op_execs_.size());
if (tkey == "rpc") {
// RPC modules rely on remote timing which implements the logic from the
else branch.
for (size_t index = 0; index < op_execs_.size(); ++index) {
- time_sec_per_op[index] += RunOpRPC(index, number, repeat,
min_repeat_ms);
+ time_sec_per_op[index] =
+ RunOpRPC(index, number, repeat, min_repeat_ms,
cooldown_interval_ms);
}
} else {
+ int op = 0;
for (size_t index = 0; index < op_execs_.size(); ++index) {
- std::vector<double> results = RunIndividualNode(index, number, repeat,
min_repeat_ms);
- for (size_t cur_repeat = 0; cur_repeat < results.size(); cur_repeat++)
{
- time_sec_per_op[index] = results[cur_repeat];
-
- LOG(INFO) << "Iteration: " << cur_repeat;
- int op = 0;
- if (op_execs_[index]) {
- LOG(INFO) << "Op #" << op++ << " " << GetNodeName(index) << ": "
- << time_sec_per_op[index] * 1e6 << " us/iter";
+ time_sec_per_op[index] =
+ RunIndividualNode(index, number, repeat, min_repeat_ms,
cooldown_interval_ms);
+ if (op_execs_[index]) {
+ LOG(INFO) << "Op #" << op << " " << GetNodeName(index) << ":";
+ for (size_t cur_repeat = 0; cur_repeat <
time_sec_per_op[index].size(); cur_repeat++) {
+ const auto& data = time_sec_per_op[index][cur_repeat];
+ std::string delimiter = ", ";
+ std::string log;
Review Comment:
Done
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]