AIGenLab
EN

UPDATEhugging-face-transformers v5.24.1

Transformers v5.24.1 restores remote code: test custom models

Version & typev5.24.1 · Feature
In short

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.

Read the original announcement

On this page
  1. Release inventory
  2. v5.24.0 changed library i…
  3. Remote code can use the o…
  4. Llama4 stops crashing on…
  5. Expert-only parallelism s…
  6. OmniASR accepts a padding…
  7. All three touch the same…
  8. The patch closes the inte…
  9. Release analysis
  10. Questions
  11. Sources & method

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.

The 18 updates fall into four groups: six remote-code compatibility rows, five model-fix rows, four distributed and checkpoint rows, and three audio rows.
Where the 18 grouped changes landWhere the 18 grouped changes landRemote-code compatibility6Model fixes5Distributed and checkpoints4Audio input3
AIGenLab original

Remote code can use the old cache names and mask imports again

  1. Old cache names return to signatures, so mask functions keep `past_key_values` and remote filtering retains it; load one custom model to verify.
  2. Output classes keep old fields, so remote outputs declaring `past_key_values` build again; passing both an old name and `cache` still errors.
  3. 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

  1. Llama4 stops crashing: missing `image_outputs` no longer reads an absent attribute; the field takes the vision result already computed in that pass.
  2. 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

  1. Expert-only parallelism starts: `tp_plan={}` means TP was disabled on purpose; models with no TP plan still error.
  2. 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

  1. OmniASR accepts a CPU `padding_mask` and moves the subsampled mask to the `hidden_states` device, so callers need not move it first.
  2. 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 areaTransformers v5.24.1vLLM v0.34.0SGLang v0.5.23
Remote code and call compatibilityOld cache names return to mask signatures; legacy mask module restored; MBart layers expose `past_key_values`; remote output classes keep declared fieldsRange: `transformers >= 5.16.1, <5.23.0`; OLMoE, Gemma v1, StableLM, and Aria use the Transformers modeling backendDeepSeek-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 checkpointsAccepts expert-only parallelism with `tp_plan={}`; slicing and concatenation recognize `_StridedShard`; wrong reads can keep the shapeFault-tolerant DP+EP scale-down removes dead ranks and redistributes experts without a restartFixes the negative routing sentinel in EP mapping
Audio and multimodal inputOmniASR accepts a CPU `padding_mask` and moves the subsampled mask to the `hidden_states` deviceNemotron-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.

Featurev5.24.0v5.24.1
Cache argument signaturesCache 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 classesEvery `ModelOutput` subclass renamed `past_key_values` to `cache` in its initializerRemote 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 loadModule 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 failedEmpty 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 shapeSlice planning and concatenation now recognize `_StridedShard`
Llama4 forwardEvery Llama4 forward read a missing `image_outputs` and crashedThe field takes that pass's vision output and is `None` without images
Dory static cacheThe last loop read `layer.keys` directly, getting wrong state with a static cacheThe last loop uses `update(write=False)`, restoring looped generation
OmniASR audio maskA CPU mask with accelerator audio made `masked_fill` fail on device mismatchThe 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 tested

This 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?
Llama4 fixes a forward crash caused by missing `image_outputs`, Dory fixes state reads with a static cache, and OmniASR accepts a `padding_mask` kept on the CPU. None of these paths is exclusive to custom models.
Does vLLM 0.34.0 change its Transformers dependency cap?
The vLLM 0.34.0 release still states `transformers >= 5.16.1, <5.23.0`. v5.24.1 falls outside that range, so the combination needs separate validation.
Is the restored `modeling_attn_mask_utils` a long-term interface?
No. Maintainers call it a one-off exception to unblock vLLM. Remote code using deprecated APIs should still be updated or upstreamed and moved to `masking_utils`.

Official sources and scope

Dates beside sources indicate when we consulted them, not when the vendor released the update. Procedures are editorial guidance, not independently tested.