WebDataset
The tar-shard convention (same-basename files = one sample, numbered shards, brace notation) plus a BSD-3 Python library that streams those shards into PyTorch DataLoaders from local disk or any S3-compatible endpoint.
Summary
The tar-shard convention (same-basename files = one sample, numbered shards, brace notation) plus a BSD-3 Python library that streams those shards into PyTorch DataLoaders from local disk or any S3-compatible endpoint.
It is the storage-format answer to the data-loading bottleneck: sequential tar reads keep GPUs fed from object storage at near-wire speed, where per-file random reads collapse. Choose shard formats (WebDataset tar, or MosaicML MDS) when samples are large binary blobs — images, audio, video, npy tensors — and the job is sustained streaming for training. Parquet/JSONL remain the better fit for tabular/text corpora where you also want columnar analytics, schema, and cheap random access; small SFT text sets don't need shards at all.
- WebDataset shuffling is approximate (shard shuffle + a fixed-size sample buffer), not a global shuffle — and unlike MDS it has no built-in deterministic ordering across varying GPU counts or mid-epoch resumption.
- The "format" is just POSIX tar with naming rules; nothing needs converting in, and
tarcan extract it back out. Lock-in lives in the pipeline code, not the data. - GitHub releases lag PyPI badly (v0.3.2 tag vs 1.0.2 on PyPI) — check PyPI, not the releases tab, for the current version.
implementsTraining Data Streaming from Object Storage — the canonical open format for it;pipe:URLs make any S3-compatible store a training source.solvesData Loading Bottleneck — sequential shard reads vs. millions-of-small-files random I/O.alternative_toApache Parquet — shards win for large media blobs and pure sequential training throughput; Parquet wins for tabular/text plus analytics.
Definition
A dataset format convention plus a Python I/O library for streaming training data as sharded POSIX tar archives. Files that share a basename inside a tar (e.g. 0001.jpg + 0001.json) form one training sample; shards are numbered dataset-000000.tar … dataset-012345.tar and addressed with brace notation. The library implements PyTorch's IterableDataset, so a DataLoader can consume shards streamed straight from disk, an HTTP server, or any S3-compatible bucket via pipe: URLs (pipe:curl -s https://… or an aws s3 cp - pipe) — no data conversion, no volume plugins.
Training on millions of small files murders filesystems and object stores alike — random per-file reads can't feed multi-GPU nodes that need aggregate GB/s. Packing samples into ~100MB–1GB tar shards turns all I/O into large sequential reads: the PyTorch team reports roughly 10x I/O improvement on hard drives over file-based random access, and near-hardware-limit throughput (~150 MB/s per rotational drive) when scaling to hundreds of clients against object storage. For self-hosters this is the practical way to train from a MinIO/S3 bucket without copying the dataset to local NVMe first.
Connections6
Outbound6
scoped_to2implements1solves1alternative_to1augments1Resources4
Canonical repo — format conventions, `pipe:` URL streaming, FAQ, and the autodecode source listing supported file types.
PyTorch team's rationale and numbers: 10x HDD I/O gain, ~150 MB/s/drive scaling against object storage, same code local-to-cloud.
Current format description, multimodal guidance, ~1GB shard sizing, and working stream-from-Hub code.
The main alternative (MDS): random access, deterministic shuffle, mid-epoch resume — what to pick when elastic determinism matters.