Skip to content

Commit

Permalink
Bug: Benchmarks - remove fp16 samples type converting time for cnn an…
Browse files Browse the repository at this point in the history
…d lstm models (#330)

**Description**
Remove fp16  samples type converting time for cnn and lstm models.
  • Loading branch information
yukirora committed Mar 17, 2022
1 parent ff51a3c commit 6e74918
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion superbench/benchmarks/model_benchmarks/pytorch_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def _inference_step(self, precision):
self._model.eval()
while True:
for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available:
sample = sample.cuda()
self._model(sample)
Expand Down
2 changes: 1 addition & 1 deletion superbench/benchmarks/model_benchmarks/pytorch_lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def _train_step(self, precision):
curr_step = 0
while True:
for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available:
sample = sample.cuda()
self._optimizer.zero_grad()
Expand Down

0 comments on commit 6e74918

Please sign in to comment.