You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think there are a few potential improvements we can make to the original benchmarking code:
for i in range(num_warmup_iterations + num_iterations):
with torch.no_grad():
start.record()
torch.mm(A, B, out=C)
end.record()
arch.synchronize()
times[i] = start.elapsed_time(end)
times = times[num_warmup_iterations:]
elapsed_time = np.amin(times)/1000 # want the fastest
Suggested improvements:
Instead of just taking the minimum time, we should calculate and report more comprehensive statistics: Min/Max/Mean/Std Deviation
This gives a more complete picture of the performance characteristics.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I think there are a few potential improvements we can make to the original benchmarking code:
Suggested improvements:
Instead of just taking the minimum time, we should calculate and report more comprehensive statistics: Min/Max/Mean/Std Deviation
This gives a more complete picture of the performance characteristics.
The synchronization should be handled more carefully. To be honest I think it should be inside the loop. The PyTorch documentation recommends using their timeit module for accurate CUDA timing: https://pytorch.org/tutorials/recipes/recipes/benchmark.html
More documentation here: https://pytorch.org/docs/stable/benchmark_utils.html
Beta Was this translation helpful? Give feedback.
All reactions