Liger-Kernel
Liger-Kernel copied to clipboard
Support TRL GRPOTrainer loss_type variants (CISPO, SAPO) with use_liger_kernel=True
Summary
This tracking issue consolidates the work to support TRL's GRPOTrainer loss_type variants in Liger-Kernel. When using use_liger_kernel=True, users can now use additional loss types beyond the standard GRPO/DAPO.
Motivation
TRL's GRPOTrainer supports various loss_type options including:
grpo,dapo,bnpo,dr_grpo(already supported)cispo(newly added)sapo(newly added)
Previously, using use_liger_kernel=True with unsupported loss types would cause errors. This work adds support for CISPO and SAPO loss types.
Newly Supported Loss Types
CISPO (Clipped Importance Sampling Policy Optimization)
- Proposed in the MiniMax-M1 technical report
- Uses upper-bound only clipping with detached gradient
- Paper: https://arxiv.org/abs/2506.13585
SAPO (Soft Adaptive Policy Optimization)
- Replaces hard clipping with smooth sigmoid-based gating
- Uses different temperatures for positive/negative advantages
- Paper: https://arxiv.org/abs/2511.20347
Implementation Plan
- [x] #1054 - Add CISPO support (chunked loss path)
- [x] #1073 - Add SAPO support (chunked loss path)
- [x] #1074 - Add CISPO & SAPO support (Triton ops kernel)
Merge Order
- #1054 (CISPO chunked) - ✅ Merged
- #1073 (SAPO chunked) - depends on #1054
- #1074 (Triton kernel) - depends on #1073
Related Issue
- #1057 - Original CISPO feature request
References
- TRL GRPOTrainer: https://github.com/huggingface/trl/blob/main/trl/trainer/grpo_trainer.py
- MiniMax-M1 (CISPO): https://arxiv.org/abs/2506.13585
- SAPO Paper: https://arxiv.org/abs/2511.20347
- DAPO (normalization reference): https://arxiv.org/abs/2503.14476