huggingface/transformers Release: v5.21.0
Key point
A release that raises the minimum Python version to 3.11 and adds new models such as MiniCPM-OCR and Pocket TTS, alongside significant improvements to Tensor Parallelism and MoE sharding structures.
Details
Breaking Changes & Deprecations
- The minimum supported Python version has been raised to 3.11.
- Deprecation warnings have been added for existing input names and
rope_scalingassignment. - API compatibility changes have been made, including
legacy RoPEkey normalization and thethinking->reasoning_contentalias configuration.
New Features & Models
- MiniCPM-OCR: Added a document understanding model based on SigLIP+Qwen3.5.
- Recursive Flint: Support for an MoE model (routing 6 out of 256 experts) that combines a 512-token sliding window with full attention.
- UltraVBert: An extension of ModernVBert that supports 512px tiling and 4x4 patch merging (
max_image_tiles27). - TTS models: Added Gradium Phonon TTS, which uses 12.5 Hz, 32-dimensional latents, and the 100M parameter Kyutai Pocket TTS, which supports real-time speed on CPU.
- vLLM integration: Added support for Qwen-Omni Thinker base models, Gemma 3n per-layer inputs, and Flint models.
Performance & Infrastructure
- Tensor Parallelism(TP): Introduced an embedding-only style and support for widths not divisible by TP size. Made all expert sharding mandatory in MoE TP/EP plans.
- Quantization: Added
fp8backend (torch.float8_e4m3fn) toQuantizedCache. Improved performance by removing integer weight dtype casting for DeepSeek-V4.1 FP4 expert processing and TimesFM 2.5 bitsandbytes 4/8-bit. - Cache/Generation: Improved Flash Attention static cache compatibility and added support for chunked prefill cache continuation.
- CI/Infra: Added Intel XPU CI and upgraded to torch 2.14.1. Removed SAM module splitting and improved various test infrastructure.
Bug Fixes
- Gemma4: Fixed Processor import errors.
- Vision: Fixed PNG transparency white background compositing and DeepSeek-VL/Janus
background_colorhandling errors. - Generation: Fixed BLOOM static cache/compiled generate crashes and HunYuan-VL/Idefics2/3 batch/beam search image allocation errors.
- Compatibility: Fixed
torch.float64crashes in MPS environments and torch 2.6/2.7DtensorShardOperationerrors.