Jumanji: a Diverse Suite of Scalable Reinforcement Learning Environments in JAX

Clément Bonnet, Daniel Luo, Donal Byrne, Shikha Surana, Sasha Abramowitz, Paul Duckworth, Vincent Coyette, Laurence Illing Midgley, Elshadai Tegegn, Tristan Kalloniatis, Omayma Mahjoub, Matthew Macfarlane, Andries P. Smit, Nathan Grinsztajn, Raphaël Boige, Cemlyn N. Waters, Mohamed A. Mimouni, Ulrich A. Mbou Sob, Ruan de Kock, Siddarth Singh, Daniel Furelos-Blanco, Victor Le, Arnu Pretorius, Alexandre Laterre · DOI · OpenReview

Introduction

Reinforcement learning (RL) has achieved remarkable success in games and simulated physics, yet its application to industrial-scale combinatorial optimization remains challenging. Traditional RL benchmarks often suffer from a "sequential bottleneck" where environment logic runs on the CPU while neural network agents reside on GPUs or TPUs. This mismatch leads to significant latency and limits the scale of training.

Jumanji addresses these hurdles by providing an open-source suite of 22 RL environments written entirely in JAX. By leveraging hardware acceleration, Jumanji enables researchers to train agents on complex tasks like routing, packing, and logic puzzles at unprecedented speeds and scales.

The Jumanji Environment Suite

The suite is designed to bridge the gap between academic research and real-world industrial applications. It categorizes problems into three main domains:

  1. Routing: Includes classic NP-hard problems like the Traveling Salesman (TSP) and Vehicle Routing (CVRP).
  2. Packing: Focuses on spatial optimization, such as 3D Bin Packing and Knapsack problems.
  3. Logic: Features deep reasoning games like Sudoku, Minesweeper, and Rubik’s Cube.
Overview of the diverse environments included in the Jumanji suite.

Unlike static datasets, Jumanji environments are generative. This allows for testing generalization by training agents on synthetic distributions and evaluating them on real-world data, such as the VLSI TSP benchmark for circuit design. This decoupling of generation from dynamics ensures that agents learn the underlying logic of a problem rather than just memorizing a specific dataset.

Technical Innovations: RL in JAX

The core of Jumanji's performance lies in its "stateless" functional implementation. By treating the environment as a pure JAX function, the library enables:

  • JIT-compilation: Environments are converted into highly optimized machine code.
  • Vectorization (vmap): Thousands of environment instances can run in parallel on a single device.
  • The Anakin Architecture: Jumanji keeps the entire training loop—both environment dynamics and agent updates—on the hardware accelerator, eliminating costly host-to-device data transfers.
A visualization of the 3D Bin Packing environment, representing the complex industrial tasks Jumanji aims to solve.

Key Results and Scalability

Jumanji demonstrates massive throughput, reaching millions of steps per second. In the "Connector" environment, scaling from a TPU-8 to a TPU-128 reduced training time from 11.5 hours to just 1.5 hours—a near-linear performance gain that is a massive win for large-scale research.

Furthermore, the authors highlight the importance of diverse data generation. Agents trained on a mix of generators (e.g., clustered and linear distributions) showed superior generalization on real-world VLSI problems compared to those trained on simple uniform data. While baseline actor-critic (A2C) models can solve simpler versions of these tasks, a significant "optimality gap" remains on more difficult instances, providing a clear benchmark for future algorithmic development.

Conclusion and Future Directions

Jumanji represents a significant step toward high-performance RL for combinatorial optimization. While currently focused on single-agent discrete action spaces, future work aims to expand into multi-agent systems, continuous control, and domains such as life sciences and logistics. By open-sourcing this library, the authors invite the community to tackle these industrial-strength challenges with the power of JAX.

Summary updated

BibTeX
@inproceedings{bonnet2024jumanji,
  author = {Clément Bonnet and Daniel Luo and Donal Byrne and Shikha Surana and Sasha Abramowitz and Paul Duckworth and Vincent Coyette and Laurence Illing Midgley and Elshadai Tegegn and Tristan Kalloniatis and Omayma Mahjoub and Matthew Macfarlane and Andries P. Smit and Nathan Grinsztajn and Raphaël Boige and Cemlyn N. Waters and Mohamed A. Mimouni and Ulrich A. Mbou Sob and Ruan de Kock and Siddarth Singh and Daniel Furelos-Blanco and Victor Le and Arnu Pretorius and Alexandre Laterre},
  title = {{Jumanji: a Diverse Suite of Scalable Reinforcement Learning Environments in JAX}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=C4CxQmp9wc},
}
Figure