Composable data loading modules for PyTorch
Project description
TorchData (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 in 0.9.0 (Oct 2024) they will be deleted. Existing
users are advised to pin to torchdata==0.8.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
the Stateful DataLoader main page for more information and examples. Also check out the
examples
in this Colab notebook.
Installation
Version Compatibility
The following is the corresponding torchdata
versions and supported Python versions.
torch |
torchdata |
python |
---|---|---|
master / nightly |
main / nightly |
>=3.8 , <=3.11 |
2.0.0 |
0.6.0 |
>=3.8 , <=3.11 |
1.13.1 |
0.5.1 |
>=3.7 , <=3.10 |
1.12.1 |
0.4.1 |
>=3.7 , <=3.10 |
1.12.0 |
0.4.0 |
>=3.7 , <=3.10 |
1.11.0 |
0.3.0 |
>=3.7 , <=3.10 |
Local pip or conda
First, set up an environment. We will be installing a PyTorch binary as well as torchdata. If you're using conda, create a conda environment:
conda create --name torchdata
conda activate torchdata
If you wish to use venv
instead:
python -m venv torchdata-env
source torchdata-env/bin/activate
Install torchdata:
Using pip:
pip install torchdata
Using conda:
conda install -c pytorch torchdata
From source
pip install .
In case building TorchData from source fails, install the nightly version of PyTorch following the linked guide on the contributing page.
From nightly
The nightly version of TorchData is also provided and updated daily from main branch.
Using pip:
pip install --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu
Using conda:
conda install torchdata -c pytorch-nightly
Contributing
We welcome PRs! See the CONTRIBUTING file.
Beta Usage and Feedback
We'd love to hear from and work with early adopters to shape our designs. Please reach out by raising an issue if you're interested in using this tooling for your project.
License
TorchData is BSD licensed, as found in the LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for torchdata-0.8.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a43fc7e8d3ae2632859f15d5439cd97b83af559fecd8963e5f09e08f93b81e2 |
|
MD5 | 5b90d417e8db6d49eed94d56aca9bf2a |
|
BLAKE2b-256 | d2c4623f7237c69606d202870bc9e44a8ed9070cc3eb1ac03f02c457083aa746 |
Hashes for torchdata-0.8.0-cp312-cp312-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb878e243e58526a5b3ac54583f7c029ad643a34ade798800c1878c83f1c36ee |
|
MD5 | ef8c30a3dd5da1aabbc808f895829013 |
|
BLAKE2b-256 | ea94d9ac51405d4259094dfa0a1dc3fa4ed2efe057d194873c9f1ba1881b06c9 |
Hashes for torchdata-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3f7efac3d8a4bd4efcb1427869c04043d0a0a019f9aa1eb381bd6c6b321e62 |
|
MD5 | 856b648d5c515a52463d03de0b87b77e |
|
BLAKE2b-256 | 3ef72d1cd02ebcca73ff151dd94b0a08d30808574d944a360470b52a89f0be4e |
Hashes for torchdata-0.8.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8db8a7cb946e82983517cff94317f1898128cbfe4f48821d0c3509c0cdafa4c9 |
|
MD5 | 31c9b6b669b98940ae2af8a8c393ecad |
|
BLAKE2b-256 | 2cf6438a82c2f8d69114ef943c0b58f69f66ea5249bd7b2e4799d44f185f7797 |
Hashes for torchdata-0.8.0-cp311-cp311-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d63d3fdcc68cf912c81709c8704b9cf435ba89bceed41a365e7362eb5740394 |
|
MD5 | 1a33eb786b4c815b31be7b8b04bc6e52 |
|
BLAKE2b-256 | 64e8c691e8e73dc6cbb09ba84ffb0341a6466d3184ff422cda07ebade3b929ef |
Hashes for torchdata-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1635cecf4226fec8539c5d06ba764a48c41363ea0bbea09407ab379828527a8b |
|
MD5 | 91ed3bfa5583eec531176ca04de22957 |
|
BLAKE2b-256 | 82aa4da6c725b03fb51c5a10405803308afd43970e66aad45e8cca872786ba1b |
Hashes for torchdata-0.8.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e985d69c5692dda9181a8ef3e14c7f08b0460226f7cd4cf1c1bb0e6975700f |
|
MD5 | 3183ecc5aaee92f2136c63ef886eb008 |
|
BLAKE2b-256 | 2f54d6f64a6e210ee50b68220d3b5564ffdda8bcc8d26c02a39a8a587caffe2f |
Hashes for torchdata-0.8.0-cp310-cp310-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f7875a62f3fab86e2f8e5af92c4929f8f7390aa17bd697fdd0965723bc1e98 |
|
MD5 | 9edd2879da701f63b0d143675bc16d26 |
|
BLAKE2b-256 | da90058fe345dfac8b50d2d0fdb421ce04c78c88b06a5f220dd8d64d424ccdbe |
Hashes for torchdata-0.8.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 082e27b2acb1768cb6a30ddd2f8d9c68e407164ce207194bf8bfa616d621a801 |
|
MD5 | 6cc714d87ced89c4be2254456d29f5d6 |
|
BLAKE2b-256 | 158a3251c64214ab09d1c1756677f36e78f8cf0ce9dabb3a21386e78ef50540e |
Hashes for torchdata-0.8.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68c3195584ba2d13d79e0b5866191af20b06225a4c9771df455baacb21e2082f |
|
MD5 | f362c254f7cf328a9c985d51ebde59b3 |
|
BLAKE2b-256 | 684a59459ad0b703a8cefeeab387698f3344e8697680b04833a533b5db283cba |
Hashes for torchdata-0.8.0-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | deb712116bf643b89b368c41bbdee57432eaf2562fe4623dea15a86d47bb81bc |
|
MD5 | de4ef9f4f9feceda790461d6548d9921 |
|
BLAKE2b-256 | c4e264dd3b44b51cf8a7e5d5f7021808e173d45fb3aed0f3cb3da186d043a8e8 |
Hashes for torchdata-0.8.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dfeb0b01ae9db334b4daf93b4ee9ab1d83215382a80aa293f40f348e263adb8 |
|
MD5 | 8dae0d3f1802860f082ff147a22eb9d5 |
|
BLAKE2b-256 | fd3a5095648d90cd889a2cdb83dfca0e1049a6c12b97e1f923daf19f051c4843 |
Hashes for torchdata-0.8.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17b184c6302dfafb1e1da4f4fbd9644a9f56c6bc7633e64982fd5a29e52a5cd0 |
|
MD5 | 5a7ab85f169652a7497698914a7aa92d |
|
BLAKE2b-256 | 2560686a73713353998c4f80e4ff069f00b9056a2f26423ca56f4d75d2212640 |
Hashes for torchdata-0.8.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc265a5b10a4a431838918e1a1a76e2930c63f4aaaad6c62182fbe3ea6ea4bbf |
|
MD5 | f598dffef456e8462b448a29166a4c4d |
|
BLAKE2b-256 | cd62a343cc69d312988ba4d22557b64d64b7a7e07c05c8aa3b94be37ba0011ca |
Hashes for torchdata-0.8.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a842fadc17016cd18dcc1ae94088a85904cb0e307e2838a630c45423e0d83f46 |
|
MD5 | d63aa734c50dcfa5bd5f17d9cff54357 |
|
BLAKE2b-256 | 0673dd642ada98ec8844f4653c52dfd2f4785a6d50f8783a89e5641cca7e3d9e |