Liger-Kernel
FreeEfficient Triton Kernels for LLM Training.
About Liger-Kernel
Liger-Kernel is an open-source collection of Triton kernels developed by LinkedIn to optimize large language model (LLM) training. It delivers a 20% increase in multi-GPU training throughput and 60% reduction in memory usage, enabling longer context lengths, larger batch sizes, and massive vocabularies. The library provides Hugging Face compatible implementations of core operations (RMSNorm, RoPE, SwiGLU, CrossEntropy, FusedLinearCrossEntropy) and works seamlessly with Flash Attention, PyTorch FSDP, and Microsoft DeepSpeed. Additionally, Liger-Kernel includes optimized post-training kernels (DPO, ORPO, SimPO, CPO, KTO, JSD, and more) that achieve up to 80% memory savings for alignment and distillation tasks. It supports AMD GPUs and can be integrated with a single line of code.
Key Features
Pros & Cons
- Significant performance improvements: 20% throughput gain and 60% memory reduction
- Easy integration with existing Hugging Face workflows and popular distributed training frameworks
- One-line installation and usage for immediate speedups
- Open source and community-driven, with regular updates and contributions
- Support for AMD GPUs broadens hardware compatibility
- Optimized post-training losses provide additional memory savings for alignment tasks