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

Commit

Permalink
Added run_perf_test for ROIPooling op, supporting comments
Browse files Browse the repository at this point in the history
  • Loading branch information
connorgoggins committed Feb 12, 2020
1 parent bdd34e9 commit 23a8808
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion benchmark/opperf/nd_operations/nn_conv_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
9. GlobalAvgPool2D
10.GlobalSumPool1D
11.GlobalSumPool2D
12.ROIPooling
(Under the hood uses mx.nd.pooling)
Expand Down Expand Up @@ -90,8 +91,23 @@ def run_pooling_operators_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='na
],
warmup=warmup,
runs=runs)
# Run ROI Pooling performance runs
roipool_benchmark_res = []
for roipool_data in [(32, 3, 256, 256), (32, 3, 64, 64)]:
roipool_benchmark_res += run_performance_test([getattr(MX_OP_MODULE, "ROIPooling")],
run_backward=True,
dtype=dtype,
ctx=ctx,
profiler=profiler,
inputs=[{"data": roipool_data,
"rois": (32, 5),
"pooled_size": (2, 2),
"spatial_scale": .5}
],
warmup=warmup,
runs=runs)
# Prepare combined results
mx_pooling_op_results = merge_map_list(pool1d_benchmark_res + pool2d_benchmark_res)
mx_pooling_op_results = merge_map_list(pool1d_benchmark_res + pool2d_benchmark_res + roipool_benchmark_res)
return mx_pooling_op_results


Expand Down
2 changes: 1 addition & 1 deletion benchmark/opperf/rules/default_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,4 @@
"weight", "weight32", "grad", "mean", "var", "mom", "n", "d",
"v", "z", "g", "delta", "args", "indices", "shape_like", "y",
"x", "condition", "a", "index", "raveL_data", "label", "grid",
"A", "B", "C"]
"A", "B", "C", "rois"]

0 comments on commit 23a8808

Please sign in to comment.