pytorch/rl

A modular, primitive-first, python-first PyTorch library for Reinforcement Learning.

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Added to GitGenius on September 19th, 2026
Created on February 1st, 2022
Open Issues & Pull Requests: 309 (+0)
GitHub issues: Enabled
Number of forks: 487
Total Stargazers: 3,573 (+0)
Total Subscribers: 44 (+0)

Repository Insights (GitGenius)

Median issue/PR response: N/A
Mean response time: 5.5 days
90th percentile: 18.2 hours
Tracked items: 313

Most active contributors

Sign in to see contributor activity.

How this project is maintained

Practically every issue opened in the past year has drawn a reply. 72% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. 77% of issues opened in the past year have been closed, leaving a working backlog. Three people close 86% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 82
New in 7 days: 10
Closed in 7 days: 12
Avg open age: 493 days
Stale 30+ days: 64
Stale 90+ days: 51

Recent activity

Opened in 7 days: 8
Closed in 7 days: 7
Comments in 7 days: 1
Events in 7 days: 10

Top labels

  • bug (138)
  • enhancement (110)
  • CI (4)
  • Good first issue (3)
  • flaky-test-tracker (3)
  • Collectors (1)
  • Discussion needed (1)
  • Logging (1)

Detailed Description

TorchRL is a PyTorch-native toolkit for reinforcement learning that provides modular, composable building blocks for constructing RL systems while maintaining compatibility with PyTorch's programming model.

The library addresses the fragmentation in RL development by establishing a unified data model centered on TensorDict, a dictionary-like tensor container that carries structured information through the entire training pipeline. Rather than implementing specific algorithms in isolation, TorchRL provides independent, swappable modules for environments, policies, replay buffers, objectives, and collectors. This approach allows researchers to write code that scales seamlessly from local prototypes to vectorized, multiprocess, distributed, compiled, recurrent, multi-agent, model-based, or offline workflows without changing the underlying data model. The three core design principles ensure data maintains names, structure, batch dimensions, and devices throughout; that components remain independent and interchangeable; and that research code can evolve in complexity without architectural rewrites.

Developers should adopt TorchRL if they are building custom RL systems that require flexibility and composability rather than using pre-packaged algorithm implementations. The toolkit excels for recurrent RL, MuJoCo-based control, multi-agent training, and scenarios where replay-buffer and collector infrastructure matter. It suits projects where the ability to swap components and scale from prototype to production without code changes provides significant value. The library is particularly strong for those already comfortable with PyTorch who want RL capabilities that integrate naturally with the PyTorch ecosystem rather than introducing a separate abstraction layer.

The project maintains active development across multiple capability areas simultaneously. Recent work has expanded recurrent RL performance through scan operations and Triton-based GRU/LSTM handling. Multi-agent support has been strengthened with algorithm implementations including MAPPO and IPPO alongside utility components like value normalization and mixer configurations. Collector and replay-buffer ergonomics have been improved through async prioritized writes, ordered storage access, and optional CUDA-accelerated kernels. The codebase includes state-of-the-art implementations and examples spanning satellite control and macro-control policies alongside core algorithmic components.