OpenTau: VLA Training Infrastructure for Real-World Robotics

repository·main·Indexed 41 days ago

https://github.com/tensorauto/opentau

An open-source training toolchain for Vision-Language-Action (VLA) models in PyTorch. Built as a fork of LeRobot, OpenTau supports scalable training techniques including Knowledge Insulation (KI), co-training on heterogeneous datasets, and multi-GPU support. It provides policy architectures such as π0.5, π0.6, π0.7, and cosmos3, along with diagnostic tools for profiling training steps and dataloaders, and hardware support for SO-100/SO-101 robotic arms.

Tokens
49.9K
Snippets
133
Records
193
Agent score
53%

What's inside OpenTau

  1. Overview of OpenTau diagnostic scripts

    main

    OpenTau provides four diagnostic scripts located in src/opentau/scripts/ to help identify performance bottlenecks in training and inference. All training scripts use the same TrainPipelineConfig as opentau-train, ensuring they reproduce the exact model, dataset, and batch size of your actual run.

    ScriptPurpose
    profile_step.pyMeasures per-step wall-clock time, broken down into forward, backward, optimizer, and sync phases. Use this to find out why training is slow.
    profile_dataloader.pyMeasures the dataloader-only throughput ceiling. Use this to rule out input-pipeline starvation before investigating the GPU.
    find_unused_params.pyLists parameters that receive no gradient during a forward+backward pass. Use this to determine if you can safely set find_unused_parameters=False in DDP.
    benchmark_inference.pyMeasures per-call policy.sample_actions latency under deployment-like conditions (random-init expert, bf16, batch 1). Use this to characterize serving or on-robot speed.
  2. Overview of OpenTau for VLA Training

    main

    OpenTau is an open-source training toolchain designed for training Vision-Language-Action (VLA) models. It is built as a fork of the LeRobot repository, meaning it is compatible with any LeRobot-compliant policy and dataset.

    Key capabilities include:

    • Co-training on heterogeneous datasets.
    • Discrete actions for fast VLM convergence.
    • Knowledge Insulation (KI) between the VLM backbone and the action expert.
    • Support for various policy architectures: $\pi_{0.5}$, $\pi_{0.6}$, $\pi_{0.7}$ (hierarchical), and cosmos3 (frozen backbone with custom action expert).
    • Multi-node and multi-GPU training support.
    • Integrated training profilers and unused-parameter auditors.
  3. Key features of OpenTau for VLA training

    main

    OpenTau provides several advanced training techniques for Vision-Language-Action (VLA) models, specifically designed to implement the methodologies found in the $\pi$-series papers:

    • Co-training: Training on an adjustable mixture of heterogeneous datasets.
    • Discrete Actions: Enables faster VLM convergence in $\pi_{0.5}$ models.
    • Knowledge Insulation: Separates the VLM backbone from the action expert.
    • Response Prediction: Supports training on VQA datasets and high-level planning during inference in $\pi_{0.5}$.
    • Overfitting Prevention: Includes dropout layers within the VLM.
    • RL Pipeline: Implements the reinforcement learning pipeline described in $\pi^*_{0.6}$.
    • Scalability: Supports multi-node and multi-GPU training.
    • Evaluation: Includes simulation environments for model evaluation.
  4. How action offsets are calculated for sequence training

    main

    In pi05_ttt sequence training, the window is anchored at the last timestep (the 'live' frame). While observations use existing history windows, actions require new temporal offsets to provide a chunk of actions for every timestep $t$ in the sequence.

    For a sequence of length $T$, a chunk size $H$, and a temporal stride stride, the action offsets are calculated as a flat list of $T \times H$ offsets:

    # timestep t, chunk position h  ->  one flat list of T * H offsets
    [(-(T - 1 - t) * stride + h) / action_freq
     for t in range(T) for h in range(H)]

    These are fetched as a tensor of shape (T * H, dim) and then reshaped to (T, H, dim) during item assembly.

    [(-(T - 1 - t) * stride + h) / action_freq
     for t in range(T) for h in range(H)]
  5. Manage training configurations with TrainPipelineConfig

    main

    OpenTau uses Draccus for configuration management. The central orchestration class is opentau.configs.train.TrainPipelineConfig. This class manages training settings, policy configurations, and environment setups. You can load configurations directly from pretrained checkpoints to ensure experiment reproducibility.

    # Example concept: loading a config from a checkpoint
    # (Actual implementation depends on the Draccus/OpenTau integration)
    config = opentau.configs.train.TrainPipelineConfig.from_checkpoint("path/to/checkpoint")
  6. Understand Dataset Metadata

    main

    Metadata defines the structure and statistics of a dataset, managed by LeRobotDatasetMetadata and DatasetMetadata. It is stored in JSON (info.json, stats.json) and JSONL (tasks.jsonl) files. Key components include:

    • Info: Contains feature shapes, data types, FPS, and robot_type (a LeRobot v2 field).
    • Stats: Contains mean, standard deviation, min, and max values for normalization.
    • Tasks: Natural language descriptions of the tasks in the dataset.
  7. Understand the RoboCasa WebSocket protocol (Requests and Responses)

    main

    The server communicates via WebSocket using MessagePack. The server uses policy.sample_actions to predict a temporal chunk of actions rather than a single step.

    Request Formats

    • Single observation: A dictionary containing:
      • images: JPEG bytes per camera name.
      • state: A list of floats.
      • prompt: A string.
    • Batch: {"batch": true, "items": [ { ...single_observation_fields... }, ... ]}

    Response Formats

    • Single: A single action chunk as nested lists: [[float, ...], ...] with shape (T, action_dim), where T is the predicted horizon (e.g., n_action_steps).
    • Batch: A list of chunks: [ chunk_0, chunk_1, ... ], where each chunk corresponds to a row in the input items list.
  8. Select a policy type for OpenTau models

    main

    OpenTau supports various Vision-Language-Action (VLA) models. To select a model, use the --policy.type CLI flag or set the policy.type key in your JSON configuration file. The available models are categorized into two backbone families:

    • PaliGemma family: Uses the paligemma_with_expert.py wrapper (PaliGemma VLM + Gemma action expert). Includes pi0, pi05, pi05_mem, and pi07_paligemma.
    • Gemma 3 family: Uses the gemma3_with_expert.py wrapper (Gemma 3 4B VLM + Gemma action expert) at 448×448 resolution. Includes pi06 and pi07.

    Models emit actions using flow matching (continuous), FAST discrete-action tokens (autoregressive), or both.

    # Example using CLI flag
    python train.py --policy.type=pi05
    {
      "policy": {
        "type": "pi06"
      }
    }
  9. How Policies work in OpenTau

    main
    Policies are the core components that map observations (such as camera images and robot proprioceptive states) to actions or action chunks. In OpenTau, policies are implemented as PyTorch modules and must inherit from the opentau.policies.pretrained.PreTrainedPolicy base class.
  10. Optimize training performance by caching VLM prefixes

    main

    When training on datasets with multiple cameras (like LIBERO), training time per step increases significantly because the frozen VLM prefix is recomputed for every timestep in a sequence.

    For example, on LIBERO, a step might take ~5.3s compared to ~2.97s on droid_100 due to the two-camera setup. To reduce this overhead and enable longer context, implement caching for the frozen VLM prefix so it is not recomputed for every timestep within a single training step.

  11. Understand the latency decomposition of sample_actions

    main

    A single policy.sample_actions call consists of a fixed backbone prefill cost and a variable cost based on the number of denoising steps. The latency follows an affine relationship:

    L(N) ≈ F + N·s

    Where:

    • F (Fixed Cost): Includes the Qwen3-VL backbone prefill (over images + prompt), CPU-side preprocessing, and rope/noise setup.
    • N: The number of denoising steps (num_steps).
    • s (Step Cost): The cost of one action-expert forward pass (e.g., ~0.9B parameters) cross-attending the cached backbone KV.

    Performance Tip: torch.compile provides significant speedups primarily by optimizing the expert loop (s), which is often launch- and fusion-bound due to many small kernels across multiple layers and steps. The compute-bound backbone prefill (F) sees much smaller improvements.

  12. How Datasets and DatasetMixture work

    main

    OpenTau uses two primary dataset types: LeRobotDataset for robotic data and VQADataset for VLM training. Datasets can be loaded from the Hugging Face Hub or local disk using a versioned format (v2.1) that uses Parquet for data and MP4 for videos.

    To train on multiple datasets simultaneously, use opentau.datasets.dataset_mixture.WeightedDatasetMixture. This class allows you to:

    • Combine multiple LeRobotDataset and VQADataset instances.
    • Assign weights to each dataset to control sampling frequency (defaults to dataset lengths if omitted).
    • Aggregate statistics for consistent normalization.
    • Resample action output frequency to a common action_freq.

    Note on Mixed-Frequency Training: If datasets have different native frame rates, set action_freq to a positive float to re-anchor them. To allow the policy to condition on the per-sample effective rate, set DatasetMixtureConfig.emit_fps=True so the fps key is included in the data.

    from opentau.datasets.dataset_mixture import WeightedDatasetMixture
    # Usage involves combining LeRobotDataset and VQADataset instances with specific weights.