AGENT SKILL

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

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.md if you need to know whether this skill matches the current checkout snapshot.
  • Run scripts/check_install.py to confirm the package imports, optional dependencies, and command entry points.
  • Run scripts/smoke_spark_session.py when Spark or Java availability is in doubt.
  • Read references/install-and-prereqs.md for installation, extras, and backend prerequisites.
  • Read references/workflow-overview.md when you are choosing between the read, write, or Spark-converter routes.
  • Read references/filesystems-and-paths.md before diagnosing URL, HDFS, S3, or GCS path problems.
  • Read references/schema-and-codecs.md before designing or repairing a schema or codec.
  • Read references/troubleshooting.md before 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.md
  • sub-skills/read-datasets/references/cli-reference.md
  • sub-skills/read-datasets/references/troubleshooting.md
  • sub-skills/read-datasets/scripts/smoke_read_minimal_dataset.py
  • sub-skills/read-datasets/scripts/smoke_read_plain_parquet.py
  • sub-skills/read-datasets/scripts/smoke_read_tensorflow.py
  • sub-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.md
  • sub-skills/create-datasets/references/cli-reference.md
  • sub-skills/create-datasets/references/data-formats.md
  • sub-skills/create-datasets/references/troubleshooting.md
  • sub-skills/create-datasets/scripts/smoke_make_minimal_dataset.py
  • sub-skills/create-datasets/scripts/smoke_copy_dataset.py
  • sub-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.md
  • sub-skills/spark-converter/references/troubleshooting.md
  • sub-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 pyarrow before torch.

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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351