The task (SoFetchEnv): the SO-100 arm reaches for a cube, grasps it and moves it to a target, simulated in
MuJoCo. See the HumanED notion page for installation instructions.
For imitation learning on the SO-101 with LeRobot, see imitation_learning/.
| Setup | Speed (training steps/s) | Policy works in the real env? | Docs | |
|---|---|---|---|---|
| Recommended | SB3 PPO on MuJoCo Warp, original_20it physics, Kaggle's free T4 GPUs (so_arm_warp.train_sb3) |
16,600 per T4 (6.9× the original setup), two experiments per notebook | ✅ 20/20 grasps in SoFetchEnv |
docs/KAGGLE.md |
| One idea, sooner | Same, but one experiment split over both T4s (MODE = "focus" / --focus / --gpus 2) |
24,000 for that one run (10×); reached the grasp ~22% sooner | ✅ 20/20 grasps | docs/KAGGLE.md |
| Quick sweeps | Same, full_elliptic physics |
23,000 per T4 (9.6×) | ✅ 20/20 (check winners) | docs/KAGGLE.md |
| No GPU quota | SB3 on a laptop (train_parallel.py, SoFetchVecEnv) |
7,100 (3.0×) | ✅ exact physics | below |
| Original setup | SB3 + SubprocVecEnv |
2,400 (1.0×) | ✅ | below |
Faster isn't always better. Warp's full physics trains at 39–61k steps/s, but its policies fail in the real env:
0/20 grasps with the most likely action. Its cheaper friction model (pyramidal cone) is the cause. Our own PyTorch PPO
on Warp (60k steps/s) never learned to grasp. On one T4 with the default reward, SB3 + original_20it learns the
grasp in ~25 min (~25M steps). No setup has carried the cube to the goal yet, so that's the next problem, and it's
about the reward rather than speed. Every measurement, including what failed (MJX, TPU, Apple Metal), is in
docs/TRAINING_OPTIONS.md.
-
On Kaggle: either click through
kaggle_train_warp.ipynbor send jobs withpython tools/kaggle_job.py submit .... Both are step by step in docs/KAGGLE.md. -
On any NVIDIA machine:
pip install mujoco==4.0.1 mujoco-warp==4.0.1 stable-baselines3==2.7.0 gymnasium==1.0.0 torch python -m so_arm_warp.train_sb3 --run-name me-1 --hours 2 # --physics full_elliptic for quick sweepsCheckpoints use
train_parallel.py's layout:warp_sb3_out/models/<run>/<steps>.zippluswarp_sb3_out/vec_norm_stats/<run>/<steps>.pkl, withlog.csvand tensorboard underwarp_sb3_out/logs/.--resume <...>/final.zipcontinues a run. -
Variety or focus (Kaggle gives two T4s): by default each T4 trains its own experiment, so you can compare two ideas. Once one looks promising,
--gpus 2(Kaggle:MODE = "focus", orkaggle_job.py submit --focus) splits that one experiment's envs over both T4s: 24k instead of 16.6k steps/s with the same PPO settings, and in our test it reached a reliable grasp in 17 instead of 22 minutes. See docs/TRAINING_OPTIONS.md. -
From
train_parallel.py: setvec_env_backend = "warp". It uses the same PPO, callbacks and saving as before, withSoFetchWarpVecEnv(so_arm_warp/sb3_vec_env.py) in place of the CPU envs. -
Reward experiments: add a class to
so_arm_warp/rewards.pyand pass--reward <name>.defaultis exactlySoFetchEnv's current reward (checked bytests/test_warp_reward.py);legacyis the pre-PPO7 one. -
Physics (
--physics):original_20it(default):SoFetchEnv's model and solver with 20 iterations instead of 100.full_elliptic: 1.4× faster, also transfers.original: exact, 1.8× slower.full: fastest, but don't train on it.
python -m so_arm_warp.sb3_benchmeasures speed. -
Check a model in the real CPU env (no GPU needed):
python -m so_arm_warp.eval_sb3 warp_sb3_out/models/<run>/final.zip [--sampled] [--video out.mp4](video works on macOS, not on Kaggle).visualise_model.pyandevaluate_model.pyalso work once the files are copied intomodels/andvec_norm_stats/.
- Laptop:
python train_parallel.py(set the run name at the top). It trains withVecMonitor+VecNormalizeand savesmodels/<run>/andvec_norm_stats/<run>/. By default it runs 32 envs in one process withSoFetchVecEnv, which uses MuJoCo's multithreaded rollout and gives the same observations, rewards and infos asSubprocVecEnv(tests/test_vec_env.py). Setvec_env_backend = "subproc"for one process per env. - Kaggle CPU (no quota): upload
kaggle_train.ipynbthrough the website with Accelerator: None. Rebuild it after changing the env withpython make_kaggle_notebook.py. - Watch a model:
python visualise_model.py(set the model at the top). - Tests:
pytest tests/. They checkSoFetchVecEnv, the Warp scene and reward, and the SB3 Warp adapter againstSoFetchEnv. The Warp tests needmujoco-warpand run on CPU if there's no GPU.
| Path | What it is |
|---|---|
so_arm_rl/ |
The original CPU env (SoFetchEnv) and SoFetchVecEnv, which runs N copies in one process |
so_arm_warp/ |
GPU training: train_sb3.py (recommended), sb3_vec_env.py (SB3 adapter), eval_sb3.py, rewards.py, env.py, physics.py (physics options), scene.py, plus sb3_bench.py / bench.py / fidelity*.py. ppo.py / train.py / play.py are our own PyTorch PPO, kept for reference |
tools/kaggle_job.py |
Send, monitor and download Kaggle training jobs from the command line |
kaggle_train_warp.ipynb / make_kaggle_warp_notebook.py |
Kaggle GPU notebook (SB3 on Warp; clones the code from GitHub) and its generator |
kaggle_train.ipynb / make_kaggle_notebook.py |
Kaggle CPU notebook (code embedded) and its generator |
train_parallel.py / visualise_model.py / evaluate_model.py |
SB3 training (CPU, or GPU with vec_env_backend = "warp"), viewing and evaluation |
tests/ |
SoFetchVecEnv, the Warp scene and reward, and the SB3 Warp adapter checked against SoFetchEnv |
docs/ |
Training options and measurements, Kaggle guide |
