← all repositories
mosaicml/streaming

Streaming PyTorch Datasets That Survive Node Crashes Mid-Epoch

It lets distributed training jobs stream and mix massive datasets from cloud storage without sacrificing reproducibility or wasting hours on mid-epoch resume spin-up.

1.5k stars Python Data Tooling
streaming
Not currently ranked — collecting fresh signals.
star history

What it does

StreamingDataset acts as a PyTorch-compatible data loader that reads training samples directly from cloud object stores—S3, GCS, Azure, and others—instead of forcing you to keep the entire dataset on local disk. It shards data into a custom MDS format (alongside CSV/TSV/JSONL support), caches chunks on the fly, and plugs into existing training loops as a drop-in replacement for IterableDataset. The repo also ships ready-made converters for popular benchmarks including ImageNet, C4, LAION-400M, and WebVid.

The interesting bit

The real trick isn’t just streaming bytes from the cloud; it’s strict determinism. Sample order is identical whether you run on one GPU or sixty-four, which means you can debug a large distributed run on a single node and resume from exact mid-epoch checkpoints in seconds rather than waiting for the dataloader to re-seek through hours of data.

Key highlights

  • Drop-in replacement for PyTorch IterableDataset with support for images, text, video, and multimodal data.
  • Just-in-time mixing of multiple datasets by proportion or sample count via the Stream abstraction.
  • Deterministic ordering across any topology of GPUs and workers; the README shows identical loss curves on 1, 8, 16, 32, and 64 GPUs (within floating-point limits).
  • Mid-epoch resumption designed to cut idle GPU time and egress fees after hardware failures or loss spikes.
  • Benchmarked on ImageNet + ResNet-50 at roughly 19,000 images/sec, compared to ~18,000 for ImageFolder and ~16,000 for WebDataset after cache warm-up.

Verdict

Worth a look if you’re training large models across multiple nodes and tired of either pre-staging terabytes of data or losing hours to dataloader spin-up after a crash. Skip it if your dataset already fits comfortably on local NVMe and you don’t need cross-run reproducibility.

Frequently asked

What is mosaicml/streaming?
It lets distributed training jobs stream and mix massive datasets from cloud storage without sacrificing reproducibility or wasting hours on mid-epoch resume spin-up.
Is streaming open source?
Yes — mosaicml/streaming is open source, released under the Apache-2.0 license.
What language is streaming written in?
mosaicml/streaming is primarily written in Python.
How popular is streaming?
mosaicml/streaming has 1.5k stars on GitHub.
Where can I find streaming?
mosaicml/streaming is on GitHub at https://github.com/mosaicml/streaming.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.