envpool  by sail-sg

C++ engine for high-performance, parallel RL environment execution

Created 3 years ago
1,193 stars

Top 32.7% on SourcePulse

GitHubView on GitHub
Project Summary

EnvPool is a C++-based parallel execution engine designed to significantly accelerate Reinforcement Learning (RL) environment interactions. It targets RL researchers and practitioners seeking to boost simulation throughput beyond standard Python-based vectorization, offering substantial speedups for a wide range of RL environments.

How It Works

EnvPool leverages C++ for core environment execution and pybind11 for Python integration, utilizing a thread pool for parallel processing. This architecture allows for batched interactions with multiple environment instances, supporting both synchronous and asynchronous execution models. The C++ backend minimizes Python overhead, enabling high-performance simulation, with a notable advantage in CPU-bound environments where Python's GIL can be a bottleneck.

Quick Start & Requirements

Highlighted Details

  • Achieves up to 1M raw FPS for Atari and 3M raw FPS for Mujoco on high-end hardware (256 CPU cores).
  • Provides ~20x throughput improvement over gym.vector_env on high-end setups and ~3x on typical PCs (12 CPU cores).
  • Compatible with OpenAI Gym, DeepMind dm_env, and Gymnasium APIs.
  • Supports synchronous, asynchronous, single-player, and multi-player environment execution.
  • Offers an XLA interface for JAX integration.

Maintenance & Community

  • The project is actively developed, with contributions welcomed.
  • Integration examples are provided for popular RL libraries like Stable-Baselines3, Tianshou, ACME, and CleanRL.

Licensing & Compatibility

  • Licensed under Apache 2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

  • While it supports many environments, adding custom C++ environments requires developer effort.
  • Performance gains are most pronounced on multi-core systems; benefits on single-core setups may be less significant.
Health Check
Last Commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
12 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
3 more.

LitServe by Lightning-AI

0.3%
4k
AI inference pipeline framework
Created 1 year ago
Updated 2 days ago
Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), John Yang John Yang(Coauthor of SWE-bench, SWE-agent), and
6 more.

cleanrl by vwxyzjn

0.5%
8k
RL algorithms implementation with research-friendly features
Created 6 years ago
Updated 2 months ago
Feedback? Help us improve.