agentleFS
MicrosoftKnown publishermicrosoft/physical-ai-toolchain/.github/skills/osmo-lerobot-training/SKILL.md

osmo-lerobot-training

Skill138 starsChanged 15 days agoMITView on GitHub

Submit, monitor, analyze, and evaluate LeRobot imitation learning training jobs on OSMO with Azure ML MLflow integration and inference evaluation - Brought to you by microsoft/physical-ai-toolchain

  • Reads credentials

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 4 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the skill file .github/skills/osmo-lerobot-training/SKILL.md for parameter defaults, GPU configuration, and training duration …

    line 10
  2. Distinctive:

    Start the background poller immediately after submitting training.

    line 57
  3. Distinctive:

    After every successful training or inference submission, open the OSMO workflow page in VS Code's SimpleBrowser so the user can track …

    line 105
  4. Distinctive:

    After submitting a training job, and whenever the background eval poller reports a new inference job, open the Azure ML portal with …

    line 136
  5. Distinctive:

    After the training job is submitted, navigate to the training experiment page and open the Metrics tab:

    line 140
  6. Very specific:

    Call mcp_playwright_browser_navigate with that URL.

    line 148
  7. Very specific:

    Call mcp_playwright_browser_snapshot to confirm the page loaded and identify the latest run row in the table.

    line 149
  8. Very specific:

    Call mcp_playwright_browser_take_screenshot and show the live training curves to the user.

    line 153
  9. Very specific:

    Call mcp_playwright_browser_snapshot to identify the latest run row (most recently submitted checkpoint eval).

    line 178
  10. Very specific:

    Call mcp_playwright_browser_take_screenshot and show the trajectory plots to the user.

    line 181

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

OSMO LeRobot Training

Submit, monitor, analyze, and evaluate LeRobot behavioral cloning training workflows on the OSMO platform. Covers the full lifecycle: job submission, log streaming, Azure ML metric retrieval, training summary generation, and post-training inference evaluation.

Read the skill file .github/skills/osmo-lerobot-training/SKILL.md for parameter defaults, GPU configuration, and training duration estimates. Read references/DEFAULTS.md for known datasets, GPU profiles, and Azure environment auto-resolution.

Prerequisites

RequirementPurpose
osmo CLIWorkflow submission and monitoring
az CLIAzure authentication and model registry
terraformInfrastructure output resolution
zipTraining payload packaging
Python 3.12+ with azure-ai-ml, mlflowMetric retrieval from Azure ML

Authentication must be configured before any OSMO or Azure ML operations:

az login
osmo login <service-url> --method dev --username guest

Quick Start

Train from Azure Blob Storage (typical production flow)

scripts/submit-osmo-lerobot-training.sh \
  -d my-robot-dataset \
  --from-blob \
  --storage-account mystorageaccount \
  --blob-prefix my-robot-dataset \
  --no-val-split \
  --steps 100000 \
  --batch-size 32 \
  --learning-rate 1e-4 \
  --save-freq 10000 \
  -j my-robot-act-train \
  --experiment-name my-robot-training \
  -r my-robot-act-model

Train from HuggingFace Hub

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

Run Continuous Eval During Training (preferred)

Start the background poller immediately after submitting training. It watches AzureML for new checkpoint versions and submits an inference job per version automatically, stopping when training reaches a terminal state.

# Launch in the background — runs until training completes
nohup scripts/poll-and-eval-checkpoints.sh \
  --model-name my-robot-act-model \
  --training-workflow-id lerobot-training-32 \
  --blob-prefix my-robot-dataset \
  --job-prefix my-robot-eval \
  --experiment-name my-robot-inference \
  --poll-interval 60 \
  --max-concurrent 2 \
  > /tmp/my-robot-eval.log 2>&1 & disown

# Monitor the poller
tail -f /tmp/my-robot-eval.log

The poller caps concurrent inference workflows at --max-concurrent (default 2) to avoid cluster saturation. Submitted versions are tracked in /tmp/<model-name>-submitted-versions.txt.

Run a Single Inference Job

# OSMO inference (GPU, evaluates against the same dataset)
scripts/submit-osmo-lerobot-inference.sh \
  --from-aml-model \
  --model-name my-robot-act-model \
  --model-version 3 \
  --from-blob-dataset \
  --storage-account mystorageaccount \
  --blob-prefix my-robot-dataset \
  --mlflow-enable \
  --eval-episodes 10 \
  -j my-robot-eval \
  --experiment-name my-robot-inference

# Local inference (CPU/MPS, for quick validation)
python scripts/run-local-lerobot-inference.py \
  --model-name my-robot-act-model \
  --model-version 3 \
  --dataset-dir /path/to/local/dataset \
  --episodes 5 \
  --output-dir outputs/local-eval \
  --device cpu

Post-Submission Browser Monitoring

After every successful training or inference submission, open the OSMO workflow page in VS Code's SimpleBrowser so the user can track progress and access logs directly.

Steps:

  1. Capture the workflow ID from the submission output (the line Workflow ID - <id>).
  2. Build the URL from the service URL used for osmo login: <service-url>/workflows/<workflow-id>. Don't rely on the Workflow Overview line, which can show an in-cluster address that a browser can't reach.
  3. Open it with the open_browser_page tool (VS Code SimpleBrowser).
  4. Tell the user that the Logs tab on that page streams live output per task (e.g., lerobot-train, lerobot-infer).

Example after a training submission:

Workflow ID - lerobot-training-31
Workflow Overview - <service-url>/workflows/lerobot-training-31

Open: <service-url>/workflows/lerobot-training-31

Example after an inference submission:

Workflow ID - lerobot-inference-20
Workflow Overview - <service-url>/workflows/lerobot-inference-20

Open: <service-url>/workflows/lerobot-inference-20

The page has a Logs tab with per-task log streams. For training, select the lerobot-train task. For inference, select the lerobot-infer task. Use the OSMO CLI (osmo workflow logs <id> -t <task> -n 100) as a fallback when the browser is not reachable.

Azure ML Portal Monitoring (Playwright)

After submitting a training job, and whenever the background eval poller reports a new inference job, open the Azure ML portal with Playwright to view live metrics and trajectory plots. Use mcp_playwright_browser_navigate, mcp_playwright_browser_snapshot, mcp_playwright_browser_click, and mcp_playwright_browser_take_screenshot.

Training Metrics — Open Immediately After Submission

After the training job is submitted, navigate to the training experiment page and open the Metrics tab:

  1. Construct the experiment URL from Azure environment variables in scripts/.env:

    https://ml.azure.com/experiments/{experiment_name}?wsid=/subscriptions/{AZURE_SUBSCRIPTION_ID}/resourceGroups/{AZURE_RESOURCE_GROUP}/providers/Microsoft.MachineLearningServices/workspaces/{AZUREML_WORKSPACE_NAME}
  2. Call mcp_playwright_browser_navigate with that URL.
  3. Call mcp_playwright_browser_snapshot to confirm the page loaded and identify the latest run row in the table.
  4. Click the first (most recent) run link.
  5. On the run detail page, call mcp_playwright_browser_snapshot to locate the Metrics tab.
  6. Click Metrics.
  7. Call mcp_playwright_browser_take_screenshot and show the live training curves to the user.

Key metrics to surface: train/loss, train/learning_rate (confirm 1e-04, not 1e-05), train/grad_norm, gpu_percent.

Refresh by calling mcp_playwright_browser_navigate again on the same URL at any time.

See references/REFERENCE.md for exact click paths, tab selectors, and screenshot guidance.

Inference / Eval Plots — Open When Poller Submits a Job

While the background eval poller is running, monitor the poller log and navigate to Azure ML to view trajectory plots as each inference job completes:

  1. Tail the poller log to detect a new inference submission:

    tail -n 30 /tmp/<model-name>-eval.log | grep -E "Submitting|Workflow ID"
  2. Construct the inference experiment URL using the --experiment-name passed to the poller:

    https://ml.azure.com/experiments/{inference_experiment_name}?wsid=/subscriptions/{AZURE_SUBSCRIPTION_ID}/resourceGroups/{AZURE_RESOURCE_GROUP}/providers/Microsoft.MachineLearningServices/workspaces/{AZUREML_WORKSPACE_NAME}
  3. Call mcp_playwright_browser_navigate with that URL.
  4. Call mcp_playwright_browser_snapshot to identify the latest run row (most recently submitted checkpoint eval).
  5. Click that run.
  6. On the run detail page, click the Images tab.
  7. Call mcp_playwright_browser_take_screenshot and show the trajectory plots to the user.

The Images tab contains per-episode trajectory plots logged by the inference job (episode_NNN_trajectory.png and eval_summary.png). They appear after the OSMO inference workflow reaches completed status. If images are not yet present, check osmo workflow query <inference-workflow-id> and wait for completed.

Parameters Reference

Training Submission Parameters

ParameterFlagDefaultDescription
Dataset repo ID-d, --dataset(required)HuggingFace dataset or blob dataset name
Policy type-p, --policyactact or diffusion
Job name-j, --job-namelerobot-act-trainingUnique job identifier
Training steps--steps100000Total training iterations
Batch size--batch-size32Training batch size (64 for 48GB GPUs)
Learning rate--learning-rate1e-4Maps to --policy.optimizer_lr internally
Save frequency--save-freq5000Checkpoint interval (model registered at each)
Validation split--val-split0.1Ratio for train/val split
No val split--no-val-split—Disable validation splitting
Register checkpoint-r(none)Model name for Azure ML registration
From blob--from-blobfalseUse Azure Blob Storage as data source
Storage account--storage-account(terraform)Azure Storage account name
Blob prefix--blob-prefix(none)Blob path prefix for dataset

Inference Submission Parameters

ParameterFlagDefaultDescription
Policy repo ID--policy-repo-id(required)HuggingFace repo, or use --from-aml-model
From AML model--from-aml-modelfalseLoad from AzureML model registry
Model name--model-name(none)AzureML model registry name
Model version--model-version(none)AzureML model version
Dataset repo ID-d, --dataset-repo-id(none)HuggingFace dataset
From blob dataset--from-blob-datasetfalseDownload dataset from Azure Blob
Eval episodes--eval-episodes10Number of episodes to evaluate
MLflow enable--mlflow-enablefalseLog trajectory plots to AzureML

Continuous Evaluation Parameters (poll-and-eval-checkpoints.sh)

ParameterFlagDefaultDescription
Model name--model-name(required)AzureML model registry name to watch
Training workflow--training-workflow-id(required)OSMO workflow ID of the training job
Blob prefix--blob-prefix(required)Blob path prefix for the evaluation dataset
Storage account--storage-account(from .env)Azure Storage account
Eval episodes--eval-episodes10Episodes per inference run
Job prefix--job-prefix(from model name)Prefix for inference job names
Experiment name--experiment-name(from model name)MLflow experiment for inference runs
Poll interval--poll-interval60Seconds between AzureML registry polls
Max concurrent--max-concurrent2Max simultaneous inference workflows

GPU Configuration Guidelines

GPUVRAMRecommended Batch SizeNotes
A1024GB32Standard configuration
RTX PRO 600096GB (whole GPU)64Requires mig.strategy: single; fractional sizes have 48GB or 24GB
H10080GB128Standard MIG disabled

Azure ML Context

Resolved from CLI flags > environment variables > Terraform outputs:

VariableFlagEnv Var
Subscription ID--azure-subscription-idAZURE_SUBSCRIPTION_ID
Resource group--azure-resource-groupAZURE_RESOURCE_GROUP
Workspace name--azure-workspace-nameAZUREML_WORKSPACE_NAME

Training Completion Estimation

Estimate training duration based on dataset and configuration:

Dataset SizeStepsGPUApproximate Duration
20K frames / 64 episodes10,000A10~30 minutes
20K frames / 64 episodes100,000A10~5 hours
80K frames / 174 episodes100,000A10~8 hours
20K frames / 64 episodes100,000RTX PRO 6000~3 hours

Checkpoints are registered to AzureML at every --save-freq interval. Jobs may be evicted on spot GPU instances — checkpoints already registered remain available for inference even if the job is interrupted.

OSMO CLI Reference

See references/REFERENCE.md for full CLI and SDK documentation.

osmo workflow query <workflow-id>
osmo workflow logs <workflow-id> -n 100
osmo workflow logs <workflow-id> --error
osmo workflow list
osmo workflow cancel <workflow-id>

Checkpoint Poller Commands

# Start continuous eval loop in background
nohup scripts/poll-and-eval-checkpoints.sh \
  --model-name <model-name> \
  --training-workflow-id <workflow-id> \
  --blob-prefix <dataset-blob-prefix> \
  > /tmp/<model-name>-eval.log 2>&1 & disown

# Monitor poller
tail -f /tmp/<model-name>-eval.log

# Check which versions have been submitted
cat /tmp/<model-name>-submitted-versions.txt

# Stop the poller early
pkill -f poll-and-eval-checkpoints

Key Metrics Logged

MetricDescription
train/lossTraining loss per step
train/grad_normGradient norm
train/learning_rateCurrent learning rate (verify 1e-4 not 1e-5)
val/lossValidation loss (when val split enabled)
gpu_percentGPU utilization (when system metrics enabled)

Troubleshooting

SymptomLikely CauseResolution
lr: 1e-05 in logsLEARNING_RATE not mappedVerify train.py maps to --policy.optimizer_lr
KeyError: chunk_indexv3.0 dataset not convertedVerify download_dataset.py has patch_info_paths()
codebase_version warningDataset still marked v3.0Verify patch_info_paths() sets codebase_version = "v2.1"
CUDA_ERROR_NO_DEVICEMIG strategy misconfiguredSet mig.strategy: single for vGPU nodes
VM eviction mid-trainingSpot GPU preemptedCheckpoints already registered to AML survive eviction
ImportError: patch_info_pathsPayload missing training fixesEnsure training/il/ includes download_dataset.py with patch_info_paths
OOM during trainingBatch size too largeReduce --batch-size (32 for 24GB, 64 for 48GB)
Poller exits immediatelyTraining workflow already terminalCheck osmo workflow query <id>; rerun poller or submit inference manually
Poller stalls at max-concurrentInference jobs not finishingCheck inference workflow status; increase --max-concurrent or cancel stuck jobs
Many pending inference jobs after stopping pollerPoller submitted jobs faster than cluster could drainosmo workflow list only returns the last 12 — iterate over expected ID range to cancel all: for id in $(seq <first> <last>); do osmo workflow cancel lerobot-inference-$id; done
info: command not found in pollercommon.sh not sourcedVerify scripts/lib/common.sh exists and is readable

See references/REFERENCE.md for detailed debugging commands.

Brought to you by microsoft/physical-ai-toolchain

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.