ChaiBapchya opened a new pull request #15761: [OpPerf] Handle positional 
arguments
URL: https://github.com/apache/incubator-mxnet/pull/15761
 
 
   ## Description ##
   Fixes https://github.com/apache/incubator-mxnet/issues/15735
   Currently, OpPerf utility only takes keyworded arguments **kwargs as 
argument to run the profiler. It is passed as dictionary value to "inputs"
   
   However, certain functions expect positional arguments (*args) instead of 
keyworded arguments (**kwargs).
   
   This PR handles that case.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments 
are documented. 
   - For new examples, README.md is added to explain the what the example does, 
the source of the dataset, expected performance on test set and reference to 
the original paper if applicable
   - Check the API doc at 
http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this 
change, or have been fixed to be compatible with this change
   
   ### Changes ###
   - [ ] Handle positional args
   
   ## Comments ##
   Tested it with 
   a. Clone and checkout this branch
   b. Build the repo \
   c. Test both the cases
   ```
   >>> from benchmark.opperf.utils.benchmark_utils import run_performance_test
   >>> from mxnet import nd
   ```
   ### Without positional arguments
   ```
   >>> run_performance_test(nd.add,run_backward=True, dtype='float32', 
ctx=mx.cpu(),inputs=[{"lhs":(2,2),"rhs":(2,2)}],warmup=10, runs=25)
   INFO:root:Begin Benchmark - add
   INFO:root:Complete Benchmark - add
   [{'add': [{'avg_time_forward_add': 0.0701, 'max_storage_mem_alloc_cpu/0': 
0.008, 'avg_time_backward_add': 0.055, 'inputs': {'lhs': (2, 2), 'rhs': (2, 
2)}}]}]
   ```
   ### With positional arguments
   ```
   
   ```

----------------------------------------------------------------
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