smolvla-mlx

Hugging Faceのロボット基盤モデル smolVLA(450M・Vision-Language-Action)のApple Silicon(MLX)移植です。カメラ画像・言語指示・関節状態から50手先までのアクションチャンクを生成します。大規模GPUなしで、実機制御に十分な速度で動作します。

実行系 1チャンク(50手)生成 ピークメモリ
本移植(MLX) 160ms(313 actions/s) 1.6GB
PyTorch MPS(参照実装) 263ms
PyTorch CPU(参照実装) 5,835ms

同一入力・同一ノイズでPyTorch参照実装とコサイン類似度0.99994(50手×32次元・Euler 10ステップ通し)の出力一致を検証済みです。プレフィル→偶数層joint self-attention/奇数層cross-attentionの二相構造、fp32でのRoPE・attention計算まで参照実装を忠実に再現しています。

使い方

pip install mlx-vlm pillow transformers
hf download tokimoa/smolvla-mlx --local-dir smolvla-mlx
from smolvla_mlx import SmolVLAMLX
import numpy as np

model = SmolVLAMLX.from_pretrained("smolvla-mlx")
actions = model.predict(
    images=[cam1, cam2, cam3],          # HWC uint8(1〜3カメラ)
    instruction="Pick up the red cube",
    state=[0.1, -0.2, 0.3, 0.0, 0.5, 0.0],  # 関節状態(実次元のまま)
)                                        # -> (50, 6) アクションチャンク

CLIでも動きます。

python smolvla-mlx/smolvla_mlx.py --images cam0.png cam1.png cam2.png \
  --instruction "pick up the red cube" --state 0,0,0,0,0,0

位置づけ

smolVLAはベースモデルであり、実タスクへの適用には手元のロボット(SO-101等)でのファインチューニングが前提です。学習はLeRobotで行い、Mac上での推論・検証・デモに本移植を使う構成を想定しています。ファインチューニング済み重み(同一アーキテクチャ)もmodel.safetensorsを差し替えれば動きます。

前処理(アスペクト維持リサイズ・左上パディング・[-1,1]正規化・言語トークナイズ・状態パディング)はランタイムに内蔵しており、追加コードなしで参照実装と同じ入力分布になります。

ライセンス

Apache-2.0(ベースモデルsmolvla_baseのライセンスを継承)


Developed by tokimoa

Downloads last month
27
Safetensors
Model size
0.5B params
Tensor type
F32
·
BF16
·
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Video Preview
loading

Model tree for tokimoa/smolvla-mlx

Finetuned
(6980)
this model