Liger-Kernel is an open-source collection of efficient Triton kernels developed by LinkedIn and designed specifically for large language model training. Its core goal is to improve multi-GPU training throughput and reduce memory usage. Official data shows it can increase throughput by about 20% and reduce memory usage by about 60%, while supporting longer context lengths, larger batch sizes, and very large vocabularies.
[Main Capabilities] The project implements a variety of kernels compatible with Hugging Face, including RMSNorm, RoPE, SwiGLU, CrossEntropy, FusedLinearCrossEntropy, and more, and continues to add more. The kernels work out of the box with Flash Attention, PyTorch FSDP, and Microsoft DeepSpeed. In addition to training kernels, it also provides optimized post-training kernels supporting loss functions such as DPO, CPO, ORPO, SimPO, KTO, and JSD, saving up to 80% memory for alignment and distillation tasks.
[Usage] Three integration methods are provided: 1) Use AutoLigerKernelForCausalLM for automatic patching, which is the simplest; 2) Use the model-specific patching API to replace the corresponding layers in Hugging Face models; 3) Use individual kernels separately to compose models yourself. The official documentation site provides installation, usage examples, and API reference.
[Installation Dependencies] Requires triton >= 2.3.1, torch >= 2.5.0 (install according to the PyTorch official website instructions). Optional dependencies include transformers >= 4.x (required when using the patching API), cuda-tile (when enabling the cuTile backend), cuda-tile[tileiras], nvidia-cutlass-dsl >= 4.6.0 (when enabling the CuTe DSL backend, targeting Hopper SM90 and Blackwell SM100/SM110), and liger-cute-kernels. It also supports torch_npu == 2.9.0 and triton-ascend == 3.2.2 (must be installed from the Ascend PyPI mirror). For specific installation commands and version details, please follow the official instructions; this material does not provide a directly copyable one-line installationcommand.
[Optional Backends] Supports explicitly enabling optional implementations via the environment variable LIGER_KERNEL_IMPL. Currently supports cutile and cutedsl. cuTile is a CUDA-specific DSL implementation; CuTe DSL is a CUDA-specific Python DSL bundled with NVIDIA CUTLASS, targeting Hopper and Blackwell, providing cutlass.cute implementations of Fused linear cross entropy (including an SM90-specific variant) and Fused scaled cross entropy (SM90). Operations without corresponding kernels transparently fall back to the default Triton kernels. There are also fused operations such as Fused Scaled Cross Entropy, as well as frontend support for tensor parallelism.
[Applicable Scenarios] Suitable for scenarios requiring efficient training or fine-tuning of large language models, especially training tasks that are memory-constrained, aim to improve multi-GPU training efficiency, or require long context and large vocabularies. Compatible with training frameworks such as Axolotl, LLaMa-Factory, SFTTrainer, Hugging Face Trainer, SWIFT, and oumi.
[Limitations and Notes] Some optional backends (such as cuTile and CuTe DSL) only support CUDA and have hardware requirements (Hopper/Blackwell). cuTile has specific matching requirements with the CUDA version of the native LCK wheel, NVSHMEM, and other dependencies, and must be selected according to the official build instructions. CuTe DSL's apache-tvm-ffi is an optional dependency, but it is strongly recommended to install it to reduce the per-call overhead of short kernels. TP and EP use separate cache teams and workspaces, and applications need to initialize NVSHMEM from a common parent group. The material does not provide specific pricing, platform coverage, or performance guarantees.