Add dispatch_batches to training arguments (#25038)

* Dispatch batches

* Copy items
This commit is contained in:
Zach Mueller
2023-07-24 09:27:19 -04:00
committed by GitHub
parent 9d2b983ed0
commit 3b734f5042
3 changed files with 76 additions and 2 deletions

View File

@@ -1200,6 +1200,15 @@ class TrainingArguments:
},
)
dispatch_batches: Optional[bool] = field(
default=None,
metadata={
"help": "Whether to dispatch batches across devices in distributed training. If set to `True`, the dataloader prepared by the Accelerator is only iterated through on the main process"
"and then the batches are split and broadcast to each process. Will default to `True` for `DataLoader` whose"
"underlying dataset is an `IterableDataset`, `False` otherwise."
},
)
def __post_init__(self):
# expand paths, if not os.makedirs("~/bar") will make directory
# in the current directory instead of the actual home