Liger Kernel
Open-source collection of Triton kernels that speeds up LLM training and cuts memory usage.
At a Glance
Liger Kernel is a collection of Triton kernels for LLM training, released under the BSD 2-Clause license and installable via pip.
Engagement
Available On
Alternatives
Listed Oct 2026
About Liger Kernel
Liger Kernel is an open-source collection of Triton kernels for LLM training, developed by LinkedIn. It provides Hugging Face-compatible implementations of layers such as RMSNorm, RoPE, SwiGLU, CrossEntropy and FusedLinearCrossEntropy, plus post-training loss kernels. The project states it can raise multi-GPU training throughput by about 20% and reduce memory usage by about 60% under its benchmark conditions.
What It Is
Liger Kernel is a Python library that replaces standard model layers and loss functions with fused, memory-efficient Triton kernels. It is used by ML engineers who train or fine-tune LLMs and want longer context lengths, larger batch sizes or larger vocabularies on the same hardware. The authors state the computation is exact rather than approximate, with forward and backward passes covered by unit tests and convergence tests.
How You Apply It
There are three paths. AutoLigerKernelForCausalLM automatically patches supported Hugging Face models. Model-specific functions such as apply_liger_kernel_to_llama let you choose which kernels to enable. Individual modules, such as LigerFusedLinearCrossEntropyLoss, can also be composed into your own model. Patching APIs cover many model families, including Llama, Mistral, Gemma, Qwen, Phi3, DeepSeek and GPT-OSS.
Post-Training and Distillation Kernels
Chunked fused-linear loss kernels cover alignment methods (DPO, ORPO, CPO, SimPO, KTO) and distillation losses (JSD, KL divergence, TVD). The project says these can cut memory usage by up to 80%.
Hardware and Backends
The kernels run on CUDA and ROCm, with Ascend NPU dependencies also documented. Optional cuTile and CuTe DSL backends for CUDA are enabled via the LIGER_KERNEL_IMPL environment variable. The kernels work with Flash Attention, PyTorch FSDP, DeepSpeed and DDP. Trainer integrations listed include Axolotl, LLaMA-Factory, TRL SFTTrainer, Hugging Face Trainer, SWIFT and oumi.
Community Discussions
Be the first to start a conversation about Liger Kernel
Share your experience with Liger Kernel, ask questions, or help others learn from your insights.
Pricing
Open Source
Liger Kernel is a collection of Triton kernels for LLM training, released under the BSD 2-Clause license and installable via pip.
- License: BSD 2-Clause "Simplified" License (BSD-2-Clause)
- Install with pip install liger-kernel
- Nightly version available via pip install liger-kernel-nightly
- Hugging Face compatible RMSNorm, RoPE, SwiGLU, CrossEntropy, FusedLinearCrossEntropy kernels
- Post-training kernels (DPO, CPO, ORPO, SimPO, JSD)
Capabilities
Key Features
- Triton kernels for RMSNorm, RoPE, SwiGLU, CrossEntropy and FusedLinearCrossEntropy
- One-line patching of Hugging Face models
- AutoLigerKernelForCausalLM wrapper
- Fused linear alignment losses (DPO, ORPO, CPO, SimPO, KTO)
- Distillation kernels (JSD, KL divergence, TVD)
- Exact computation with unit and convergence testing
- Multi-GPU support (FSDP, DeepSpeed, DDP)
- Optional cuTile and CuTe DSL backends
- Minimal dependencies (Torch and Triton)
