ChaiBapchya commented on a change in pull request #17642: [OpPerf] Fixed Python
profiler bug
URL: https://github.com/apache/incubator-mxnet/pull/17642#discussion_r382762705
##########
File path: benchmark/opperf/utils/profiler_utils.py
##########
@@ -248,12 +248,11 @@ def python_profile(func):
@functools.wraps(func)
def python_profile_it(*args, **kwargs):
runs = args[1]
- modified_args = (args[0], 1, args[2])
times = []
for _ in range(runs):
start_time = time.perf_counter() # 1
- res = func(*modified_args, **kwargs)
Review comment:
@connorgoggins @apeforest
If we pass the *args as is, it will still have
args[0] as op
args[1] as runs
For eg if user passed runs as 10
So the native profiler would run 10 times and so will the for loop run 10
times (for timing Python profiler)
Coz the func here is nd_forward_backward_profile or nd_forward_profile (both
take runs as a parameter)
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services