benchmark.py script suggests adding synchronization locks
LiuPengJX opened this issue · comments
LiuPeng commented
benchmark.py
It is recommended to add a synchronization lock for calculating fps. The code is as follows:
torch.cuda.synchronize()
tic = time.perf_counter()
model(inputs)
torch.cuda.synchronize()
toc = time.perf_counter()
total_time += toc - tic
thank you!