Unverified Commit 6e749180 authored by user4543's avatar user4543 Committed by GitHub
Browse files

Bug: Benchmarks - remove fp16 samples type converting time for cnn and lstm models (#330)

**Description**
Remove fp16  samples type converting time for cnn and lstm models.
parent ff51a3ce
...@@ -134,8 +134,8 @@ def _inference_step(self, precision): ...@@ -134,8 +134,8 @@ def _inference_step(self, precision):
self._model.eval() self._model.eval()
while True: while True:
for idx, sample in enumerate(self._dataloader): for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value)) sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available: if self._gpu_available:
sample = sample.cuda() sample = sample.cuda()
self._model(sample) self._model(sample)
......
...@@ -141,8 +141,8 @@ def _train_step(self, precision): ...@@ -141,8 +141,8 @@ def _train_step(self, precision):
curr_step = 0 curr_step = 0
while True: while True:
for idx, sample in enumerate(self._dataloader): for idx, sample in enumerate(self._dataloader):
start = time.time()
sample = sample.to(dtype=getattr(torch, precision.value)) sample = sample.to(dtype=getattr(torch, precision.value))
start = time.time()
if self._gpu_available: if self._gpu_available:
sample = sample.cuda() sample = sample.cuda()
self._optimizer.zero_grad() self._optimizer.zero_grad()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment