Skip to content

Commit db3eebf

Browse files
JKSenthilfacebook-github-bot
authored andcommitted
AutoUnit non_blocking=True (#886)
Summary: Pull Request resolved: #886 # Context When adding flag which disabled prefetch from AutoUnit, I made the default `non_blocking=False` when moving batch from cpu->gpu. User here: https://fb.workplace.com/groups/1323951304836028/permalink/1718731732024648/ makes good point to make these async # This DIff Changes to `non_blocking=True` Reviewed By: diego-urgell Differential Revision: D61831174 fbshipit-source-id: 6f522f78b9af9cc6217b2117916ec8cd76e23365
1 parent 926b5ec commit db3eebf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchtnt/framework/auto_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def _prefetch_next_batch(self, state: State, data_iter: Iterator[TData]) -> None
259259
def _get_next_batch(self, state: State, data: Iterator[TData]) -> TData:
260260
if not self._enable_prefetch:
261261
batch = next(data)
262-
return self.move_data_to_device(state, batch, non_blocking=False)
262+
return self.move_data_to_device(state, batch, non_blocking=True)
263263

264264
active_phase = state.active_phase
265265
if not self._phase_to_prefetched[active_phase]:

0 commit comments

Comments
 (0)