Skip to main content

LeRobot Training

LeRobot behavioral cloning training for ACT and Diffusion policy architectures. Training runs on Azure ML and OSMO platforms using HuggingFace Hub datasets with WANDB and MLflow experiment tracking.

📋 Prerequisites

ComponentRequirement
InfrastructureAKS cluster deployed via Infrastructure Guide
Azure ML or OSMOAt least one platform configured (see Platform Selection section)
HuggingFace tokenRequired for private datasets (hf_token credential)
WANDB API keyRequired when --wandb-enable is set (default on OSMO)

🚀 Quick Start

Azure ML

./scripts/submit-azureml-lerobot-training.sh \
-d lerobot/aloha_sim_insertion_human

OSMO

./scripts/submit-osmo-lerobot-training.sh \
-d lerobot/aloha_sim_insertion_human

End-to-End Pipeline (OSMO)

Train, evaluate, and register in one command:

./scripts/run-lerobot-pipeline.sh \
-d lerobot/aloha_sim_insertion_human \
--policy-repo-id user/my-act-policy \
-r my-act-model

🧠 Policy Architectures

ArchitectureTypeStrengths
ACTAction Chunking with TransformersMulti-step prediction, temporal coherence
DiffusionDenoising Diffusion PolicyMulti-modal action distributions

Select the architecture with --policy-type:

# ACT policy (default)
./scripts/submit-osmo-lerobot-training.sh -d user/dataset -p act

# Diffusion policy
./scripts/submit-osmo-lerobot-training.sh -d user/dataset -p diffusion

⚖️ Platform Selection

AspectAzure MLOSMO
Submissionaz ml job createosmo workflow submit
Experiment trackingMLflow (managed)WANDB (default) + MLflow (optional)
Credential handlingAzure ML environment variablesosmo credential set injection
Dataset deliveryHuggingFace Hub downloadHub download or OSMO bucket mount
Pipeline supportManual multi-steprun-lerobot-pipeline.sh orchestration

⚙️ Training Configuration

ParameterDefaultDescription
--dataset-repo-id(required)HuggingFace dataset repository
--policy-typeactPolicy: act or diffusion
--job-namelerobot-act-trainingJob identifier
--imagepytorch/pytorch:2.4.1-cuda12.4-cudnn9-runtimeContainer image
--training-steps(LeRobot default)Total training iterations
--batch-size(LeRobot default)Training batch size
--save-freq5000Checkpoint save frequency
--policy-repo-id(none)Pre-trained policy for fine-tuning

Fine-Tuning from Existing Policy

./scripts/submit-osmo-lerobot-training.sh \
-d user/my-dataset \
--policy-repo-id user/pretrained-act \
--training-steps 50000 \
--batch-size 16

🔑 Credential Setup

OSMO Credentials

OSMO injects credentials at workflow runtime:

# HuggingFace token (required for private datasets)
osmo credential set hf_token --generic --value "hf_..."

# WANDB API key (required when wandb_enable=true)
osmo credential set wandb_api_key --generic --value "..."

Azure ML Credentials

Azure ML uses workspace-managed identity. Set environment variables for custom configurations:

VariableDescription
AZURE_SUBSCRIPTION_IDAzure subscription ID
AZURE_RESOURCE_GROUPResource group name
AZUREML_WORKSPACE_NAMEAzure ML workspace name
AZUREML_COMPUTECompute target name

📊 Experiment Logging

WANDB (Default on OSMO)

WANDB logging is enabled by default on OSMO workflows. Requires wandb_api_key credential.

# Disable WANDB
./scripts/submit-osmo-lerobot-training.sh \
-d user/dataset \
--wandb-disable

MLflow (Azure ML Managed)

Azure ML training uses MLflow automatically. Enable MLflow on OSMO with:

./scripts/submit-osmo-lerobot-training.sh \
-d user/dataset \
--mlflow-enable

See Experiment Tracking for platform comparison and configuration details.

💾 Dataset Workflows

HuggingFace Hub (Default)

LeRobot downloads datasets from HuggingFace Hub at runtime. Specify datasets with --dataset-repo-id:

./scripts/submit-osmo-lerobot-training.sh \
-d lerobot/aloha_sim_insertion_human

OSMO Dataset Mount

Mount datasets from OSMO buckets backed by Azure Blob Storage:

./scripts/submit-osmo-lerobot-training.sh \
-w workflows/osmo/lerobot-train-dataset.yaml \
-d user/fallback-dataset \
--dataset-bucket my-bucket \
--dataset-name my-lerobot-data

Falls back to HuggingFace Hub download when no dataset mount is available.

🔄 End-to-End Pipeline

The run-lerobot-pipeline.sh script orchestrates the full lifecycle on OSMO:

StageAction
1Submit training workflow
2Poll workflow status until completion
3Submit inference/evaluation workflow
# Full pipeline
./scripts/run-lerobot-pipeline.sh \
-d lerobot/aloha_sim_insertion_human \
--policy-repo-id user/my-policy \
-r my-model

# Training only with polling (skip inference)
./scripts/run-lerobot-pipeline.sh \
-d user/dataset \
--skip-inference

# Async mode (submit and exit)
./scripts/run-lerobot-pipeline.sh \
-d user/dataset \
--skip-wait

🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.