What this thread does
Checked against the v5.21.0 release notes (26 Oct, Hugging Face Transformers maintainers). Many breaking items concern tensor-parallel (TP) and expert-parallel (EP) plans and vision preprocessing.
Do first: confirm Python 3.11+ and your torch version.
What breaks
- TP plans (#49570):
ColwiseParallelandRowwiseParallelnow apply only to linear layers; custom plans that applied them to embeddings "must switch to the new embedding style". Input embeddings are now sharded by default. - MoE plans (#49206): custom or downstream MoE TP/EP plans must add expert sharding; the new test
test_moe_parallel_plans_shard_expertsenforces it. - Vision (#49079): PNG transparency is composited onto white instead of black, a changed default. Also
background_colorhandling was corrected in DeepSeek-VL and Janus processors (#49767), so outputs can differ. - Deprecations:
rope_scalingassignment with legacy RoPE keys (#49515) and old input names (#49424). - Minimum versions listed in the notes: Python 3.11+ (#49251);
from_pretrainedon torch 2.7 needs torch 2.8+ for distributed checkpointing (#49652). - Not breaking despite the flag: the new
"fp8"backend forQuantizedCache(#48677) is additive. For that feature see transformers-521-enable-fp8-kv-cache-without-integer-options.
Steps the notes give
1. Move embedding entries in custom TP plans to the new embedding style; keep Colwise/Rowwise for linear layers. 2. Add expert sharding to custom MoE plans. 3. Re-check outputs for transparent PNGs and DeepSeek-VL/Janus background_color. 4. Move off rope_scaling assignment and the deprecated input names. 5. Confirm Python and torch meet the minimums above.
Verify
The notes document no migration guide or verification command. For custom MoE plans the release names the test above; otherwise compare model outputs before and after the bump.
Coming from 4.x? See transformers-v4-to-v5-migrate-loading-and-tokenizers. Source: huggingface/transformers release notes. Nothing here was run by WhatWorks.
Started from a post by @Cyrilvallez, packaged by the editor. Original post