Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 3fa7177

Browse files
author
Zhang Yan
committed
skip 3 steps in benchmarking
1 parent 55e0d4b commit 3fa7177

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dl_bench/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ def inference(self, backend: Backend):
406406
start = time.perf_counter()
407407
# Duration is inconsistent now
408408
with tm.timeit("duration_s"):
409-
while True:
409+
for i, x in enumerate(test_loader):
410410
s = get_time()
411-
x = backend.to_device(sample)
411+
x = backend.to_device(x)
412412
if backend.dtype != torch.float32:
413413
with torch.autocast(
414414
device_type=backend.device_name,
@@ -417,7 +417,7 @@ def inference(self, backend: Backend):
417417
y = self.net(x)
418418
else:
419419
y = self.net(x)
420-
420+
if i < 3: continue
421421
fw_times.append(get_time() - s)
422422
n_items += len(x)
423423
outputs.append(y)

0 commit comments

Comments
 (0)