ChaiBapchya edited a comment on issue #16864: [Discussion] 1.7.0 Roadmap
URL: 
https://github.com/apache/incubator-mxnet/issues/16864#issuecomment-585461851
 
 
   Proposal : Exposing OpPerf utility in the MXNet's Pip.
   
   @TaoLv As discussing in one of the OpPerf PR's 
(https://github.com/apache/incubator-mxnet/pull/17500), let's make OpPerf 
available to users by adding it to the MXNet binary.
   This will enhance the usability of the tool.
   
   ### Brief Description :  OpPerf
   
   OpPerf is tool for benchmarking MXNet operator execution. It returns 
performance stats about operator (specifically Memory Consumption, Forward Time 
& Backward Time (if applicable)).
   
   Currently, OpPerf utility can be tested by cloning the mxnet repo + setting 
the PYTHONPATH to the path to cloned repo and run in 1 of the 3 ways
   
   #### 1. Benchmark All Ops
   ```
   python incubator-mxnet/benchmark/opperf/opperf.py --output-format json 
--output-file mxnet_operator_benchmark_results.json
   ```
   
   This runs OpPerf on all MXNet operators (whose inputs have been given in 
OpPerf default_params file).
   
   #### 2. Benchmark category-specific ops
   ```
   from benchmark.opperf.nd_operations.binary_operators import 
run_mx_binary_broadcast_operators_benchmarks
   
   # Run all Binary Broadcast operations benchmarks with default input values
   print(run_mx_binary_broadcast_operators_benchmarks())
   ```
   
   #### 3. Benchmark individual ops
   ```
   import mxnet as mx
   from mxnet import nd
   
   from benchmark.opperf.utils.benchmark_utils import run_performance_test
   
   add_res = run_performance_test(nd.add, run_backward=True, dtype='float32', 
ctx=mx.cpu(),
                                  inputs=[{"lhs": (1024, 1024),
                                           "rhs": (1024, 1024)}],
                                  warmup=10, runs=25)
   print(add_res)
   ```
   
   For more details : 
https://github.com/apache/incubator-mxnet/tree/master/benchmark/opperf

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to