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

Opperf: Support Python<3.6 #15487

Merged
merged 2 commits into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions benchmark/opperf/opperf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def main():
'output file.')

args = parser.parse_args()
logging.info(f"Running MXNet operator benchmarks with the following options: {args}")
assert not os.path.isfile(args.output_file), f"Output file {args.output_file} already exists."
logging.info("Running MXNet operator benchmarks with the following options: {args}".format(args=args))
assert not os.path.isfile(args.output_file),\
"Output file {output_file} already exists.".format(output_file=args.output_file)

# 2. RUN BENCHMARKS
ctx = _parse_mxnet_context(args.ctx)
Expand All @@ -140,7 +141,7 @@ def main():
# 4. Generate list of MXNet operators not covered in benchmarks
ops_not_covered = get_operators_with_no_benchmark(final_benchmark_results.keys())
for idx, op in enumerate(ops_not_covered):
print(f"{idx}. {op}")
print("{idx}. {op}".format(idx, op))
kshitij12345 marked this conversation as resolved.
Show resolved Hide resolved

return 0

Expand Down
4 changes: 2 additions & 2 deletions benchmark/opperf/utils/benchmark_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def _run_nd_operator_performance_test(op, inputs, run_backward, warmup, runs, kw

# Run Benchmarks
op_benchmark_result = {op.__name__: []}
logging.info(f"Begin Benchmark - {op.__name__}")
logging.info("Begin Benchmark - {name}".format(name=op.__name__))
for idx, kwargs in enumerate(kwargs_list):
_, profiler_output = benchmark_helper_func(op, runs, **kwargs)

# Add inputs used for profiling this operator into result
profiler_output["inputs"] = inputs[idx]
op_benchmark_result[op.__name__].append(profiler_output)
logging.info(f"Complete Benchmark - {op.__name__}")
logging.info("Complete Benchmark - {name}".format(name=op.__name__))
return op_benchmark_result


Expand Down