Skip to content
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

[BUG] Get wrong measure time in graph debug runtime #7207

Closed
jcf94 opened this issue Jan 5, 2021 · 2 comments · Fixed by #7227
Closed

[BUG] Get wrong measure time in graph debug runtime #7207

jcf94 opened this issue Jan 5, 2021 · 2 comments · Fixed by #7227

Comments

@jcf94
Copy link
Contributor

jcf94 commented Jan 5, 2021

This bug was introduced in #6964 .
Currently, use graph debug runtime will get wrong time result.

Cause:

double RunOpHost(int index) {
auto op_tbegin = std::chrono::high_resolution_clock::now();
op_execs_[index]();
const TVMContext& ctx = data_entry_[entry_id(index, 0)]->ctx;
TVMSynchronize(ctx.device_type, ctx.device_id, nullptr);
auto op_tend = std::chrono::high_resolution_clock::now();
double op_duration =
std::chrono::duration_cast<std::chrono::duration<double> >(op_tend - op_tbegin).count();
return op_duration;
}

This function returns a time with second, but is expected to return microsecond.

cc @areusch

@junrushao
Copy link
Member

I suppose the bug has been fixed by #7197, is that correct?

@areusch
Copy link
Contributor

areusch commented Jan 7, 2021

no, it was tangential to that PR, so this issue is open to track a follow-on to fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants