def run_all_mxnet_operator_benchmarks(ctx=mx.cpu(), dtype='float32'): """Run all the MXNet operators (NDArray) benchmarks. Returns ------- Dictionary of benchmark results. """ mxnet_operator_benchmark_results = [] # *************************MXNET TENSOR OPERATOR BENCHMARKS***************************** # Run all Unary operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_mx_unary_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Binary Broadcast, element_wise operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_mx_binary_broadcast_operators_benchmarks(ctx=ctx, dtype=dtype)) mxnet_operator_benchmark_results.append(run_mx_binary_element_wise_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all GEMM operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_gemm_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Random sampling operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_mx_random_sampling_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Reduction operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_mx_reduction_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Sorting and Searching operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_sorting_searching_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Array Rearrange operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_rearrange_operators_benchmarks(ctx=ctx, dtype=dtype)) # ************************ MXNET NN OPERATOR BENCHMARKS **************************** # Run all basic NN operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_nn_basic_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Activation operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_activation_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Pooling operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_pooling_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_convolution_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Optimizer operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_optimizer_operators_benchmarks(ctx=ctx, dtype=dtype)) # Run all Transpose Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append(run_transpose_convolution_operators_benchmarks(ctx=ctx, dtype=dtype)) # ****************************** PREPARE FINAL RESULTS ******************************** final_benchmark_result_map = merge_map_list(mxnet_operator_benchmark_results) return final_benchmark_result_map
def run_all_mxnet_operator_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', warmup=25, runs=100): """Run all the MXNet operators (NDArray) benchmarks. Returns ------- Dictionary of benchmark results. """ mxnet_operator_benchmark_results = [] # *************************MXNET TENSOR OPERATOR BENCHMARKS***************************** # Run all Unary operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_unary_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Binary Broadcast, element_wise, and miscellaneous operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_binary_broadcast_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) mxnet_operator_benchmark_results.append( run_mx_binary_element_wise_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) mxnet_operator_benchmark_results.append( run_mx_binary_misc_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all GEMM operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_gemm_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Random sampling operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_random_sampling_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Reduction operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_reduction_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Sorting and Searching operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_sorting_searching_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Array Rearrange operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_rearrange_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Indexing routines benchmarks with default input values mxnet_operator_benchmark_results.append( run_indexing_routines_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # ************************ MXNET NN OPERATOR BENCHMARKS **************************** # Run all basic NN operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_nn_basic_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Activation operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_activation_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Pooling operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_pooling_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_convolution_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Optimizer operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_optimizer_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Transpose Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_transpose_convolution_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all NN loss operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_loss_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Miscellaneous operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_misc_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # Run all Linear Algebra operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_linalg_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, warmup=warmup, runs=runs)) # ****************************** PREPARE FINAL RESULTS ******************************** final_benchmark_result_map = merge_map_list( mxnet_operator_benchmark_results) return final_benchmark_result_map
def run_all_mxnet_operator_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100): """Run all the MXNet operators (NDArray) benchmarks. Returns ------- Dictionary of benchmark results. """ mxnet_operator_benchmark_results = [] # *************************MXNET TENSOR OPERATOR BENCHMARKS***************************** # Run all Unary operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_unary_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Binary Broadcast, element_wise, and miscellaneous operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_binary_broadcast_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) mxnet_operator_benchmark_results.append( run_mx_binary_element_wise_operators_benchmarks( ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) mxnet_operator_benchmark_results.append( run_mx_binary_misc_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all GEMM operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_gemm_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Random sampling operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_random_sampling_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Reduction operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_reduction_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Sorting and Searching operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_sorting_searching_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Indexing routines benchmarks with default input values mxnet_operator_benchmark_results.append( run_indexing_routines_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Array Rearrange operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_rearrange_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Array Shape Manipulation operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_shape_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Array Expansion operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_expanding_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Array Rounding operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_rounding_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Array Join & Split operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_join_split_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # ************************ MXNET NN OPERATOR BENCHMARKS **************************** # Run all basic NN operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_nn_basic_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Activation operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_activation_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Pooling operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_pooling_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_convolution_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Optimizer operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_optimizer_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Transpose Convolution operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_transpose_convolution_operators_benchmarks( ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all NN loss operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_loss_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Run all Miscellaneous operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_mx_misc_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # Linear Algebra operators do not work with int64 tensor data. Issue tracked here: https://github.com/apache/incubator-mxnet/issues/17716 if int64_tensor == 'off': # Run all Linear Algebra operations benchmarks with default input values mxnet_operator_benchmark_results.append( run_linalg_operators_benchmarks(ctx=ctx, dtype=dtype, profiler=profiler, int64_tensor=int64_tensor, warmup=warmup, runs=runs)) # ****************************** PREPARE FINAL RESULTS ******************************** final_benchmark_result_map = merge_map_list( mxnet_operator_benchmark_results) return final_benchmark_result_map