VMAS: a vectorized, differentiable 2D simulator for multi-agent reinforcement learning
VMAS is a vectorized differentiable simulator designed for efficient Multi-Agent Reinforcement Learning benchmarking. It is comprised of a vectorized 2D physics engine written in PyTorch and a set of challenging multi-robot scenarios. Additional scenarios can be implemented through a simple and modular interface.
At a glance
- What is it?
- VMAS replaces the per-environment Python loop of a conventional multi-agent simulator with batched PyTorch tensors, so thousands of parallel 2D scenarios run as one differentiable computation, and it ships scenarios designed to be hard for decentralised policies.
- Who is it for?
- Adopt VMAS if you are benchmarking multi-agent reinforcement learning policies and your current loop over environments is the bottleneck, since the whole design is about batching those environments into tensor operations. Do not adopt it if your task needs 3D physics, non-holonomic agents, or a simulation that is not roughly 2D, because the engine and its motion models are built for that case.
- Can I use it commercially?
- Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 157 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.
Editorial analysis
The bottleneck is the environment loop, not the policy
VMAS is described as a vectorized differentiable simulator designed for efficient MARL benchmarking, and it is made up of a fully-differentiable vectorized 2D physics engine written in PyTorch plus a set of challenging multi-robot scenarios. The reason that matters is the standard loop in most multi-agent reinforcement learning code. You write a step function, and you run it once per environment, usually in a Python for loop, and every one of those calls is interpreted Python that the compiler never sees. With a few hundred environments that loop dominates the wall clock, and the GPU sits mostly idle waiting for it. The vectorization approach in PyTorch, as the README puts it, allows VMAS to perform simulations in a batch, scaling to tens of thousands of parallel environments on accelerated hardware. The audience is therefore researchers who have hit that wall and want to compare algorithms on the same scenarios rather than on their own hardware.
A physics engine written in tensors, with a limited motion model
The engine is not a general rigid body simulator, and the README is straightforward about what it does. VMAS simulates agents and landmarks of different shapes, and supports rotations, elastic collisions, joints and custom gravity. Agents use holonomic motion models, which the README says are used to simplify simulation. That is a real simplification and it is the main thing to understand before choosing this over a conventional simulator, because a holonomic agent can move in any direction without the turning constraints that a differential drive robot has, and a lot of interesting multi-agent navigation behaviour comes from exactly those constraints. Custom sensors such as LIDARs are available, and the simulator supports inter-agent communication, which is what makes it usable for tasks where agents have to exchange information rather than just avoid colliding.
One simulator, many training frameworks
What VMAS actually provides is an environment, and it provides it in a shape that several training libraries can consume. The README lists an interface compatible with OpenAI Gym, with Gymnasium, with RLlib, with torchrl and with its MARL training library BenchMARL, which the authors released and which lets you train VMAS tasks using TorchRL. That last one is the recommended path in the notebook links, where a notebook titled Training VMAS in BenchMARL is marked suggested, alongside a notebook that creates a VMAS scenario and trains it with MAPPO and MLP and GNN policies. The practical consequence for an adopting team is that the environment is not tied to one algorithm. You can benchmark the same task under RLlib and under BenchMARL and know the environment was identical, which is the property that makes a benchmark a benchmark.
MPE scenarios, ported and vectorized
The implementation is inspired by OpenAI's MPE, the multi-agent particle environments, and the README states that alongside VMAS's own scenarios the project ports and vectorizes all the scenarios in MPE. There is a mpe_comparison/ directory at the top level of the repository, which is presumably where that comparison lives, and the environment list in the table of contents is split into a VMAS section with main scenarios and debug scenarios, and an MPE section. The scenarios are described as challenging, and the ones referenced in the notebooks make that concrete: a scenario where multiple robots with different embodiments need to navigate to their goals while avoiding each other and obstacles. The multi embodiment part is the interesting bit, since it is a scenario property that most multi-agent benchmarks do not offer, and it forces a policy to handle agents with different capabilities in the same world.
Installing and running a scenario
The package is published on PyPI as vmas, and the install extras in setup.py tell you what you need. The base install requires numpy, torch, pyglet at 1.5.27 or earlier, gym, gym-notices 0.0.8 and six. There are four optional extras. The gymnasium extra adds gymnasium and shimmy, the rllib extra adds ray with the rllib component at 2.2 or earlier, the render extra adds opencv-python, moviepy, matplotlib and opencv-python again for video output, and the test extra adds pytest, pytest-instafail, pyyaml and tqdm. The requirements file repeats the base set. The version number is not in setup.py itself, it is read out of vmas/__init__.py at build time, with a RuntimeError if the version data is missing.
numpy
torch
pyglet<=1.5.27
gym
gym-notices==0.0.8
sixThe example scripts in the examples folder are the fastest way in, since the notebook on using a VMAS environment reproduces the use_vmas_env.py script, which creates, steps and renders a scenario. The repository also carries a docs/ directory published through Read the Docs, notebooks/, tests/ and a pre-commit configuration.
Rendering, and the problem of running it on a server
Rendering is a separate concern in VMAS, and the README's table of contents gives it its own section, including a subsection on rendering on server machines. The visual output of a 2D simulator is a genuine engineering problem in a vectorized setting, because a batch of tens of thousands of environments cannot be drawn one window at a time, so the renderer has to pick a subset of the batch and draw those. The extras reflect the same concern, since the render extra pulls in opencv-python for image handling, moviepy for encoding the video and matplotlib for plotting. A plot function under rendering is called out separately in the contents, which suggests the rendering path is a function you can override per scenario. If your experiments only need numbers, the base install avoids the whole rendering stack, which is worth knowing when you are provisioning a training cluster.
Where VMAS is the wrong tool
There are boundaries, and the first one is the physics model. If your task needs 3D, if it needs non-holonomic agents with realistic kinematics, or if you need deformable bodies, this engine is not it, and the holonomic motion model means the dynamics you simulate are not the dynamics of a real platform. The second is that the scenario set, however rich, is a fixed set. A benchmark with a shipped set of hard scenarios is a benchmark, and evaluating a policy on a task nobody has implemented in VMAS means writing that scenario yourself, which is exactly what the modular interface invites but also means you are then on your own for comparability. The third is the dependency pinning, which is old enough to matter. gym rather than gymnasium in the base install, with a gymnasium extra that adds the shimmy compatibility layer, and ray with rllib at 2.2 or earlier, mean you are on a generation-old RLlib if you use the rllib extra, and the pyglet ceiling of 1.5.27 is there for the same reason. The alternative worth naming is a discrete event simulator with a mature 3D or physics engine underneath, which is the right choice when physical fidelity matters more than throughput, and VMAS's advantage evaporates the moment your scenario is not expressible in its simplified 2D model. The paper behind the project is on arXiv at 2207.03530, published at the 16th International Symposium on Distributed Autonomous Robotic Systems, and the README asks that you cite it if you use VMAS in your research.
Editorial conclusion
Adopt VMAS if you are benchmarking multi-agent reinforcement learning policies and your current loop over environments is the bottleneck, since the whole design is about batching those environments into tensor operations. Do not adopt it if your task needs 3D physics, non-holonomic agents, or a simulation that is not roughly 2D, because the engine and its motion models are built for that case. Verify first that your intended scenarios are in the shipped set, that your training library has an adapter for it, and that the rendering extras are installed if you need video output.
Frequently asked questions
What is VMAS and what problem does it solve?
VMAS is a vectorized differentiable simulator for multi-agent reinforcement learning benchmarking, made up of a fully-differentiable vectorized 2D physics engine written in PyTorch and a set of challenging multi-robot scenarios. Vectorization lets it run tens of thousands of parallel environments in a batch on accelerated hardware.
Which training frameworks can VMAS be used with?
The README lists an interface compatible with OpenAI Gym, Gymnasium, RLlib, torchrl and BenchMARL, the MARL training library released by the authors. The gymnasium and rllib support come as install extras, and BenchMARL is the suggested path in the notebook links.
What physics does the VMAS engine support?
It simulates agents and landmarks of different shapes and supports rotations, elastic collisions, joints and custom gravity, with custom sensors such as LIDARs and inter-agent communication. Agents use holonomic motion models, which the README says are used to simplify simulation.
How do I install VMAS with the features I need?
The base install requires numpy, torch, pyglet 1.5.27 or earlier, gym, gym-notices 0.0.8 and six. Optional extras add gymnasium with shimmy, ray with rllib 2.2 or earlier, the rendering stack of opencv-python, moviepy and matplotlib, and a test extra with pytest and related packages.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/proroklab-vectorizedmultiagentsimulator)Was this useful?