xpuenabler commited on
Commit
d30cf58
·
verified ·
1 Parent(s): b1813f5

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: allenai/MolmoAct2-LIBERO-LeRobot
4
+ tags:
5
+ - lerobot
6
+ - molmoact2
7
+ - robotics
8
+ - vla
9
+ - token-pruning
10
+ - grid-sampler
11
+ - libero
12
+ pipeline_tag: robotics
13
+ ---
14
+
15
+ # MolmoAct2-LIBERO + Grid Sampler (random-init sampler)
16
+
17
+ [allenai/MolmoAct2-LIBERO-LeRobot](https://huggingface.co/allenai/MolmoAct2-LIBERO-LeRobot) with
18
+ [Grid Sampler (GridS, ICML 2026)](https://github.com/Fediory/Grid-Sampler) visual token pruning
19
+ integrated into the vision backbone.
20
+
21
+ ⚠️ **The `ActiveTokenSampler` weights in this checkpoint are randomly initialized.** This artifact
22
+ is the starting point for fine-tuning; do not expect baseline task performance with pruning enabled.
23
+ For the fine-tuned version see
24
+ [xpuenabler/molmoact2-libero_grid_sampler_fine_tuned](https://huggingface.co/xpuenabler/molmoact2-libero_grid_sampler_fine_tuned).
25
+
26
+ ## What changed vs. the base checkpoint
27
+
28
+ - Each camera image's pooled visual feature grid (14×14 = 196 tokens for single-crop 256×256) is
29
+ pruned to **K = 16** tokens by an `ActiveTokenSampler`: a global-pooled feature predicts K
30
+ normalized 2D coordinates, `F.grid_sample` bilinearly reads features at those locations, and a
31
+ coordinate MLP injects geometry.
32
+ - The processor emits exactly K image placeholder tokens per image, so the LIBERO 2-camera prompt
33
+ shrinks from 483 to 123 tokens.
34
+ - New config flags: `use_grid_token_sampler=true`, `grid_token_sampler_num_tokens=16`
35
+ (stored in `config.json` and in the saved processor pipeline).
36
+
37
+ ## Usage
38
+
39
+ Requires the `feat/grid-sampler-molmoact2` branch of
40
+ [nota-github/xpu-lerobot](https://github.com/nota-github/xpu-lerobot):
41
+
42
+ ```python
43
+ import torch
44
+ from lerobot.configs.policies import PreTrainedConfig
45
+ from lerobot.policies.factory import make_pre_post_processors
46
+ from lerobot.policies.molmoact2.modeling_molmoact2 import MolmoAct2Policy
47
+
48
+ path = "xpuenabler/molmoact2-libero_grid_sampler_random_init"
49
+ cfg = PreTrainedConfig.from_pretrained(path)
50
+ cfg.pretrained_path = path
51
+ cfg.device = "cuda"
52
+ cfg.inference_action_mode = "continuous"
53
+
54
+ policy = MolmoAct2Policy.from_pretrained(path, config=cfg)
55
+ preprocessor, postprocessor = make_pre_post_processors(
56
+ policy_cfg=cfg, pretrained_path=path,
57
+ preprocessor_overrides={"device_processor": {"device": "cuda"}},
58
+ )
59
+
60
+ batch = preprocessor({
61
+ "observation.images.image": torch.rand(3, 256, 256),
62
+ "observation.images.wrist_image": torch.rand(3, 256, 256),
63
+ "observation.state": torch.zeros(8),
64
+ "task": "pick up the black bowl",
65
+ })
66
+ action = postprocessor(policy.select_action(batch))
67
+ ```
68
+
69
+ ## Citation
70
+
71
+ ```bibtex
72
+ @inproceedings{feng2026gridsampler,
73
+ title = {See What Matters: Differentiable Grid Sample Pruning for Generalizable Vision-Language-Action Model},
74
+ author = {Feng, Yixu and Zhao, Zinan and Ma, Yanxiang and Xia, Chenghao and Du, Chengbin and Wang, Yunke and Xu, Chang},
75
+ booktitle = {Forty-Third International Conference on Machine Learning (ICML)},
76
+ year = {2026}
77
+ }
78
+ ```
config.json ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "molmoact2",
3
+ "n_obs_steps": 1,
4
+ "input_features": {
5
+ "observation.images.image": {
6
+ "type": "VISUAL",
7
+ "shape": [
8
+ 3,
9
+ 256,
10
+ 256
11
+ ]
12
+ },
13
+ "observation.images.wrist_image": {
14
+ "type": "VISUAL",
15
+ "shape": [
16
+ 3,
17
+ 256,
18
+ 256
19
+ ]
20
+ },
21
+ "observation.state": {
22
+ "type": "STATE",
23
+ "shape": [
24
+ 8
25
+ ]
26
+ }
27
+ },
28
+ "output_features": {
29
+ "action": {
30
+ "type": "ACTION",
31
+ "shape": [
32
+ 7
33
+ ]
34
+ }
35
+ },
36
+ "device": "cuda",
37
+ "use_amp": false,
38
+ "use_peft": false,
39
+ "push_to_hub": false,
40
+ "repo_id": null,
41
+ "private": null,
42
+ "tags": null,
43
+ "license": null,
44
+ "pretrained_path": "allenai/MolmoAct2-LIBERO-LeRobot",
45
+ "checkpoint_path": "allenai/MolmoAct2-LIBERO",
46
+ "checkpoint_revision": null,
47
+ "checkpoint_force_download": false,
48
+ "chunk_size": 10,
49
+ "n_action_steps": 10,
50
+ "action_mode": "both",
51
+ "inference_action_mode": null,
52
+ "discrete_action_tokenizer": "allenai/MolmoAct2-FAST-Tokenizer",
53
+ "discrete_generation_max_steps": null,
54
+ "norm_tag": null,
55
+ "setup_type": "single franka robotic arm in libero",
56
+ "control_mode": "delta end-effector pose",
57
+ "image_keys": [
58
+ "observation.images.image",
59
+ "observation.images.wrist_image"
60
+ ],
61
+ "normalize_language": true,
62
+ "add_setup_tokens": true,
63
+ "add_control_tokens": true,
64
+ "normalize_gripper": false,
65
+ "num_state_tokens": 256,
66
+ "max_sequence_length": null,
67
+ "use_grid_token_sampler": true,
68
+ "grid_token_sampler_num_tokens": 16,
69
+ "expected_max_action_dim": 32,
70
+ "num_flow_timesteps": 8,
71
+ "flow_matching_cutoff": 1.0,
72
+ "flow_matching_time_offset": 0.001,
73
+ "flow_matching_time_scale": 0.999,
74
+ "flow_matching_beta_alpha": 1.0,
75
+ "flow_matching_beta_beta": 1.5,
76
+ "num_inference_steps": null,
77
+ "mask_action_dim_padding": true,
78
+ "enable_inference_cuda_graph": true,
79
+ "per_episode_seed": false,
80
+ "eval_seed": null,
81
+ "rtc_config": null,
82
+ "enable_lora_vlm": false,
83
+ "lora_rank": 64,
84
+ "lora_alpha": 16,
85
+ "lora_dropout": 0.05,
86
+ "lora_bias": "none",
87
+ "enable_lora_action_expert": false,
88
+ "enable_knowledge_insulation": false,
89
+ "freeze_embedding": true,
90
+ "train_action_expert_only": false,
91
+ "gradient_checkpointing": true,
92
+ "model_dtype": "bfloat16",
93
+ "softmax_auxiliary_loss": true,
94
+ "softmax_auxiliary_loss_scale": 0.0001,
95
+ "discrete_loss_token_weighting": "root_subsegments_root_tokens",
96
+ "optimizer_lr": 1e-05,
97
+ "optimizer_vit_lr": 5e-06,
98
+ "optimizer_connector_lr": 5e-06,
99
+ "optimizer_action_expert_lr": 5e-05,
100
+ "optimizer_betas": [
101
+ 0.9,
102
+ 0.95
103
+ ],
104
+ "optimizer_eps": 1e-06,
105
+ "optimizer_weight_decay": 0.0,
106
+ "optimizer_grad_clip_norm": 1.0,
107
+ "scheduler_warmup_steps": 200,
108
+ "scheduler_decay_steps": null,
109
+ "scheduler_decay_lr": 1e-06,
110
+ "normalization_mapping": {
111
+ "VISUAL": "IDENTITY",
112
+ "STATE": "QUANTILES",
113
+ "ACTION": "QUANTILES"
114
+ },
115
+ "dataset_feature_names": {
116
+ "action": {
117
+ "motors": [
118
+ "x",
119
+ "y",
120
+ "z",
121
+ "roll",
122
+ "pitch",
123
+ "yaw",
124
+ "gripper"
125
+ ]
126
+ },
127
+ "observation.state": {
128
+ "motors": [
129
+ "x",
130
+ "y",
131
+ "z",
132
+ "rx",
133
+ "ry",
134
+ "rz",
135
+ "rw",
136
+ "gripper"
137
+ ]
138
+ }
139
+ }
140
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db4cc097d4872aef9fab14ab7b8ab22b097038b61313b0d5ca7f106751a81fab
3
+ size 10888547536
policy_postprocessor.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_postprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "molmoact2_clamp_action",
6
+ "config": {}
7
+ },
8
+ {
9
+ "registry_name": "molmoact2_masked_unnormalizer",
10
+ "config": {
11
+ "eps": 1e-08,
12
+ "features": {
13
+ "action": {
14
+ "type": "ACTION",
15
+ "shape": [
16
+ 7
17
+ ]
18
+ }
19
+ },
20
+ "norm_map": {
21
+ "VISUAL": "IDENTITY",
22
+ "STATE": "QUANTILES",
23
+ "ACTION": "QUANTILES"
24
+ }
25
+ },
26
+ "state_file": "policy_postprocessor_step_1_molmoact2_masked_unnormalizer.safetensors"
27
+ },
28
+ {
29
+ "registry_name": "device_processor",
30
+ "config": {
31
+ "device": "cpu",
32
+ "float_dtype": null
33
+ }
34
+ }
35
+ ]
36
+ }
policy_postprocessor_step_1_molmoact2_masked_unnormalizer.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a20b5ab0598507d3a736bc78925dde64c14748440a56df1112b049d55c54c4f6
3
+ size 5060
policy_preprocessor.json ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "policy_preprocessor",
3
+ "steps": [
4
+ {
5
+ "registry_name": "rename_observations_processor",
6
+ "config": {
7
+ "rename_map": {}
8
+ }
9
+ },
10
+ {
11
+ "registry_name": "to_batch_processor",
12
+ "config": {}
13
+ },
14
+ {
15
+ "registry_name": "molmoact2_masked_normalizer",
16
+ "config": {
17
+ "eps": 1e-08,
18
+ "features": {
19
+ "observation.images.image": {
20
+ "type": "VISUAL",
21
+ "shape": [
22
+ 3,
23
+ 256,
24
+ 256
25
+ ]
26
+ },
27
+ "observation.images.wrist_image": {
28
+ "type": "VISUAL",
29
+ "shape": [
30
+ 3,
31
+ 256,
32
+ 256
33
+ ]
34
+ },
35
+ "observation.state": {
36
+ "type": "STATE",
37
+ "shape": [
38
+ 8
39
+ ]
40
+ },
41
+ "action": {
42
+ "type": "ACTION",
43
+ "shape": [
44
+ 7
45
+ ]
46
+ }
47
+ },
48
+ "norm_map": {
49
+ "VISUAL": "IDENTITY",
50
+ "STATE": "QUANTILES",
51
+ "ACTION": "QUANTILES"
52
+ }
53
+ },
54
+ "state_file": "policy_preprocessor_step_2_molmoact2_masked_normalizer.safetensors"
55
+ },
56
+ {
57
+ "registry_name": "molmoact2_clamp_normalized",
58
+ "config": {}
59
+ },
60
+ {
61
+ "registry_name": "molmoact2_pack_inputs",
62
+ "config": {
63
+ "checkpoint_path": "allenai/MolmoAct2-LIBERO",
64
+ "checkpoint_revision": null,
65
+ "checkpoint_force_download": false,
66
+ "action_mode": "both",
67
+ "discrete_action_tokenizer": "allenai/MolmoAct2-FAST-Tokenizer",
68
+ "image_keys": [
69
+ "observation.images.image",
70
+ "observation.images.wrist_image"
71
+ ],
72
+ "allow_image_key_fallback": false,
73
+ "setup_type": "single franka robotic arm in libero",
74
+ "control_mode": "delta end-effector pose",
75
+ "normalize_language": true,
76
+ "add_setup_tokens": true,
77
+ "add_control_tokens": true,
78
+ "num_state_tokens": 256,
79
+ "max_sequence_length": null,
80
+ "chunk_size": 10,
81
+ "max_action_dim": 32,
82
+ "env_action_dim": 7,
83
+ "use_grid_token_sampler": true,
84
+ "grid_token_sampler_num_tokens": 16
85
+ }
86
+ },
87
+ {
88
+ "registry_name": "device_processor",
89
+ "config": {
90
+ "device": "cuda",
91
+ "float_dtype": null
92
+ }
93
+ }
94
+ ]
95
+ }
policy_preprocessor_step_2_molmoact2_masked_normalizer.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e4070d5a500fb431b51183ce9391c2906a6e5a128d926694606e90299b73817c
3
+ size 5068