webdataset
High performance storage and I/O for deep learning and data processing.
What it is and what it does
WebDataset is a PyTorch IterableDataset implementation designed for high-throughput streaming of large training datasets from tar-based shards. It enables purely sequential I/O pipelines, which is critical for achieving high disk and network throughput when training deep learning models at scale. The format stores related files (e.g., images and metadata) together by shared basename within tar archives, and shards are numbered and accessed via brace notation (e.g., `data-{000000..012345}.tar`). This approach works with local storage, cloud object stores, and concatenated MsgPack/CBOR sources.
The library provides both a concise "fluid" interface (recommended for most users) and a lower-level "pipeline" interface for explicit control. It integrates seamlessly with PyTorch's DataLoader for parallel preprocessing and works with TensorFlow and JAX. Key features include no requirement for dataset metadata, instant startup, optional local caching, and scalability from desktop to petascale datasets. Main limitations stem from IterableDataset being less common in PyTorch codebases and the complexity of achieving exactly balanced sample counts across nodes in distributed training.
Use it for:
- Stream large image classification datasets from cloud storage during training without downloading entire dataset locally.
- Build multinode distributed training pipelines that read shards in parallel across compute nodes with shard resampling.
- Preprocess and augment data on-the-fly using PyTorch DataLoader workers while reading sequentially from tar archives.
- Convert existing tar-based datasets to WebDataset format for OCR, document processing, or other shard-to-shard transformations.
- Fine-tune large language models using text datasets stored in WebDataset format with minimal latency.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
WebDataset reads and streams large-scale training data from tar-based shards using sequential I/O, compatible with PyTorch's IterableDataset and usable with PyTorch, TensorFlow, and JAX.
Yes, with conditions. Install if you are building large-scale deep learning pipelines that benefit from sequential I/O and cloud storage integration. The low install friction and permissive license are favorable. However, the aging maintenance status (421 days since last release) and alpha development status mean you should verify that the library's behavior matches your exact use case and multinode requirements before committing to production. No known vulnerabilities.
Install
webdataset on PyPI
pip
pip install webdatasetuv
uv add webdatasetpoetry
poetry add webdatasetInstalling webdataset
Before you install
Low install friction with only three runtime dependencies (braceexpand, numpy, pyyaml). Maintenance status is aging—last release was 421 days ago, though the repository remains active with 3161 stars and a recent commit on 2026-02-09.
License in practice
BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; attribution required.
Quickstart
import webdataset as wds
url = "https://storage.googleapis.com/webdataset/testdata/publaynet-train-{000000..000009}.tar"
dataset = wds.WebDataset(url).shuffle(10).decode("pil").to_tuple("png", "json")
for image, json_data in dataset:
break
Requires PyTorch or a mock IterableDataset implementation; Python >= 3.10.
Verify before relying
- Exact performance gains (3x-10x sequential vs. random access) claimed in description need independent validation.
- Shard resampling behavior and sample balancing across compute nodes in multinode setups not detailed in excerpt.
- Security mode limitations and threat model scope beyond disabling pipe:/file: protocols and pickle decoding.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — braceexpand, numpy, pyyaml |
| Maintenance | aging — 421 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,928,349/month — #2,821 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: webdataset-1.0.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
ideniden manages machine learning datasets…
permissive · top 15,000 on PyPI
litdataLitData optimizes and streams large datasets…
permissive · top 15,000 on PyPI
mosaicml-streamingStreams large training datasets from cloud…
unclear · top 5,000 on PyPI
petastormPetastorm enables direct training of deep…
permissive · top 15,000 on PyPI
datasetsLoads and preprocesses datasets from the…
permissive · top 1,000 on PyPI
torchtexttorchtext provides text datasets, preprocessing…
permissive · top 15,000 on PyPI
s3torchconnectorProvides PyTorch dataset primitives and…
permissive · top 5,000 on PyPI
torchvisionTorchvision provides pre-built datasets, model…
permissive · top 1,000 on PyPI
s3torchconnectorclientInternal S3 client implementation providing…
permissive · top 5,000 on PyPI
grainGrain is a Python library for reading,…
permissive · top 5,000 on PyPI