Composable data loading modules for PyTorch
Low maintenance activity. Last release 21 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install torchdataTorchData (see note below on current status)
What is TorchData? | Stateful DataLoader | Install guide | Contributing | License
:warning: June 2024 Status Update: Removing DataPipes and DataLoader V2
We are re-focusing the torchdata repo to be an iterative enhancement of torch.utils.data.DataLoader. We do not plan on
continuing development or maintaining the [DataPipes] and [DataLoaderV2] solutions, and they will be removed from
the torchdata repo. We'll also be revisiting the DataPipes references in pytorch/pytorch. In release
torchdata==0.8.0 (July 2024) they will be marked as deprecated, and sometime after 0.9.0 (Oct 2024) they will be
deleted. Existing users are advised to pin to torchdata==0.9.0 or an older version until they are able to migrate
away. Subsequent releases will not include DataPipes or DataLoaderV2. The old version of this README is
available here. Please reach out if you suggestions or comments
(please use #1196 for feedback).
What is TorchData?
The TorchData project is an iterative enhancement to the PyTorch torch.utils.data.DataLoader and torch.utils.data.Dataset/IterableDataset to make them scalable, performant dataloading solutions. We will be iterating on the enhancements under the torchdata repo.
Our first change begins with adding checkpointing to torch.utils.data.DataLoader, which can be found in
stateful_dataloader, a drop-in replacement for torch.utils.data.DataLoader, by defining
load_state_dict and state_dict methods that enable mid-epoch checkpointing, and an API for users to track custom
iteration progress, and other custom states from the dataloader workers such as token buffers and/or RNG states.
Stateful DataLoader
torchdata.stateful_dataloader.StatefulDataLoader is a drop-in replacement for torch.utils.data.DataLoader which
provides state_dict and load_state_dict functionality. See
for more information and examples. Also check out the
examples
.