Le

LeanRL: Fast PyTorch RL with Torch.compile and CUDA Graphs

Hacker News

LeanRL: Fast PyTorch RL with Torch.compile and CUDA Graphs

We're excited to announce that we've open-sourced LeanRL, a lightweight PyTorch reinforcement learning library that provides recipes for fast RL training using torch.compile and CUDA graphs. By leveraging these tools, we've achieved significant speed-ups compared to the original CleanRL implementations - up to 6x faster! Reinforcement learning is notoriously CPU-bound due to the high frequency of small CPU operations. PyTorch's powerful compiler can help alleviate these issues, but comes with its own costs. LeanRL addresses this challenge by providing simple recipes to accelerate your training loop and better utilize your GPU. Key results: - 6.8x speed-up with PPO (Atari) - 5.7x speed-up with SAC - 3.4x speed-up with TD3 - 2.7x speed-up with PPO (continuous actions) Why LeanRL? - Single-file implementations of RL algorithms with minimal dependencies in the spirit of gpt-fast - All optimization tricks are explained in the README - no heavy doc, just simple tricks - Forked from the popular CleanRL library Check out LeanRL on https://github.com/pytorch-labs/leanrl now!

Share card

Actual performance

53points
5comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
74%74% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: excited, ide, io · Missing: https docs, just released, exist
74%74% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Product HuntOn track for Day 1 leaderboard · Strong signals: single, using, open · Missing: mac, agents, macos
66%66% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
AppSumoStrong fit for a featured deal · Missing: plus, platform, intuitive
60%60% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
48%48% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: training · Missing: arr, mrr, revenue
18%18% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
1%1% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

CU
CUDA and cuBLAS matrices in Clojure58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CUDA and cuBLAS matrices in Clojure

Hacker News1
Ra
Raytracer with both C++ and CUDA back ends57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Raytracer with both C++ and CUDA back ends

Hacker News5
On
One Billion Rows in CUDA52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

One Billion Rows in CUDA

Hacker News3
CU
CUDA Fractal Renderer53%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CUDA Fractal Renderer

Hacker News44
Lo
Lorentz Embeddings of Graphs in 2-5 Dimensions55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lorentz Embeddings of Graphs in 2-5 Dimensions

Hacker News2
La
Lazily-evaluated graphs from sympy expressions48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Lazily-evaluated graphs from sympy expressions

Hacker News5
Si
Sierpiński and Other Kronecker Graphs with the GraphBLAS39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Sierpiński and Other Kronecker Graphs with the GraphBLAS

Hacker News2
Se
Semi-Supervised-Segmentation-on-Graphs31%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Semi-Supervised-Segmentation-on-Graphs

Hacker News2
E-
E-graphs and equality saturation in Haskell66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

E-graphs and equality saturation in Haskell

Hacker News22
CU
CUTLASS: Fast Linear Algebra in CUDA C++43%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

CUTLASS: Fast Linear Algebra in CUDA C++

Hacker News3