Skip to content

Commit

Permalink
Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerzr committed Nov 1, 2023
1 parent 1ecdede commit d721b4e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/accelerate/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,9 +841,7 @@ def prepare_data_loader(
sampler = getattr(dataloader.batch_sampler, "sampler", None)
if isinstance(sampler, RandomSampler):
# CPU's specifically do not require this workaround
if num_processes == 1 and (device.type == "cpu"):
pass
else:
if not ((num_processes == 1) and (device.type == "cpu")):
# When iterating through the dataloader we want to ensure that
# on each process we are iterating through the same
# samples in the same order if a seed is set. This requires a tweak
Expand Down

0 comments on commit d721b4e

Please sign in to comment.