Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
240 commits
Select commit Hold shift + click to select a range
ba10457
wip: molmoact2 config setup, download from hf
alfieroddan Jun 17, 2026
5451279
wip: working policy top api, underlying lerobot still
alfieroddan Jun 18, 2026
c664c65
wip: working policy top api, underlying lerobot still
alfieroddan Jun 18, 2026
29b866e
Merge branch 'open-edge-platform:main' into ar/molmoact2
alfieroddan Jun 19, 2026
9a85983
wip: refactor out api structure
alfieroddan Jun 19, 2026
2d0c6d7
wip: add input output feature to config when from base
alfieroddan Jun 19, 2026
b20661b
wip: working pretrained processor
alfieroddan Jun 21, 2026
524a285
wip: working preprocessor libero benchmark
alfieroddan Jun 21, 2026
95f5ad0
wip: working post processor and styled
alfieroddan Jun 22, 2026
d90e167
wip: working pretrained processor
alfieroddan Jun 22, 2026
587a8a2
wip: working with new versions in copy
alfieroddan Jun 22, 2026
f9bf5d0
wip: working policy / model hybrid
alfieroddan Jun 22, 2026
b7ae00e
wip: working no remote code
alfieroddan Jun 23, 2026
4dd6cec
wip: using autoprocessor with local code
alfieroddan Jun 23, 2026
38e5021
wip: using autoprocessor with local code
alfieroddan Jun 23, 2026
207d222
wip: remove tokenizer path
alfieroddan Jun 23, 2026
a4a1425
wip: pre model implementation
alfieroddan Jun 23, 2026
1023c0e
wip: working with model code
alfieroddan Jun 24, 2026
d5f9ea2
wip: pre model implementation
alfieroddan Jun 24, 2026
8d22512
wip: new policy signature
alfieroddan Jun 24, 2026
bb0a046
wip: export to torch
alfieroddan Jun 26, 2026
dbbc7ff
wip: move backbone to self not module
alfieroddan Jun 29, 2026
a6594f3
wip: add processor config
alfieroddan Jun 29, 2026
f1f3d96
wip: move processsors to own folder
alfieroddan Jun 29, 2026
7d5ea2c
wip: implement 1st party processors
alfieroddan Jun 29, 2026
2fca939
wip: implement 1st party processors
alfieroddan Jun 29, 2026
732ec3e
wip: remove auto-processor
alfieroddan Jun 29, 2026
a7d8b38
wip: split up processor steps into graph and no graph
alfieroddan Jun 29, 2026
e80f2ce
wip: refactor space move model into folder
alfieroddan Jun 29, 2026
89467ac
wip: refactor preprocessor
alfieroddan Jun 29, 2026
27b90d2
wip: working export to torch
alfieroddan Jun 29, 2026
c43f4ca
wip: working norm
alfieroddan Jul 1, 2026
b9cd7ef
wip: working export to torch
alfieroddan Jul 2, 2026
d45b68e
wip: working export to torch
alfieroddan Jul 2, 2026
0b56305
wip: refactored pre and post processing
alfieroddan Jul 2, 2026
ddba287
wip: working inference, removed compiled jit tracing model needs refa…
alfieroddan Jul 2, 2026
cb034fe
wip: working without loss computation, started cutting
alfieroddan Jul 7, 2026
e56ae53
wip: some simple tests
alfieroddan Jul 7, 2026
6c11657
wip: refactor model preprocessing
alfieroddan Jul 8, 2026
d207434
wip: potentially working train and val
alfieroddan Jul 9, 2026
287252b
wip: refactor export and config
alfieroddan Jul 9, 2026
92543d5
wip: ready for final refactor
alfieroddan Jul 9, 2026
3db2c1b
wip: ready for refactoring
alfieroddan Jul 10, 2026
7b12d3d
wip: clean pre-processor
alfieroddan Jul 10, 2026
f47c343
wip: refactored pre-processor on torch
alfieroddan Jul 10, 2026
a89ee61
wip: refactored preprocessor and inference working
alfieroddan Jul 10, 2026
f88e224
wip: add training and so101 training:
alfieroddan Jul 10, 2026
f2aac70
wip: ov_export with forwrad pass
alfieroddan Jul 10, 2026
3ec583d
wip: add useful files
alfieroddan Jul 11, 2026
969df4e
merge: merge main
alfieroddan Jul 11, 2026
a9a0e04
wip: torch doesn't need pre / post processing
alfieroddan Jul 11, 2026
fd2ac62
wip: add xpu support
Jul 13, 2026
f97f00d
wip: enable load from ckpt and change training config
alfieroddan Jul 13, 2026
d7dd6c8
wip: add back action_lr
alfieroddan Jul 14, 2026
6018f07
merge: merge latest
alfieroddan Jul 14, 2026
f236b85
wip: tidy up
alfieroddan Jul 14, 2026
c9e2d36
merge: lerobot 0.6
alfieroddan Jul 14, 2026
b6cdbb6
wip: cleanup
alfieroddan Jul 14, 2026
863b51b
refactor: cleanup scripts, put them in PR
alfieroddan Jul 14, 2026
54c2cb2
refactor: cleanup scripts, put them in PR
alfieroddan Jul 14, 2026
6a10a8a
wip: prek run, revert old code
alfieroddan Jul 14, 2026
6ca72c4
refactor: remove unused processors and tokenizers
alfieroddan Jul 14, 2026
d565dfe
refactor: prek and ruff warnings
alfieroddan Jul 14, 2026
7fa1ec4
fix: action expert batch size error
alfieroddan Jul 14, 2026
da0be9d
wip: dtype adjustment on InferenceModel
alfieroddan Jul 14, 2026
a5c9659
fix: torch export channel reshape
alfieroddan Jul 14, 2026
ec8d5c3
refactor: load to reduce memory consumption
alfieroddan Jul 16, 2026
214932d
refactor: prek errors
alfieroddan Jul 18, 2026
3f77193
Merge remote-tracking branch 'origin/main' into ar/molmoact2
alfieroddan Jul 18, 2026
fc9b23f
refactor: remove unused functions
alfieroddan Jul 18, 2026
95dfeaf
refactor+tests: re-work tokenizer, add tests
alfieroddan Jul 18, 2026
ecb1221
tests: add molmo tests
alfieroddan Jul 18, 2026
122bf49
refactor: remove agents
alfieroddan Jul 18, 2026
3caad0b
docs: add a README for molmo
alfieroddan Jul 18, 2026
ece99b3
feat: add lora and gradient checkpointing
alfieroddan Jul 18, 2026
ff13379
feat: add config for molmoact2
alfieroddan Jul 18, 2026
0f29edd
feat: add molmo to all dependencies
alfieroddan Jul 18, 2026
4e65949
trigger recheck
alfieroddan Jul 18, 2026
99c84b2
refactor: revert policy and AGENTS.md
alfieroddan Jul 20, 2026
88c3b53
refactor: add chunk_size to policy arg
alfieroddan Jul 20, 2026
47405fb
refactor: move sample_noise to use_random_input_noise
alfieroddan Jul 20, 2026
a6c4df1
refactor: remove unused configs args
alfieroddan Jul 20, 2026
94d4c23
refactor: restore original torch adapter
alfieroddan Jul 20, 2026
963ce1f
docs: add chunk size to config
alfieroddan Jul 20, 2026
dfc6bd4
feat: add load from config option to model, in load_from_pretrained s…
alfieroddan Jul 20, 2026
6e5d328
refactor: remove dtype float32 promotion
alfieroddan Jul 20, 2026
a0268f5
refactor: move resize and norm image transforms to dedicated class
alfieroddan Jul 20, 2026
8605c69
docs: add molmo docs
alfieroddan Jul 20, 2026
22b35d9
refactor: revert normalization back to original, move normalization t…
alfieroddan Jul 20, 2026
1f000a4
refactor: move normalization and configs for clearer ordering
alfieroddan Jul 20, 2026
b7bebc2
tests: add tests for new config flow
alfieroddan Jul 20, 2026
0987be9
feat: num of flow matching layers, working training
alfieroddan Jul 29, 2026
1baadbd
fix: use action padding from lerobot data in loss calculation
alfieroddan Aug 3, 2026
fb0a60f
fix: compute loss without item.loss
alfieroddan Aug 3, 2026
d7f1be9
refactor: new layout with no overrides, remove from_config, move mode…
alfieroddan Aug 3, 2026
fb7c456
fix: remove configs args supplied to subcomponents
alfieroddan Aug 4, 2026
851021e
fix: uv lock
alfieroddan Aug 4, 2026
19dd898
merge: merge in upstream
alfieroddan Aug 4, 2026
d8c79cb
merge: merge in upstream
alfieroddan Aug 4, 2026
4db9b11
fix: update config to latest training_config
alfieroddan Aug 4, 2026
1433200
docs: add repo id and norm tag to README
alfieroddan Aug 4, 2026
24079b6
fix: default params to allow forward pass
alfieroddan Aug 4, 2026
92c432e
refactor: rename function to get_feature_by_type
alfieroddan Aug 4, 2026
20681c3
refactor: move rms_norm out
alfieroddan Aug 4, 2026
6fcfcce
fix: max_action_horizon and chunk_size not updated from snapshot
alfieroddan Aug 4, 2026
4f238a9
feat: add chunk trimmer to molmoact2
alfieroddan Aug 4, 2026
2161b2a
refactor: don't save compile model in save_hyperparameters
alfieroddan Aug 4, 2026
f3f34b4
fix: default config should be molmo base, update README for training
alfieroddan Aug 4, 2026
f3d1eb3
docs: update to get_device
alfieroddan Aug 4, 2026
d437767
refactor: from_hf and hf_utils refactor. re work merging input featur…
alfieroddan Aug 5, 2026
1faf4b1
feat: add camera re-mapping to all gyms
alfieroddan Aug 5, 2026
a653162
refactor: use mask normalization in NormalizationParameters, refactor…
alfieroddan Aug 5, 2026
708c8f9
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 5, 2026
5bbbc5e
prek: refactor based on prek errors
alfieroddan Aug 5, 2026
b82038b
refactor: set continous action as default
alfieroddan Aug 5, 2026
06b0fb4
docs: update README with LIBERO results
alfieroddan Aug 5, 2026
a47d4f5
refactor: revert
alfieroddan Aug 5, 2026
a2452e1
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 5, 2026
6bd989a
fix: action_mode is override
alfieroddan Aug 5, 2026
fb63f2a
docs: zero shot readme
alfieroddan Aug 5, 2026
c25ce7a
merge
alfieroddan Aug 5, 2026
697277e
revert to main
alfieroddan Aug 5, 2026
21be416
prek: fix prek errors and add peft to dev
alfieroddan Aug 5, 2026
acdec19
uv locks
alfieroddan Aug 5, 2026
ac92ee0
docs: update config for pusht
alfieroddan Aug 5, 2026
7f860b5
merge
alfieroddan Aug 6, 2026
010edb4
Merge branch 'ar/molmoact2' of https://github.com/alfieroddan/physica…
alfieroddan Aug 6, 2026
1ae9a6c
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 10, 2026
1e1bd58
copilot suggestions
alfieroddan Aug 10, 2026
d70b041
fix: fix tests
alfieroddan Aug 10, 2026
d7392e4
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 10, 2026
c0e3982
wip: working ov with asset tokenizer
alfieroddan Aug 10, 2026
7d5afd6
wip: working ov_tokenizer:
alfieroddan Aug 10, 2026
f9cffc7
revert: strip back to just tokenizer additions
alfieroddan Aug 11, 2026
9ab69c4
fix: no chunk trimmer needed
alfieroddan Aug 11, 2026
24d3ee4
Merge pull request #1 from alfieroddan/ar/molmoact2-ov
alfieroddan Aug 11, 2026
c96d921
patch tokenizer
alfieroddan Aug 11, 2026
91907b5
feat: add export component specs, fix prek
alfieroddan Aug 11, 2026
bddeaf0
feat: updated policy with openvino export to fp16
alfieroddan Aug 11, 2026
55ee20a
Merge branch 'open-edge-platform:main' into ar/molmoact2
alfieroddan Aug 11, 2026
6803e88
fix: dtype for vision tower
alfieroddan Aug 11, 2026
fa3d401
fix: dtype conversion workaround
alfieroddan Aug 11, 2026
3b2e32c
docs: update molmo README
alfieroddan Aug 12, 2026
3f88e2a
restore: restore tests back from main
alfieroddan Aug 12, 2026
3a2880d
bandit: add nosec to from_pretrained
alfieroddan Aug 12, 2026
ff2524d
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 12, 2026
231ec4c
refactor: move training options to init
alfieroddan Aug 12, 2026
c7b7c98
comments: add useful comments to policy init
alfieroddan Aug 12, 2026
0ae3d6b
fix: model storage dtype parameter
alfieroddan Aug 13, 2026
3c1b91c
fix: model storage dtype parameter
alfieroddan Aug 13, 2026
1d9b8d1
fix: kv context shared between scheduling steps, not computed all at …
alfieroddan Aug 13, 2026
465d19b
fix: add warning that openvino export to fp16 works when float32
alfieroddan Aug 13, 2026
98aee65
refactor: align policy with new_policy design
alfieroddan Aug 14, 2026
7de65d3
refactor: move gymnamisum utils to gym utils
alfieroddan Aug 14, 2026
ae48a3c
fix: overrides failed with jsonargparse
alfieroddan Aug 18, 2026
4ba0f2a
wip: new policy interface
alfieroddan Aug 26, 2026
d46de9c
wip: init by config method
alfieroddan Aug 26, 2026
0357129
wip: processors refactor
alfieroddan Aug 26, 2026
65a55ce
wip: refactor model components
alfieroddan Aug 26, 2026
2d5207f
wip: policy dataset interaction
alfieroddan Aug 27, 2026
436c2ed
wip: add training back
alfieroddan Aug 27, 2026
c1b70d7
wip: export
alfieroddan Aug 27, 2026
034cf2e
wip: add torch compile
alfieroddan Aug 27, 2026
712a436
wip: add from_config for policy
alfieroddan Aug 27, 2026
c76cc3f
refactor: new molmo interface, load through config, slimmed down test…
alfieroddan Aug 27, 2026
5dc2f74
tests: add tests
alfieroddan Aug 27, 2026
ee229fe
fix: tests had two referecnes to processors
alfieroddan Aug 27, 2026
24518b9
fix: action can be none in norm
alfieroddan Aug 27, 2026
628f886
fix: working forward pass
alfieroddan Aug 27, 2026
99f1bf4
undo: fixes zero-shot
alfieroddan Aug 27, 2026
73c09ae
feat: set_features replaces automatic normalization copy
alfieroddan Aug 28, 2026
1ebccc5
fix: overwrite features in training
alfieroddan Aug 28, 2026
1bce6fb
docs: update README
alfieroddan Aug 28, 2026
37c3034
Merge remote-tracking branch 'origin/main' into ar/molmoact2
alfieroddan Aug 28, 2026
4e7bc35
merge
alfieroddan Aug 28, 2026
2fe326f
Merge branch 'main' into ar/molmoact2
alfieroddan Aug 28, 2026
cd14dd3
fix: add no semgrep to test serialization
alfieroddan Aug 28, 2026
29ef8f0
fix: pre and post processing chagnes to match runtime copilot comments
alfieroddan Aug 28, 2026
d75db57
fix: export ov run on a100
alfieroddan Aug 28, 2026
c4710b3
fix: model inputs action not state
alfieroddan Aug 28, 2026
198721e
fix: adapt-so101 didn't flip joints in dataset statistics
alfieroddan Sep 1, 2026
58d74f5
fix: add 2d and 3d norm param support
alfieroddan Sep 1, 2026
188ae09
linter error
alfieroddan Sep 1, 2026
73fa802
refactor: remove duplicated args in init
alfieroddan Sep 2, 2026
64ef711
merge fix conflict
alfieroddan Sep 2, 2026
499a009
Merge branch 'main' into ar/molmoact2
alfieroddan Sep 2, 2026
5cf9e3c
feat: add preserver normalization for finetuning small datasets
alfieroddan Sep 3, 2026
825d350
Merge branch 'ar/molmoact2' of https://github.com/alfieroddan/physica…
alfieroddan Sep 3, 2026
83c7f3b
fix: preserve_pretrained used wrong logic in set_features
alfieroddan Sep 3, 2026
6d5ce45
tests: check order is set by input_features
alfieroddan Sep 4, 2026
9574300
fix: updated optimizer for cosine warmup
alfieroddan Sep 7, 2026
9320303
Merge branch 'ar/molmoact2' of https://github.com/alfieroddan/physica…
alfieroddan Sep 7, 2026
5648d3e
feat: legacy degree to unit normalization for so101
alfieroddan Sep 7, 2026
2786463
merge uv lock
alfieroddan Sep 7, 2026
05ad304
docs: add raises and returns
alfieroddan Sep 7, 2026
f53124e
merge
alfieroddan Sep 7, 2026
fbca555
Merge branch 'main' into ar/molmoact2
alfieroddan Sep 7, 2026
74bae43
refactor: move chunk trimming to post-process rather than internally …
alfieroddan Sep 7, 2026
a8d854b
tests: integration tests for molmo
alfieroddan Sep 7, 2026
93e4353
fix: warn about quantile stats for training multi-episode datasets
alfieroddan Sep 8, 2026
e56a546
refactor: remove gym modifications, not for this pr
alfieroddan Sep 9, 2026
9a8541d
docs: add docstring examples
alfieroddan Sep 9, 2026
2ca0445
refactor: normalization value type alias
alfieroddan Sep 9, 2026
f9b0b22
refactor: export mixin, from_hf file
alfieroddan Sep 9, 2026
5a38b2b
feat: use epochs rather than steps for optimization
alfieroddan Sep 9, 2026
567cbd7
feat: joint transform
alfieroddan Sep 9, 2026
ca27b9f
refactor: forward and inverse joint transformations
alfieroddan Sep 9, 2026
4f18cdf
Merge branch 'main' into ar/molmoact2
alfieroddan Sep 9, 2026
73244e9
revert robocasa changes
alfieroddan Sep 9, 2026
843adee
refactor: move joint transform to the utils
alfieroddan Sep 9, 2026
2607a8f
docs: fix benchmark indendation
alfieroddan Sep 9, 2026
a91b268
docs: use multiprocessing for safety in decoding with pusth
alfieroddan Sep 9, 2026
e5e99f1
docs: update results
alfieroddan Sep 10, 2026
00006d2
tests: qwen tokenizer coverage
alfieroddan Sep 10, 2026
2d7a1d1
uv lock
alfieroddan Sep 10, 2026
3665c29
Merge branch 'main' into ar/molmoact2
alfieroddan Sep 10, 2026
3238d70
refactor: use steps and not epochs for optim
alfieroddan Sep 10, 2026
6ac22eb
Merge branch 'ar/molmoact2' of https://github.com/alfieroddan/physica…
alfieroddan Sep 10, 2026
2330dbf
refactor: set default optimizer
alfieroddan Sep 11, 2026
7f755c9
feat: add action key to postprocessor manifest
alfieroddan Sep 11, 2026
cce4d54
refactor: optimzer settings
alfieroddan Sep 14, 2026
869ca2d
feat: fix padding for loss over episode boundaries
alfieroddan Sep 15, 2026
733589c
feat: upgrade to transformers 5.15.1
alfieroddan Sep 15, 2026
3a72b29
feat: add configs for training different embodiments
alfieroddan Sep 16, 2026
38197fa
fix: compile doesn't work in train
alfieroddan Sep 16, 2026
7120175
refactor: use peft mixin for molmo
alfieroddan Sep 16, 2026
4e71570
chore: merge upstream, fix conflicts
alfieroddan Sep 16, 2026
da40d30
Merge branch 'main' into ar/molmoact2
alfieroddan Sep 16, 2026
3d447c1
chore: molmo config move in cli test
alfieroddan Sep 16, 2026
8773a71
chore: suppress bandit warnings
alfieroddan Sep 16, 2026
a546a17
refactor: remove transformers override
alfieroddan Sep 16, 2026
c818ef5
feat: new lora mixin, update presets and add unit tests for training …
alfieroddan Sep 17, 2026
8e6e3af
feat: new lora mixin, update presets and add unit tests for training …
alfieroddan Sep 17, 2026
6e3aab0
feat: video rollout callback
alfieroddan Sep 17, 2026
02e6ce2
Merge branch 'open-edge-platform:main' into ar/molmoact2
alfieroddan Sep 17, 2026
bf51735
chore: update physicalai revision
alfieroddan Sep 17, 2026
bfc5460
fix: lightning requires int val_check_interval
alfieroddan Sep 17, 2026
c901772
refactor: default to rollouts video key
alfieroddan Sep 17, 2026
f89f823
refactor: set gradient checkpointing default for pusht
alfieroddan Sep 17, 2026
99c9ac1
refactor: default to rollouts video key
alfieroddan Sep 17, 2026
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
2 changes: 1 addition & 1 deletion application/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ explicit = false

[tool.uv.sources]
physicalai-train = { path = "../../library", editable = true }
physicalai = { git = "https://github.com/openvinotoolkit/physicalai.git", rev = "a3f522f9554034d2d35e97bd2b0f72feae8b3067" }
physicalai = { git = "https://github.com/openvinotoolkit/physicalai.git", rev = "de49e1fda4e38e0a5342b0a59a4cad11a1ee8de0" }
# Keep torchao on PyPI for all extras.
# The XPU index publishes `torchao` local-version wheels (e.g. `+xpu`) that can
# be selected via unsafe-best-match even for non-XPU installs (like `--extra cuda`),
Expand Down
15 changes: 10 additions & 5 deletions application/backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions library/configs/physicalai/molmoact2/pusht.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# MolmoAct2 PushT Training Configuration
#
# Usage:
# physicalai fit --config configs/physicalai/molmoact2/pusht.yaml
model:
class_path: physicalai.policies.MolmoAct2
init_args:
# Initialize weights, tokenizer, and image processor from the released base checkpoint.
pretrained_name_or_path: allenai/MolmoAct2

# Use one observation to predict and execute a 10-step action chunk.
n_obs_steps: 1
chunk_size: 10
n_action_steps: 10

# Start each generated action trajectory from fresh Gaussian noise.
use_random_input_noise: true

# Add low-rank adapters to the VLM while fully training the action expert.
lora_enabled: true
gradient_checkpointing: true

# PushT uses the base embodiment frame and dataset-owned normalization.
adapt_to_so101: false
convert_pretrained_so101_stats: false
preserve_pretrained_normalization_in_training: false

# Text inserted into the model prompt to describe the embodiment and action space.
setup_type: "single 2D point-mass pusher robot in the PushT block-pushing simulation"
control_mode: "absolute planar end-effector position"

# Independent learning rates for the text backbone, vision encoder, image
# connector, and action expert respectively.
optimizer_lr: 5e-5
optimizer_vit_lr: 5e-5
optimizer_connector_lr: 5e-5
optimizer_action_expert_lr: 5e-5
optimizer_betas: [0.9, 0.95]
optimizer_eps: 1e-6
optimizer_weight_decay: 0.0
optimizer_grad_clip_norm: 1.0

scheduler_warmup_steps: 200
scheduler_decay_steps: 15000
scheduler_decay_lr: 1e-6

data:
class_path: physicalai.data.lerobot.LeRobotDataModule
init_args:
# Convert LeRobot samples into PhysicalAI Observation/Action objects.
repo_id: lerobot/pusht
train_batch_size: 8
data_format: physicalai
val_gym:
class_path: physicalai.gyms.pusht.PushTGym
init_args:
task_description: "Push the T-shaped block onto the T-shaped target."
num_rollouts_val: 10
# Worker processes decode and prepare samples in parallel.
num_workers: 0

trainer:
max_epochs: 30
accelerator: gpu
devices: 1
# Mixed bfloat16 reduces memory use while retaining float32-like range.
precision: bf16-mixed
log_every_n_steps: 20
# Run gym rollouts every 500 optimizer steps, including across epoch boundaries.
val_check_interval: 500
check_val_every_n_epoch: null
callbacks:
- class_path: physicalai.train.RolloutVideoRecorderCallback
init_args:
output_dir: val_videos_pushT
fps: 10
record_mode: all
frame_key: top
caption: "Push the T-shaped block onto the T-shaped target."
72 changes: 72 additions & 0 deletions library/configs/physicalai/molmoact2/so101.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# MolmoAct2 SO101 Training Configuration
#
# Usage:
# physicalai fit --config configs/physicalai/molmoact2/so101.yaml
model:
class_path: physicalai.policies.MolmoAct2
init_args:
# Initialize from the released SO100/SO101 checkpoint. norm_tag is deliberately
# omitted so setup("fit") adopts this dataset's feature contract and quantiles.
pretrained_name_or_path: allenai/MolmoAct2-SO100_101

# Use one observation to predict and execute the full 30-step action chunk.
n_obs_steps: 1
chunk_size: 30
n_action_steps: 30

# Start each generated action trajectory from fresh Gaussian noise.
use_random_input_noise: true

# Add low-rank adapters to the VLM while fully training the action expert.
lora_enabled: true

# Recompute intermediate activations during backward passes to save GPU memory.
gradient_checkpointing: true

# Convert dataset samples and quantiles into the checkpoint's legacy SO101
# coordinate frame, without importing or retaining checkpoint normalization stats.
adapt_to_so101: true
convert_pretrained_so101_stats: false
preserve_pretrained_normalization_in_training: false

# Text inserted into the model prompt to describe the embodiment and action space.
setup_type: "single so100/so101 robotic arm in molmoact2"
control_mode: "absolute joint pose"

# Use the shared optimizer recipe validated on PushT.
optimizer_lr: 5e-5
optimizer_vit_lr: 5e-5
optimizer_connector_lr: 5e-5
optimizer_action_expert_lr: 5e-5
optimizer_betas: [0.9, 0.95]
optimizer_eps: 1e-6
optimizer_weight_decay: 0.0
optimizer_grad_clip_norm: 1.0
scheduler_warmup_steps: 200
scheduler_decay_steps: 15000
scheduler_decay_lr: 1e-6

data:
class_path: physicalai.data.lerobot.LeRobotDataModule
init_args:
# Convert the SO101 LeRobot dataset into PhysicalAI Observation/Action objects.
repo_id: Daankrol/pick-and-place-multi-obj
train_batch_size: 16
val_batch_size: 16
# Hold out 10% of episodes reproducibly for validation-loss evaluation.
val_split: 0.1
val_split_seed: 42
data_format: physicalai
# Worker processes decode and prepare samples in parallel.
num_workers: 8

trainer:
max_epochs: 8
accelerator: gpu
devices: 1
# Mixed bfloat16 reduces memory use while retaining float32-like range.
precision: bf16-mixed
log_every_n_steps: 20
# Validate every 500 optimizer steps, including across epoch boundaries.
val_check_interval: 500
check_val_every_n_epoch: null
12 changes: 11 additions & 1 deletion library/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ smolvla = [
"safetensors>=0.4.3,<1.0.0",
]

# MolmoAct2
# Supports LoRA fine-tuning for efficient adaptation
molmoact2 = [
"transformers>=5.15.1,<5.16.0",
"peft>=0.13.0,<1.0.0",
"safetensors>=0.4.3,<1.0.0",
]

# RLWRLD RLDX-1
rldx1 = [
"transformers>=5.15.1,<5.16.0",
Expand All @@ -129,6 +137,7 @@ policies = [
"physicalai-train[pi05]",
"physicalai-train[groot]",
"physicalai-train[smolvla]",
"physicalai-train[molmoact2]",
Comment thread
alfieroddan marked this conversation as resolved.
"physicalai-train[rldx1]",
]

Expand Down Expand Up @@ -168,6 +177,7 @@ dev = [
"pyrefly>=0.18.0",
"ruff>=0.14.14",
"diffusers>=0.38.0",
"peft>=0.13.0,<1.0.0",
]


Expand Down Expand Up @@ -219,7 +229,7 @@ explicit = false

# PyTorch sources configuration
[tool.uv.sources]
physicalai = { git = "https://github.com/openvinotoolkit/physicalai.git", rev = "a3f522f9554034d2d35e97bd2b0f72feae8b3067" }
physicalai = { git = "https://github.com/openvinotoolkit/physicalai.git", rev = "de49e1fda4e38e0a5342b0a59a4cad11a1ee8de0" }
torch = [
{ index = "pytorch-cpu", extra = "cpu" },
{ index = "pytorch-cu128", extra = "cu128" },
Expand Down
3 changes: 2 additions & 1 deletion library/src/physicalai/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .datamodules import DataModule
from .dataset import Dataset
from .lerobot import LeRobotDataModule
from .observation import Feature, FeatureType, NormalizationParameters, Observation
from .observation import Feature, FeatureType, NormalizationParameters, NormalizationValue, Observation

__all__ = [
"DataModule",
Expand All @@ -15,5 +15,6 @@
"FeatureType",
"LeRobotDataModule",
"NormalizationParameters",
"NormalizationValue",
"Observation",
]
31 changes: 23 additions & 8 deletions library/src/physicalai/data/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import numpy as np
import torch

type NormalizationValue = float | list[float] | list[list[float]] | list[list[list[float]]] | None


@dataclass
class Observation:
Expand Down Expand Up @@ -487,14 +489,27 @@ class Feature:

@dataclass(frozen=True)
class NormalizationParameters:
"""Parameters for normalizing a tensor."""

mean: list[float] | float | None = None
std: list[float] | float | None = None
min: list[float] | float | None = None
max: list[float] | float | None = None
q01: list[float] | float | None = None
q99: list[float] | float | None = None
"""Statistics and optional selection mask for feature normalization.

Each statistic may be a scalar or a sequence matching the feature's
normalized dimensions.
"""

#: Arithmetic mean used by mean/std normalization.
mean: NormalizationValue = None
#: Standard deviation used by mean/std normalization.
std: NormalizationValue = None
#: Lower bound used by min/max normalization.
min: NormalizationValue = None
#: Upper bound used by min/max normalization.
max: NormalizationValue = None
#: First-percentile bound used by quantile normalization.
q01: NormalizationValue = None
#: Ninety-ninth-percentile bound used by quantile normalization.
q99: NormalizationValue = None
#: Optional per-dimension selector: ``True`` dimensions are normalized and
#: ``False`` dimensions pass through unchanged for all statistical modes.
mask: list[bool] | None = None
Comment thread
alfieroddan marked this conversation as resolved.


# Module-level constants for convenient dict access
Expand Down
9 changes: 7 additions & 2 deletions library/src/physicalai/eval/rollout/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ def run_rollout_loop( # noqa: PLR0914

# Record frame for video (happens DURING the loop, not after)
if video_recorder is not None:
frame = _collect_frame(observation, frame_key)
video_frame_key = video_recorder.frame_key if video_recorder.frame_key is not None else frame_key
frame = _collect_frame(observation, video_frame_key)
if frame is not None:
video_recorder.record_frame(frame)

Expand All @@ -340,7 +341,11 @@ def run_rollout_loop( # noqa: PLR0914
# InferenceModel doesn't have eval() but doesn't need it
if hasattr(policy, "eval") and callable(policy.eval):
policy.eval()
action = policy.select_action(observation) # shape: (B, action_dim)
# Move the observation onto the policy device (no-op for exported
# InferenceModel policies, which expose no `device`).
policy_device = getattr(policy, "device", None)
policy_observation = observation.to(policy_device) if policy_device is not None else observation
action = policy.select_action(policy_observation) # shape: (B, action_dim)

# For non-vectorized envs (batch_size=1), squeeze the batch dimension
# LiberoGym and similar envs expect action shape (action_dim,) not (1, action_dim)
Expand Down
6 changes: 6 additions & 0 deletions library/src/physicalai/eval/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Self

if TYPE_CHECKING:
from collections.abc import Sequence

import numpy as np

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -143,6 +145,7 @@ def __init__(
codec: str = "h264",
record_mode: RecordMode = "all",
caption: str | None = None,
frame_key: str | Sequence[str] | None = None,
) -> None:
"""Initialize video recorder.

Expand All @@ -152,6 +155,8 @@ def __init__(
codec: Video codec for encoding.
record_mode: When to save videos.
caption: Optional text burned into a bar at the bottom of every frame.
frame_key: Observation image key or keys to record. Uses the rollout's
frame key when omitted.
"""
_check_imageio_available()

Expand All @@ -161,6 +166,7 @@ def __init__(
self.codec = codec
self.record_mode = record_mode
self.caption = caption
self.frame_key = frame_key

self._frames: list[np.ndarray] = []
self._current_episode_name: str | None = None
Expand Down
7 changes: 3 additions & 4 deletions library/src/physicalai/gyms/libero.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,10 @@ def step(
Raises:
ValueError: If action has wrong dimensions.
"""
# Convert tensor to numpy if needed
# Convert tensor to numpy if needed.
# NumPy does not support torch.bfloat16 directly, so cast to float32 first.
if isinstance(action, torch.Tensor):
if action.dtype == torch.bfloat16:
action = action.float()
action = action.cpu().numpy()
action = action.detach().to(dtype=torch.float32).cpu().numpy()

# Validate action shape
if action.ndim != 1:
Expand Down
Loading
Loading