From c9c5a13694b44df7633d9731acecf122a9579ca5 Mon Sep 17 00:00:00 2001 From: Connor Goggins Date: Wed, 12 Feb 2020 10:22:12 -0800 Subject: [PATCH] Added run_perf_test for ROIPooling op, supporting comments (#17500) --- .../opperf/nd_operations/nn_conv_operators.py | 18 +++++++++++++++++- benchmark/opperf/rules/default_params.py | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/benchmark/opperf/nd_operations/nn_conv_operators.py b/benchmark/opperf/nd_operations/nn_conv_operators.py index 5d614e9065c2..9c80f00c354b 100644 --- a/benchmark/opperf/nd_operations/nn_conv_operators.py +++ b/benchmark/opperf/nd_operations/nn_conv_operators.py @@ -36,6 +36,7 @@ 9. GlobalAvgPool2D 10.GlobalSumPool1D 11.GlobalSumPool2D +12.ROIPooling (Under the hood uses mx.nd.pooling) @@ -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 diff --git a/benchmark/opperf/rules/default_params.py b/benchmark/opperf/rules/default_params.py index 022a1baf3cec..6fca0d553288 100644 --- a/benchmark/opperf/rules/default_params.py +++ b/benchmark/opperf/rules/default_params.py @@ -239,4 +239,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"]