petastorm
Routes Petastorm workflows for reading, writing, and converting Parquet-backed datasets for TensorFlow, PyTorch, Spark, and plain Python.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- petastorm
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes Petastorm workflows for reading, writing, and converting Parquet-backed datasets for TensorFlow, PyTorch, Spark, and plain Python.
- disable-model-invocation
- true
02 资源文件 9
- 参考文档references/filesystems-and-paths.md1.8 KB
- 参考文档references/install-and-prereqs.md2.1 KB
- 参考文档references/repo-provenance.md1.4 KB
- 参考文档references/repo-routing-metadata.json330 B
- 参考文档references/schema-and-codecs.md2.4 KB
- 参考文档references/troubleshooting.md2.3 KB
- 参考文档references/workflow-overview.md1.4 KB
- 脚本scripts/check_install.py2.5 KB
- 脚本scripts/smoke_spark_session.py1.4 KB
03 SKILL.md 正文
Petastorm
Petastorm is a data-access library for Apache Parquet datasets with ML-friendly schemas, readers, and Spark-based dataset creation tools.
Use this skill when the task mentions Petastorm, make_reader, make_batch_reader, materialize_dataset, SparkDatasetConverter,
Unischema, Petastorm metadata repair, or the petastorm-*.py console tools.
Start here
- Read
references/repo-provenance.mdif you need to know whether this skill matches the current checkout snapshot. - Run
scripts/check_install.pyto confirm the package imports, optional dependencies, and command entry points. - Run
scripts/smoke_spark_session.pywhen Spark or Java availability is in doubt. - Read
references/install-and-prereqs.mdfor installation, extras, and backend prerequisites. - Read
references/workflow-overview.mdwhen you are choosing between the read, write, or Spark-converter routes. - Read
references/filesystems-and-paths.mdbefore diagnosing URL, HDFS, S3, or GCS path problems. - Read
references/schema-and-codecs.mdbefore designing or repairing a schema or codec. - Read
references/troubleshooting.mdbefore chasing import-order, Spark, URL, or metadata errors.
Choose a route
sub-skills/read-datasets/
Use this route for reading Petastorm datasets or plain Parquet stores, applying predicates or NGrams, shuffling rows, using TensorFlow or PyTorch adapters, reading into Spark RDDs, or running throughput benchmarks.
Helpful bundled files:
sub-skills/read-datasets/references/workflows.mdsub-skills/read-datasets/references/cli-reference.mdsub-skills/read-datasets/references/troubleshooting.mdsub-skills/read-datasets/scripts/smoke_read_minimal_dataset.pysub-skills/read-datasets/scripts/smoke_read_plain_parquet.pysub-skills/read-datasets/scripts/smoke_read_tensorflow.pysub-skills/read-datasets/scripts/smoke_read_torch.py
sub-skills/create-datasets/
Use this route for defining schemas and codecs, materializing datasets, copying or filtering datasets, regenerating metadata, and building row-group indexes or dataset fixes from existing Parquet data.
Helpful bundled files:
sub-skills/create-datasets/references/workflows.mdsub-skills/create-datasets/references/cli-reference.mdsub-skills/create-datasets/references/data-formats.mdsub-skills/create-datasets/references/troubleshooting.mdsub-skills/create-datasets/scripts/smoke_make_minimal_dataset.pysub-skills/create-datasets/scripts/smoke_copy_dataset.pysub-skills/create-datasets/scripts/smoke_generate_metadata.py
sub-skills/spark-converter/
Use this route for make_spark_converter, cached Spark DataFrame materialization, and creating TensorFlow or PyTorch loaders
from a Spark-backed cache directory.
Helpful bundled files:
sub-skills/spark-converter/references/workflows.mdsub-skills/spark-converter/references/troubleshooting.mdsub-skills/spark-converter/scripts/smoke_spark_converter.py
Installation and prerequisites
- Core install:
pip install petastorm - Common extras:
petastorm[tf],petastorm[torch],petastorm[opencv],petastorm[s3fs] - Spark-backed workflows require a working Java runtime and PySpark.
- If you use PyTorch, import
pyarrowbeforetorch.
Minimal import check
python - <<'PY'
import pyarrow
import petastorm
from petastorm import make_reader, make_batch_reader
print(petastorm.__version__)
print(make_reader.__name__, make_batch_reader.__name__)
PY
When you need TensorFlow, PyTorch, OpenCV, or S3/GCS support, read the relevant sub-skill reference first so you add only the needed extras.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).