A platform for reinforcement learning in differentiable multiphysics simulation
Project description
Rewarped
Rewarped 🌀 is a platform for reinforcement learning in parallel differentiable multiphysics simulation, built on NVIDIA/warp. Rewarped supports:
- parallel environments: to train RL agents at scale.
- differentiable simulation: to compute batched analytic gradients for optimization.
- multiphysics: (CRBA, FEM, MPM, XPBD) physics solvers and coupling to support interaction between rigid bodies, articulations, and various deformables.
We use Rewarped to re-implement a variety of RL tasks from prior works, and demonstrate that first-order RL algorithms (which use differentiable simulation to compute first-order analytic gradients) can be scaled to a range of challenging manipulation and locomotion tasks that involve interaction between rigid bodies, articulations, and deformables.
For control and reinforcement learning algorithms, see
etaoxing/mineral.
Setup
We have tested on the following environment: RTX 4090, Ubuntu 22.04, CUDA 12.5, Python 3.10, PyTorch 2.
conda create -n rewarped python=3.10
conda activate rewarped
pip install torch torchvision
pip install gym==0.23.1
pip install rewarped
# --- Example: trajectory optimization
python -m rewarped.envs.warp_examples.bounce --num_envs 4
# will create a `.usd` file in `outputs/`
# use MacOS Preview or alternatives to view
# --- Example: (first-order) reinforcement learning
pip install git+https://github.com/etaoxing/mineral
python -m mineral.scripts.run \
task=Rewarped agent=DFlexAntSAPO task.env.env_name=Ant task.env.env_suite=dflex \
logdir="workdir/RewarpedAnt4M-SAPO/$(date +%Y%m%d-%H%M%S.%2N)" \
agent.shac.max_epochs=2000 agent.shac.max_agent_steps=4.1e6 \
agent.network.actor_kwargs.mlp_kwargs.units=\[128,64,32\] \
agent.network.critic_kwargs.mlp_kwargs.units=\[64,64\] \
run=train_eval seed=1000
See
mineral/docs/rewarped.mdfor scripts to reproduce the original paper experiments onrewarped==1.3.0.
Usage
Tasks
|
|
|
|
| dflex • AntRun | isaacgymenvs • HandReorient | plasticinelab • RollingFlat |
|
|
|
|
| gradsim • SoftJumper | dexdeform • HandFlip | softgym • FluidMove |
Creating a new task
Copy and modify rewarped/envs/template/task.py into rewarped/envs/<suite>/<task>.py. Put assets in assets/<suite>/.
Contributing
Contributions are welcome! Please refer to CONTRIBUTING.md.
Versioning
Versions take the format X.Y.Z, where:
- X.Y matches to version X.Y.* of
NVIDIA/warp. - Z is incremented for bug fixes or new features.
Compatibility with newer or older versions of NVIDIA/warp may work, but is not guaranteed or supported. There can be some breaking changes between minor versions.
Acknowledgements
Differentiable Simulation
Tasks (alphabetical)
sizhe-li/DexDeformNVlabs/DiffRLhzaskywalker/PlasticineLabgradsim/gradsimisaac-sim/IsaacGymEnvsleggedrobotics/legged_gymXingyu-Lin/softgym- ...
Citing
@inproceedings{xing2025stabilizing,
title={Stabilizing Reinforcement Learning in Differentiable Multiphysics Simulation},
author={Xing, Eliot and Luk, Vernon and Oh, Jean},
booktitle={International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=DRiLWb8bJg}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rewarped-1.3.3.tar.gz.
File metadata
- Download URL: rewarped-1.3.3.tar.gz
- Upload date:
- Size: 1.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba82f48fdcb558e647592f8f4ac7db39db109f6289d88dd98f5a414d4fa94632
|
|
| MD5 |
f540ad2e7c86b1dcbe3f78b94f92b3a7
|
|
| BLAKE2b-256 |
53c1a76916cb1f6866b034f0af3901d667fb45892c2a5342c38541dffa3d918b
|
Provenance
The following attestation bundles were made for rewarped-1.3.3.tar.gz:
Publisher:
ci-cd.yml on rewarped/rewarped
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rewarped-1.3.3.tar.gz -
Subject digest:
ba82f48fdcb558e647592f8f4ac7db39db109f6289d88dd98f5a414d4fa94632 - Sigstore transparency entry: 181645564
- Sigstore integration time:
-
Permalink:
rewarped/rewarped@50ff5c0d27958c1d6da8a471f8f8a9d5ac6b8d18 -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/rewarped
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@50ff5c0d27958c1d6da8a471f8f8a9d5ac6b8d18 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rewarped-1.3.3-py3-none-any.whl.
File metadata
- Download URL: rewarped-1.3.3-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39ff85480df536049d3dcd6cc614a80419c811516c348e6d37c90dd776695cb6
|
|
| MD5 |
92772819f5cb74840098102f341b7fb8
|
|
| BLAKE2b-256 |
e1c61cbe92a1f478ff8862dbb0ed6d7d547e8d6aa4795c8a172c1a81ad3c3498
|
Provenance
The following attestation bundles were made for rewarped-1.3.3-py3-none-any.whl:
Publisher:
ci-cd.yml on rewarped/rewarped
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rewarped-1.3.3-py3-none-any.whl -
Subject digest:
39ff85480df536049d3dcd6cc614a80419c811516c348e6d37c90dd776695cb6 - Sigstore transparency entry: 181645568
- Sigstore integration time:
-
Permalink:
rewarped/rewarped@50ff5c0d27958c1d6da8a471f8f8a9d5ac6b8d18 -
Branch / Tag:
refs/tags/v1.3.3 - Owner: https://github.com/rewarped
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@50ff5c0d27958c1d6da8a471f8f8a9d5ac6b8d18 -
Trigger Event:
push
-
Statement type: