PyTorch compiler for model optimization via source-to-source transformation
Top 29.8% on sourcepulse
Thunder is a source-to-source compiler for PyTorch, designed to optimize model performance, memory usage, and parallelism. It targets both end-users seeking out-of-the-box speed-ups and performance experts needing an extensible framework for custom optimizations like kernel fusion, quantization, and distributed strategies.
How It Works
Thunder operates in three stages: it first acquires the PyTorch model by interpreting Python bytecode into a straight-line Python program. Next, it transforms this computation trace to incorporate optimizations such as distributed strategies or precision changes. Finally, it routes parts of the trace for execution using various backends, including NVFuser, torch.compile, specialized libraries (cuDNN SDPA, TransformerEngine), and custom Triton/CUDA kernels. This approach allows for composable transformations and easy swapping of optimizations.
Quick Start & Requirements
pip install torch==2.6.0 torchvision==0.21 nvfuser-cu124-torch26
followed by pip install lightning-thunder
.Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
18 hours ago
1 day