Skip to content

Commit

Permalink
examples: improve pytorch microbenchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ymjiang committed Jul 23, 2019
1 parent 00ab3bf commit 59dbbd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions example/pytorch/microbenchmark-byteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def benchmark(tensor, average, name):
# Benchmark
log('Running benchmark...')

log('size (Byte) avg. time (ms) std.dev (ms)')
for i in range(10):
log('size (Byte) \t avg. time (ms) \t std.dev (ms)')
for i in range(8):
size = 10**i
data = torch.rand(size, dtype=torch.float32)
if args.cuda:
Expand All @@ -78,6 +78,6 @@ def benchmark(tensor, average, name):
avg = np.mean(durations)
std = np.std(durations)

log('%d %s %s' % (4*size, '%.3f'%avg, '%.3f'%std))
log('%d \t %s \t %s' % (4*size, '%.3f'%avg, '%.3f'%std))

log('End benchmark.')

0 comments on commit 59dbbd6

Please sign in to comment.