UPDATEhugging-face-transformers v5.24.1
Transformers v5.24.1 restores remote code: test custom models
This patch repairs the remote-code edges left by v5.24.0: old cache names and imports work again, Llama4 forward crashes and Dory static-cache errors are fixed, and expert-only parallelism can start with an empty tp_plan.
What changed in this release
18 checkpoints in 4 groups, organized by task from the official notes. Checkpoints do not count separate features or commits.
Remote-code compatibility
- Old cache names return: remote code relying on `past_key_values` no longer loses it during signature checks.
- Old output fields build again: remote classes declaring `past_key_values` no longer receive an unexpected `cache` keyword.
- Old fields stay unchanged: output replacement keeps the original name when a remote class declares that field itself.
- `modeling_attn_mask_utils` imports again, so configs that need it at load time no longer stop.
- The legacy mask converter works again: remote models importing `AttentionMaskConverter` from that path load once more.
- The MBart layer signature returns: `MBartDecoderLayer.forward` exposes `past_key_values` again, so remote code can choose its old cache path.
Model fixes
- Llama4 text-only forwards stop crashing: a missing `image_outputs` no longer triggers a read of an absent attribute.
- The Llama4 multimodal field is populated: image output comes from the vision encoder result already computed in that pass.
- Dory uses the cache interface: the last loop reads state through `update(write=False)` instead of raw `layer.keys`.
- Every cache implementation gets a read-only update: `update` accepts `write=False` to return state without writing the cache.
- Dory looped generation recovers: a static cache no longer turns the wrong position into key-value state.
Distributed and checkpoints
- Expert-only parallelism can start: `tp_plan={}` is recognized as deliberately disabling tensor parallelism, not as a missing plan.
- Experts split while the rest is replicated: splitting only experts no longer reports that the model has no TP plan.
- PyTorch 2.9 shard reads are corrected: slice planning recognizes `_StridedShard` instead of treating it as contiguous.
- Packed weights read the right rows: `[gate; up]` weights no longer take rows from the wrong checkpoint region while still returning the expected shape.
Audio input
- A CPU padding mask is accepted: the OmniASR audio encoder takes a `padding_mask` that stays on the CPU.
- The mask follows the audio device: the subsampled mask moves to the `hidden_states` device before masking.
- The vLLM audio backend can start: the Transformers audio backend no longer fails on a CPU/CUDA mask mismatch.
On this page
Contextv5.24.0 changed library interfaces and broke code shipped outside the library
v5.24.0 renamed cache arguments to `cache`, removed the legacy mask module, and standardized multimodal outputs. Remote code shipped with checkpoints kept old signatures and imports, so loading and generation broke at the library boundary, often only when a service starts.
The patch adds no model capability; it reconnects interface, model, and device boundaries. Remote-code teams may hit old cache names, legacy mask imports, or the MBart signature. Llama4, Dory, and OmniASR users face forward, static-cache, or CPU-mask failures. Reproduce the failure before changing training code.
The 18 updates fall into four groups: six remote-code rows, five model-fix rows, four distributed and checkpoint rows, and three audio rows. The figure shows where they land; the sections below follow the same order.
Remote code can use the old cache names and mask imports again
- Old cache names return to signatures, so mask functions keep `past_key_values` and remote filtering retains it; load one custom model to verify.
- Output classes keep old fields, so remote outputs declaring `past_key_values` build again; passing both an old name and `cache` still errors.
- Legacy mask imports return once: `modeling_attn_mask_utils` loads again; the project calls this a one-off exception and points to `masking_utils`.
Llama4 stops crashing on every forward and Dory uses the cache interface
- Llama4 stops crashing: missing `image_outputs` no longer reads an absent attribute; the field takes the vision result already computed in that pass.
- Dory reads state through `update(write=False)` without writing instead of reading `layer.keys`; custom caches must accept the argument.
Expert-only parallelism starts, and PyTorch 2.9 shards read the right rows
- Expert-only parallelism starts: `tp_plan={}` means TP was disabled on purpose; models with no TP plan still error.
- PyTorch 2.9 recognizes `_StridedShard` for slicing and concatenation; compare packed `[gate; up]` values too, since wrong reads can keep the shape.
OmniASR accepts a padding mask that stays on the CPU
- OmniASR accepts a CPU `padding_mask` and moves the subsampled mask to the `hidden_states` device, so callers need not move it first.
- The vLLM audio path recovers: when Transformers forwards a CPU mask as before, OmniASR models no longer fail at startup.
All three touch the same loading chain from different layers
The projects work at different layers of one loading chain: Transformers repairs library interfaces, vLLM guards a dependency range, and SGLang adapts a template call. The products differ, so the table compares each layer's scope, not filled cells.
vLLM 0.34.0 moves OLMoE, Gemma v1, StableLM, and Aria to the Transformers modeling backend, while its range remains `transformers >= 5.16.1, <5.23.0`. v5.24.1 is outside that range, so test the pair separately and keep the published cap.
SGLang 0.5.23 passes `return_dict=False` from `apply_chat_template(tokenize=True)` for Transformers 5. That fixes a template call; it is not a cache-signature test or a general compatibility guarantee.
Keep the vLLM dependency cap and test the patch separately. If the failure is a template call, check the SGLang 0.5.23 adaptation. Neither path is an unconditional upgrade.
| Update area | Transformers v5.24.1 | vLLM v0.34.0 | SGLang v0.5.23 |
|---|---|---|---|
| Remote code and call compatibility | Old cache names return to mask signatures; legacy mask module restored; MBart layers expose `past_key_values`; remote output classes keep declared fields | Range: `transformers >= 5.16.1, <5.23.0`; OLMoE, Gemma v1, StableLM, and Aria use the Transformers modeling backend | DeepSeek-style MLA decode-context-parallel prefix cache can stay in HiCache file L3; `apply_chat_template(tokenize=True)` passes `return_dict=False` for Transformers 5 |
| Distributed and checkpoints | Accepts expert-only parallelism with `tp_plan={}`; slicing and concatenation recognize `_StridedShard`; wrong reads can keep the shape | Fault-tolerant DP+EP scale-down removes dead ranks and redistributes experts without a restart | Fixes the negative routing sentinel in EP mapping |
| Audio and multimodal input | OmniASR accepts a CPU `padding_mask` and moves the subsampled mask to the `hidden_states` device | Nemotron-3.5-Transcribe is a 30B-A4B speech model with audio chat and `/v1/audio/transcriptions` | Supports tokenized multimodal generation |
The patch closes the interface and model breaks left by v5.24.0
The patch closes v5.24.0's breaking edges: compatibility now covers remote code, output classes, and layer signatures, while the cache interface gains a read-only update. Each fix addresses a different boundary; one passing check does not imply broader coverage.
Rows 1-4 cover interfaces, row 5 distributed configuration, and rows 6-9 model and device paths. Check whether you ship remote code or use a static cache, then whether sharded reads run on PyTorch 2.9. Station view, not independently tested: matching teams should upgrade first; others can wait.
The differences come only from the two release notes and linked pull requests, not today's documentation projected backward. For a model absent from the table, check old cache names, legacy mask imports, static caches, and sharded reads.
| Feature | v5.24.0 | v5.24.1 |
|---|---|---|
| Cache argument signatures | Cache names were unified as `cache`; old names were auto-renamed, but mask signatures hid them | `expose_in_signature` returns old names to seven mask constructors; remote code no longer drops them |
| Remote output classes | Every `ModelOutput` subclass renamed `past_key_values` to `cache` in its initializer | Remote classes declaring the old field keep it and avoid an unexpected `cache` keyword |
| Legacy mask imports | `modeling_attn_mask_utils` was removed; configs importing its mask helpers could not load | Module restored; a one-off exception for vLLM, with migration to `masking_utils` still expected |
| MBart layer signature | `MBartDecoderLayer.forward` exposed only `cache`; remote code chose the wrong path and dropped the batch dimension | `past_key_values` is exposed again, so remote code no longer chooses the wrong path |
| Expert-only parallelism | `tp_plan={}` was read as no TP plan, so expert-only MoE startup failed | Empty plan disables TP deliberately; no plan still errors; non-expert weights stay replicated per rank |
| PyTorch 2.9 sharding | `_StridedShard` was read as contiguous; packed `[gate; up]` could load wrong rows with the right shape | Slice planning and concatenation now recognize `_StridedShard` |
| Llama4 forward | Every Llama4 forward read a missing `image_outputs` and crashed | The field takes that pass's vision output and is `None` without images |
| Dory static cache | The last loop read `layer.keys` directly, getting wrong state with a static cache | The last loop uses `update(write=False)`, restoring looped generation |
| OmniASR audio mask | A CPU mask with accelerator audio made `masked_fill` fail on device mismatch | The subsampled mask moves to the `hidden_states` device before masking |
Release analysisRemote-code loading comes first; runtime dependencies can wait
Station view, not independently tested: custom-model teams serving through vLLM have the most at stake. PR #51177 records generation failure for Nemotron-Parse, which relies on an old signature. Llama4, Dory, and OmniASR users should check forward, static-cache, and CPU-mask paths; teams outside them can wait. Services without remote code avoid an unnecessary upgrade.
vLLM 0.34.0 keeps Transformers below 5.23.0; SGLang 0.5.23 fixes a template call, not these cache signatures. Each repairs a different layer, so one pass is not an upgrade permit for another.
Station view, not independently tested: treat this as compatibility maintenance, not a performance release. Load and generate with the failing checkpoint, compare sharded values on PyTorch 2.9, then consider runtime dependencies. Keep the old environment for rollback.
Do not treat the restored mask module as permanent: maintainers call it a one-off exception, and remote code should move to `masking_utils`. Custom caches should accept `update(..., write=False)`, or Dory-style static-cache paths still break. Fix the model repository before the serving stack.
AIGenLab views
Not independently testedThis patch should be treated as compatibility maintenance, not a performance release; the gain is restored loading and generation.
The release scopes itself to vLLM, distributed, and model fixes, with no performance or new-model entries.
vLLM 0.34.0 still caps Transformers below 5.24.1, so this patch is not grounds to loosen that dependency.
The vLLM 0.34.0 release states transformers >= 5.16.1, <5.23.0.
Restoring the legacy mask module only unblocks loading; remote code should still move to masking_utils.
The maintainers call it a one-off exception and say they will not keep restoring deprecated modules for remote code.
Questions
Which official model paths does this patch also repair?
Does vLLM 0.34.0 change its Transformers dependency cap?
Is the restored `modeling_attn_mask_utils` a long-term interface?
Official sources and scope
- Transformers v5.24.1 release The version, publication date, four update groups, and all release entries.
- Transformers v5.24.0 release The cache rename, mask-module removal, and first Dory addition used in the version comparison.
- PR #51085: cache rename backward compatibility The mechanisms behind the mask-signature and remote-output compatibility breaks.
- PR #51124: restore modeling_attn_mask_utils The legacy mask-module restoration and its one-off exception status.
- PR #51177: expose past_key_values in MBart signature How remote code inspects the MBart signature and chooses the wrong cache path.
- PR #51100: OmniASR CPU padding_mask The device mismatch between a CPU mask and accelerator audio, and the fix.
- PR #51144: Llama4 missing image_outputs The root cause of the Llama4 forward crash and the field fix.
- PR #50993: Dory static cache How Dory reads a static cache at its last loop and the update(write=False) change.
- PR #50996: expert parallelism with empty tp_plan Why expert-only parallelism was rejected with an empty tp_plan and when it is now allowed.
- PR #51042: strided checkpoint reads on PyTorch 2.9 The read error caused by treating _StridedShard as contiguous on PyTorch 2.9.
- vLLM v0.34.0 release The dependency range, KV cache, modeling backend, and DP+EP facts used in the horizontal comparison.
- SGLang v0.5.23 release The Transformers 5 template adaptation, EP mapping, and multimodal facts used in the horizontal comparison.
Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.