petastorm
Petastorm is a library enabling the use of Parquet storage from Tensorflow, Pytorch, and other Python-based ML training frameworks.
What it is and what it does
Petastorm is a data access library that bridges Apache Parquet storage and popular Python machine learning frameworks. It was developed at Uber ATG to enable efficient, distributed training of deep learning models directly from Parquet datasets without requiring intermediate format conversions. The library handles the schema mapping between Parquet and framework-specific types (TensorFlow, PyTorch, PySpark), and provides a unified reader interface that supports selective column access, row filtering, shuffling, and partitioning for multi-GPU training.
You use Petastorm in two phases: first, generate a Parquet dataset using PySpark with the Unischema API to define field types, shapes, and compression codecs; then, read from that dataset using the Reader class or framework-specific adapters (tf_tensors for TensorFlow, DataLoader for PyTorch). The library handles parallelism internally via threads, processes, or single-threaded modes, and supports local caching to reduce repeated I/O.
Use it for:
- Train TensorFlow or PyTorch models on large Parquet datasets stored on HDFS or local filesystems without loading entire datasets into memory.
- Generate Parquet datasets from raw data using PySpark, then iterate over them in Python ML training loops with automatic schema validation.
- Distribute training across multiple GPUs by partitioning Petastorm datasets and reading different partitions on different workers.
- Apply row-level filtering and selective column reads to reduce I/O when training on subsets of large datasets.
- Compress image and array data using standard codecs (JPEG, PNG) or custom codecs within a single Parquet-backed dataset.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Petastorm enables direct training of deep learning models from Apache Parquet datasets using TensorFlow, PyTorch, PySpark, or pure Python, with support for selective column access, shuffling, filtering, and distributed parallelism.
Yes, if you are already using Parquet for data storage and training with TensorFlow, PyTorch, or PySpark. The low install friction and permissive license make it a straightforward addition. However, note the aging maintenance status (224 days since last release)—verify compatibility with your specific framework versions before committing to production use. No known security vulnerabilities.
Install
petastorm on PyPI
pip
pip install petastormuv
uv add petastormpoetry
poetry add petastormInstalling petastorm
Before you install
Low friction install with a pure-wheel distribution and 13 runtime dependencies already packaged. Maintenance is aging—last release was 224 days ago—but the repository remains active and unarchived with 1890 stars.
License in practice
Apache License 2.0 is permissive, allowing commercial and private use with minimal restrictions; you must retain license notices in distributions.
Quickstart
pip install petastorm
from petastorm import make_reader
with make_reader('file:///path/to/dataset') as reader:
for row in reader:
print(row)
Requires a Parquet dataset already created in Petastorm format; generating one requires PySpark and the Unischema API shown in the documentation.
Verify before relying
- Whether the aging maintenance status (224 days since last release) affects compatibility with recent TensorFlow or PyTorch versions.
- Performance characteristics and scalability limits for very large distributed datasets.
- Current state of optional dependencies (tf, tf_gpu, torch, opencv) and their version compatibility.
Package facts
| License | Apache License, Version 2.0 (permissive) |
| Python support | supports the current Python release (>=3) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — dill, diskcache, future, numpy, packaging, pandas, psutil, pyspark, pyzmq, pyarrow, six, fsspec, setuptools |
| Maintenance | aging — 224 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 199,587/month — #9,705 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: petastorm-0.13.1-py2.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
litdataLitData optimizes and streams large datasets…
permissive · top 15,000 on PyPI
datasetsLoads and preprocesses datasets from the…
permissive · top 1,000 on PyPI
webdatasetWebDataset reads and streams large-scale…
permissive · top 5,000 on PyPI
spark-sklearnDistributes scikit-learn model training and…
permissive · top 15,000 on PyPI
mosaicml-streamingStreams large training datasets from cloud…
unclear · top 5,000 on PyPI
torchPyTorch provides GPU-accelerated tensor…
permissive · top 1,000 on PyPI
tensorflow-datasetsProvides access to many public datasets as…
permissive · top 5,000 on PyPI
pyspark-huggingfaceRegisters a Spark data source that reads…
permissive · top 5,000 on PyPI
raydpRayDP runs Apache Spark on Ray and integrates…
permissive · top 15,000 on PyPI
keras-nightlyA multi-backend deep learning framework that…
permissive · top 15,000 on PyPI