Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions configs/LeRobot/lerobot_datasource_base.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

# The training and testing dataset
datasource = "LeRobot"

# IID or non-IID? LeRobot handles deterministic episode partitioning internally.
sampler = "iid"

# The random seed used for deterministic train/test split and client partitioning.
random_seed = 1
70 changes: 70 additions & 0 deletions configs/LeRobot/smolvla_fedavg_two_client_smoke.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[clients]

# Type
type = "simple"

# The total number of clients
total_clients = 2

# The number of clients selected in each round
per_round = 2

# Should the clients compute test accuracy locally?
do_test = false

[server]
address = "127.0.0.1"
port = 8001
simulate_wall_time = false
checkpoint_path = "checkpoints/lerobot/smolvla_fedavg_two_client_smoke"
model_path = "models/lerobot/smolvla_fedavg_two_client_smoke"

[data]
include = "lerobot_datasource_base.toml"

[trainer]

# The type of the trainer
type = "lerobot"

# The maximum number of training rounds
rounds = 1

# The maximum number of clients running concurrently
max_concurrency = 1

# The machine learning model
model_type = "smolvla"
model_name = "smolvla"

# Number of epoches for local training in each communication round
epochs = 1
batch_size = 2
optimizer = "AdamW"

[algorithm]

# Aggregation algorithm
type = "fedavg"

[parameters]

[parameters.policy]
type = "smolvla"
path = "lerobot/smolvla_base"
finetune_mode = "adapter"
precision = "fp32"
device = "cpu"

[parameters.dataset]
repo_id = "lerobot/pusht_image"
delta_timestamps = { observation_image = [-0.2, -0.1, 0.0] }

[parameters.transforms]
image_size = [224, 224]
normalize = true
interpolation = "bilinear"

[parameters.optimizer]
lr = 0.0001
weight_decay = 0.0
77 changes: 77 additions & 0 deletions configs/LeRobot/smolvla_full_finetune.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[clients]

# Type
type = "simple"

# The total number of clients
total_clients = 2

# The number of clients selected in each round
per_round = 2

# Should the clients compute test accuracy locally?
do_test = true

[server]
address = "127.0.0.1"
port = 8002
simulate_wall_time = false
checkpoint_path = "checkpoints/lerobot/smolvla_full_finetune"
model_path = "models/lerobot/smolvla_full_finetune"

[data]
include = "lerobot_datasource_base.toml"

[trainer]

# The type of the trainer
type = "lerobot"

# The maximum number of training rounds
rounds = 10

# The maximum number of clients running concurrently
max_concurrency = 1

# The machine learning model
model_type = "smolvla"
model_name = "smolvla"

# Number of epoches for local training in each communication round
epochs = 5

# SmolVLA upstream fine-tuning guidance uses batch size 64.
batch_size = 64
optimizer = "AdamW"

[algorithm]

# Aggregation algorithm
type = "fedavg"

[parameters]

[parameters.policy]
type = "smolvla"
path = "lerobot/smolvla_base"
finetune_mode = "full"
precision = "bf16"
device = "cuda"

[parameters.dataset]
repo_id = "lerobot/pusht_image"
split_seed = 7
train_split = 0.9
task_aware_split = true
task_aware_partition = true
delta_timestamps = { observation_image = [-0.2, -0.1, 0.0] }

[parameters.transforms]
image_size = [224, 224]
center_crop = true
normalize = true
interpolation = "bilinear"

[parameters.optimizer]
lr = 0.0001
weight_decay = 0.01
70 changes: 70 additions & 0 deletions configs/LeRobot/smolvla_single_client_smoke.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[clients]

# Type
type = "simple"

# The total number of clients
total_clients = 1

# The number of clients selected in each round
per_round = 1

# Should the clients compute test accuracy locally?
do_test = false

[server]
address = "127.0.0.1"
port = 8000
simulate_wall_time = false
checkpoint_path = "checkpoints/lerobot/smolvla_single_client_smoke"
model_path = "models/lerobot/smolvla_single_client_smoke"

[data]
include = "lerobot_datasource_base.toml"

[trainer]

# The type of the trainer
type = "lerobot"

# The maximum number of training rounds
rounds = 1

# The maximum number of clients running concurrently
max_concurrency = 1

# The machine learning model
model_type = "smolvla"
model_name = "smolvla"

# Number of epoches for local training in each communication round
epochs = 1
batch_size = 2
optimizer = "AdamW"

[algorithm]

# Aggregation algorithm
type = "fedavg"

[parameters]

[parameters.policy]
type = "smolvla"
path = "lerobot/smolvla_base"
finetune_mode = "adapter"
precision = "fp32"
device = "cpu"

[parameters.dataset]
repo_id = "lerobot/pusht_image"
delta_timestamps = { observation_image = [-0.2, -0.1, 0.0] }

[parameters.transforms]
image_size = [224, 224]
normalize = true
interpolation = "bilinear"

[parameters.optimizer]
lr = 0.0001
weight_decay = 0.0
62 changes: 62 additions & 0 deletions docs/docs/configurations/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,65 @@

!!! example "loss_criterion"
All the parameter settings that need to be passed as keyword parameters when initializing the loss criterion, such as `size_average`. The set of parameters permitted or needed depends on the loss criterion.

## SmolVLA + LeRobot parameter contract

`Config()` keeps nested keys under `[parameters]` as dot-accessible nodes. For
the SmolVLA + LeRobot integration, define the following sections.

| Config key | Purpose | Consumption path |
| --- | --- | --- |
| `data.datasource = "LeRobot"` | Selects the robotics datasource family. | `plato.datasources.registry.get()` chooses the datasource module. |
| `trainer.type = "lerobot"` | Selects the robotics trainer backend. | `plato.trainers.registry.get()` chooses the trainer class. |
| `trainer.model_type = "smolvla"` | Selects the model family. | `plato.models.registry.get()` resolves the model factory. |
| `trainer.model_name = "smolvla"` | Selects the concrete model entry point. | `plato.models.registry.get()` resolves the model name. |
| `parameters.policy.type` | Policy family identifier (`smolvla` in v1). | Consumed by `plato/models/smolvla.py` and `plato/trainers/lerobot.py` via `Config().parameters.policy`. |
| `parameters.policy.path` | Pretrained policy source (Hub/local path). | Consumed by `plato/models/smolvla.py` via `Config().parameters.policy.path`. |
| `parameters.policy.finetune_mode` | Full fine-tune vs adapter mode switch. | Consumed by `plato/trainers/lerobot.py` to decide trainable params. |
| `parameters.policy.precision` | Runtime precision flag (`fp32`/`fp16`/`bf16`). | Consumed by `plato/trainers/lerobot.py` for dtype/autocast setup. |
| `parameters.policy.device` | Runtime device flag (`cpu`/`cuda`/`mps`). | Consumed by `plato/trainers/lerobot.py` for device placement. |
| `parameters.dataset.repo_id` | LeRobot dataset identifier. | Consumed by `plato/datasources/lerobot.py` dataset loader. |
| `parameters.dataset.delta_timestamps` | Temporal window selection per modality key. | Consumed by `plato/datasources/lerobot.py` sampling/windowing logic. |
| `parameters.transforms.*` | Image transform controls (`image_size`, `normalize`, interpolation/crop options). | Consumed by `plato/datasources/lerobot.py` preprocessing pipeline. |

### Constructor-ready dictionaries

SmolVLA/LeRobot components should convert section nodes to plain dictionaries
when passing keyword arguments into constructors:

```python
from plato.config import Config

cfg = Config()
policy_kwargs = cfg.parameters.policy._asdict()
dataset_kwargs = cfg.parameters.dataset._asdict()
transform_kwargs = cfg.parameters.transforms._asdict()
```

### Example

```toml
[data]
datasource = "LeRobot"

[trainer]
type = "lerobot"
model_type = "smolvla"
model_name = "smolvla"

[parameters.policy]
type = "smolvla"
path = "lerobot/smolvla_base"
finetune_mode = "full"
precision = "bf16"
device = "cuda"

[parameters.dataset]
repo_id = "lerobot/pusht_image"
delta_timestamps = { observation_image = [-0.2, -0.1, 0.0] }

[parameters.transforms]
image_size = [224, 224]
normalize = true
interpolation = "bilinear"
```
Loading