Skip to main content

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.md for scripts to reproduce the original paper experiments on rewarped==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)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rewarped-1.3.3.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rewarped-1.3.3-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

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

Hashes for rewarped-1.3.3.tar.gz
Algorithm Hash digest
SHA256 ba82f48fdcb558e647592f8f4ac7db39db109f6289d88dd98f5a414d4fa94632
MD5 f540ad2e7c86b1dcbe3f78b94f92b3a7
BLAKE2b-256 53c1a76916cb1f6866b034f0af3901d667fb45892c2a5342c38541dffa3d918b

See more details on using hashes here.

Provenance

The following attestation bundles were made for rewarped-1.3.3.tar.gz:

Publisher: ci-cd.yml on rewarped/rewarped

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for rewarped-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 39ff85480df536049d3dcd6cc614a80419c811516c348e6d37c90dd776695cb6
MD5 92772819f5cb74840098102f341b7fb8
BLAKE2b-256 e1c61cbe92a1f478ff8862dbb0ed6d7d547e8d6aa4795c8a172c1a81ad3c3498

See more details on using hashes here.

Provenance

The following attestation bundles were made for rewarped-1.3.3-py3-none-any.whl:

Publisher: ci-cd.yml on rewarped/rewarped

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page