Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
add mean, median, p90,p99 to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaiBapchya committed Aug 21, 2019
1 parent 25c25e4 commit bb3e9fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion benchmark/opperf/utils/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def _prepare_op_benchmark_result(op, op_bench_result, profiler):
max_mem_usage = "---"
inputs = "---"
avg_time = "---"
p50_time = "---"
p90_time = "---"
p99_time = "---"

for key, value in op_bench_result.items():
if "avg_time_forward" in key:
avg_forward_time = value
Expand All @@ -108,12 +112,19 @@ def _prepare_op_benchmark_result(op, op_bench_result, profiler):
inputs = value
elif "avg_time" in key:
avg_time = value
elif "p50_" in key:
p50_time = value
elif "p90_" in key:
p90_time = value
elif "p99_" in key:
p99_time = value

result = ""
if profiler == "native":
result = "| {} | {} | {} | {} | {} |".format(operator_name,
avg_forward_time, avg_backward_time, max_mem_usage, inputs)
elif profiler == "python":
result = "| {} | {} | {} |".format(operator_name, avg_time, inputs)
result = "| {} | {} | {} | {} | {} | {} |".format(operator_name, avg_time, p50_time, p90_time, p99_time, inputs)
return result


Expand Down

0 comments on commit bb3e9fc

Please sign in to comment.