Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,14 @@ def measure_inference_times(compiled_models, stitching_retargeting_module, input
Measure inference times for each model
"""
times = {name: [] for name in compiled_models.keys()}
times['Stitching and Retargeting Modules'] = []
times =torch.cuda.Stream()

overall_times = []

with torch.no_grad():
torch.cuda.synchronize()
for _ in range(100):
torch.cuda.synchronize()

overall_start = time.time()

start = time.time()
Expand Down Expand Up @@ -139,7 +140,7 @@ def measure_inference_times(compiled_models, stitching_retargeting_module, input
times['Stitching and Retargeting Modules'].append(time.time() - start)

overall_times.append(time.time() - overall_start)

torch.cuda.synchronize()
return times, overall_times


Expand Down