Skip to content

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

@jcf94

Description

@jcf94

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions