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 4, 2020
1 parent a0506ab commit 5bb778b
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 @@ -174,4 +174,4 @@
"mu", "sigma", "lam", "alpha", "beta", "gamma", "k", "p",
"low", "high", "weight", "bias", "moving_mean", "moving_var",
"weight", "weight32", "grad", "mean", "var", "mom", "n", "d",
"v", "z", "g", "delta", "args", "label"]
"v", "z", "g", "delta", "args", "rois", "label"]

0 comments on commit 5bb778b

Please sign in to comment.