Get the latest tech news
Show HN: LeanRL: Fast PyTorch RL with Torch.compile and CUDA Graphs
LeanRL is a fork of CleanRL, where selected PyTorch scripts optimized for performance using compile and cudagraphs. - pytorch-labs/LeanRL
LeanRL is a lightweight library consisting of single-file, pytorch-based implementations of popular Reinforcement Learning (RL) algorithms. The primary goal of this library is to inform the RL PyTorch user base of optimization tricks to cut training time by half or more. 🚀 Fast implementations: We provide an optimized, lean version of the PyTorch scripts (<script_name>_torchcompile.py) where data copies and code execution have been optimized thanks to four tools: 🖥️ torch.compile to reduce the overhead and fuse operators whenever possible; 📈 cudagraphs to isolate all the cuda operations and eliminate the cost of entering the compiled code; 📖 tensordict to speed-up and clarify data copies on CUDA, facilitate functional calls and fast target parameters updates.
Or read this on Hacker News