Skip to content

Commit d79bc04

Browse files
committed
reset max memory allocated after each model
1 parent fcfc007 commit d79bc04

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

torchbench/image_classification/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def evaluate_classification(
7272
end = time.time()
7373

7474
memory_allocated = torch.cuda.max_memory_allocated(device=device)
75+
torch.cuda.reset_max_memory_allocated(device=device)
7576

7677
speed_mem_metrics = {
7778
'Tasks Per Second (Total)': test_loader.batch_size/inference_time.avg,

torchbench/object_detection/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ def evaluate_detection_coco(
255255
coco_evaluator.summarize()
256256

257257
memory_allocated = torch.cuda.max_memory_allocated(device=device)
258+
torch.cuda.reset_max_memory_allocated(device=device)
258259

259260
speed_mem_metrics = {
260261
'Tasks Per Second (Total)': test_loader.batch_size/inference_time.avg,

torchbench/semantic_segmentation/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ def evaluate_segmentation(
192192
acc_global, acc, iu = confmat.compute()
193193

194194
memory_allocated = torch.cuda.max_memory_allocated(device=device)
195+
torch.cuda.reset_max_memory_allocated(device=device)
195196

196197
speed_mem_metrics = {
197198
'Tasks Per Second (Total)': test_loader.batch_size/inference_time.avg,

torchbench/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ def __repr__(self):
1616
)
1717

1818

19-
version = Version(0, 0, 28)
19+
version = Version(0, 0, 29)
2020
__version__ = str(version)

0 commit comments

Comments
 (0)