Macrodata_Labs
AboutBlogDemo
Announcing MacroHands, our SOTA model for 3D hands and camera path from egocentric video!
// Docs›
Quickstart
Running pipelines
  • In-process debugging
  • Local launcher
Reading data
  • Reader model
  • Sharding
  • LeRobot reader
  • HDF5 reader
  • Zarr reader
  • MCAP reader
  • Tabular files
  • Files and videos
  • Hugging Face
  • TensorFlow
  • Lance
  • Custom readers
Episode data
  • Episode rows
  • Frames and videos
  • Metadata, tasks, and stats
  • Converting to robot rows
Transforms
  • Row transforms
  • Async and batch transforms
  • Vectorized transforms
  • Expressions
  • Schemas and DTypes
Episode operations
  • Motion trimming
  • Subtask annotation
Inference
  • Generate text
  • Multimodal and structured output
  • Inference providers
  • Pooling
Writing data
  • Writer model
  • LeRobot writer
  • Zarr writer
  • Parquet and JSONL writers
  • Lance
  • Media assets and reducers
Examples
  • ALOHA HDF5
  • robomimic HDF5
  • Zarr replay buffer
  • MCAP Franka
  • LIBERO HDF5
  • Merge LeRobot datasets
  • Annotate subtasks
Reference
  • Path formats
  • Optional dependencies
// Docs
Quickstart
Running pipelines
  • In-process debugging
  • Local launcher
Reading data
  • Reader model
  • Sharding
  • LeRobot reader
  • HDF5 reader
  • Zarr reader
  • MCAP reader
  • Tabular files
  • Files and videos
  • Hugging Face
  • TensorFlow
  • Lance
  • Custom readers
Episode data
  • Episode rows
  • Frames and videos
  • Metadata, tasks, and stats
  • Converting to robot rows
Transforms
  • Row transforms
  • Async and batch transforms
  • Vectorized transforms
  • Expressions
  • Schemas and DTypes
Episode operations
  • Motion trimming
  • Subtask annotation
Inference
  • Generate text
  • Multimodal and structured output
  • Inference providers
  • Pooling
Writing data
  • Writer model
  • LeRobot writer
  • Zarr writer
  • Parquet and JSONL writers
  • Lance
  • Media assets and reducers
Examples
  • ALOHA HDF5
  • robomimic HDF5
  • Zarr replay buffer
  • MCAP Franka
  • LIBERO HDF5
  • Merge LeRobot datasets
  • Annotate subtasks
Reference
  • Path formats
  • Optional dependencies

Local launcher

Run Refiner pipelines with local worker processes

Use the local launcher to run workers and process shards on your own machine.

1
2
3
4
pipeline.launch_local(
    name="debug-local",
    num_workers="auto",
)

With num_workers="auto", Refiner starts one local worker for each shard in the current stage. An empty stage starts no workers. Pass a positive integer to cap execution at a fixed number of worker processes.

The local launcher is useful for:

  • verifying a writer on a small dataset
  • checking that a transform is safe across multiple shards
  • checking resource requirements on your hardware

Run ordered stages locally

Run stages in order:

1
2
3
4
5
6
7
8
9
10
workflow = prepare.as_stage(
    name="prepare",
    num_workers=4,
).then(
    publish,
    name="publish",
    num_workers=1,
)

workflow.launch_local(name="staged-local")

Each stage is a complete pipeline with its own source and sink. The next stage starts only after the previous stage completes successfully.

Local runs support per-stage num_workers and gpu settings. Local execution does not accept CPU and memory limits; remove cpus_per_worker and mem_mb_per_worker before calling launch_local(...).

Run directory

Local runs write run metadata under a local run directory. Pass rundir when you want a stable location:

1
2
3
4
5
pipeline.launch_local(
    name="debug-local",
    num_workers=2,
    rundir=".runs/debug-local",
)

Reusing the same run directory allows local execution to resume completed shard work where possible.

Local GPUs

You can request GPUs for local workers:

1
2
3
4
5
pipeline.launch_local(
    name="gpu-check",
    num_workers=1,
    gpu=mdr.GPU(type="h100", count=1),
)

Local GPU assignment controls CUDA_VISIBLE_DEVICES for worker processes.

Environment variables

VariableEffect
REFINER_WORKDIRSets the local worker working directory. Use an absolute path.
XDG_CACHE_HOMESets the cache root used when REFINER_WORKDIR is unset.
CUDA_VISIBLE_DEVICESSelects the GPU IDs available to local workers. Refiner sets this for each worker after assigning GPUs.

Worker files default to $XDG_CACHE_HOME/macrodata/refiner or ~/.cache/macrodata/refiner. Set REFINER_WORKDIR to place them on a disk with enough space for your dataset processing.

Internal Notes

Spark and Beam/Dataflow schedule partitions through distributed executors; Daft and Ray/Ray Data schedule partition tasks through their own runtimes; and Hugging Face Datasets exposes explicit process counts for local transforms. Refiner instead uses ledger-backed shard claims as its scheduling unit, so num_workers sets fixed local process concurrency while each worker repeatedly claims available shards. Shard count controls work granularity, not the number of local worker processes.

// Table of Contents

  1. Run ordered stages locally
  2. Run directory
  3. Local GPUs
  4. Environment variables
  5. Internal Notes
Macrodata_Labs
TermsPrivacyContact
  • GitHub
  • LinkedIn
  • X
  • HuggingFace
  • Discord