Skip to content

Update to transformers v5#30566

Open
hmellor wants to merge 51 commits intovllm-project:mainfrom
hmellor:transformers-v5
Open

Update to transformers v5#30566
hmellor wants to merge 51 commits intovllm-project:mainfrom
hmellor:transformers-v5

Conversation

@hmellor
Copy link
Member

@hmellor hmellor commented Dec 12, 2025

Changes:

  • Update Transformers pin to 5.0.0
  • Update Tokenizers pin to 0.22.2 (as is required by Transformers 5.0.0)
  • Update PEFT lower bound to 0.18.1 so that huggingface/peft@41c07f0 is included (guards import of HybridCache on Transformers version)
  • Update Accelerate pin to 1.1.0 so that 4-bit bnb can work on Transformers v5
  • Update Mamba pin to 2.3.0 so that state-spaces/mamba@35e927b is included (removes import that was deleted in Transformers v5)
  • Replace HF_HUB_ENABLE_HF_TRANSFER with HF_XET_HIGH_PERFORMANCE as the HF Hub is all Xet now so hf_transfer doesn't do anything anymore
  • Add HF_HUB_DOWNLOAD_TIMEOUT=60 to the CI environment to deal with the shortened timeout in huggingface-hub==1 since it switched to httpx
  • Adds a backward compatbility tests that runs the same tests as "Transformers nightly", but with 4.57.5 installed

Architectures/models that will no longer work after the upgrade:

  • MiniCPMV - Custom processing code on the Hub is incompatible with Transformers v5 (PR made but unmerged)
  • Molmo2ForConditionalGeneration - Molmo2Processor uses deprecated optional_attributes and passes arbitrary kwargs to ProcessorMixin.__init__ which is no longer supported in Transformers v5
  • OpenCUAForConditionalGeneration - Custom code is not compatible with Transformers v5
  • OpenPanguVLForConditionalGeneration - OpenPanguVLVideoProcessorInitKwargs does not specify total=False, making all kwargs required
  • HCXVisionForCausalLM - Custom model code imports something deprecated that was deleted in Transformers v5

Caution

30d8b3d must be reverted before this can be merged


Supplementary PRs:

Signed-off-by: Harry Mellor <[email protected]>
@hmellor hmellor added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 12, 2025
@mergify mergify bot added the ci/build label Dec 12, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to update the transformers library to version 5. The changes correctly update the version in requirements/test.in and requirements/nightly_torch_test.txt, and also add the --pre flag to uv pip install in the Dockerfile to allow installation of the release candidate. However, there is a critical oversight: requirements/common.txt still contains a constraint transformers < 5. This will lead to build failures for any configuration that relies on common.txt. This file must be updated to allow transformers v5 for this PR to be mergeable.

@hmellor hmellor marked this pull request as ready for review December 12, 2025 17:56
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@hmellor hmellor changed the title update to transformers v5 Update to transformers v5 Dec 15, 2025
@hmellor hmellor linked an issue Dec 17, 2025 that may be closed by this pull request
1 task
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

@hmellor hmellor linked an issue Jan 27, 2026 that may be closed by this pull request
@hmellor hmellor requested a review from tjtanaa as a code owner January 27, 2026 23:32
@mergify mergify bot added the rocm Related to AMD ROCm label Jan 27, 2026
@mergify
Copy link

mergify bot commented Jan 28, 2026

Documentation preview: https://vllm--30566.org.readthedocs.build/en/30566/

@mergify mergify bot added the documentation Improvements or additions to documentation label Jan 28, 2026
Signed-off-by: Harry Mellor <[email protected]>
Signed-off-by: Harry Mellor <[email protected]>
@mergify
Copy link

mergify bot commented Feb 6, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 6, 2026
@mergify mergify bot removed the needs-rebase label Feb 6, 2026
@mergify
Copy link

mergify bot commented Feb 7, 2026

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @hmellor.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 7, 2026
@mergify mergify bot removed the needs-rebase label Feb 9, 2026
@mergify
Copy link

mergify bot commented Feb 9, 2026

Hi @hmellor, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Signed-off-by: Harry Mellor <[email protected]>
@mergify
Copy link

mergify bot commented Feb 11, 2026

Hi @hmellor, the pre-commit checks have failed. Please run:

uv pip install pre-commit
pre-commit install
pre-commit run --all-files

Then, commit the changes and push to your branch.

For future commits, pre-commit will run automatically on changed files before each commit.

Tip

Is mypy or markdownlint failing?
mypy and markdownlint are run differently in CI. If the failure is related to either of these checks, please use the following commands to run them locally:
# For mypy (substitute "3.10" with the failing version if needed)
pre-commit run --hook-stage manual mypy-3.10
# For markdownlint
pre-commit run --hook-stage manual markdownlint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build cpu Related to CPU backends documentation Improvements or additions to documentation ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm v1

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Bump transformers to 5.0.0 [Feature]: Support transformers>=5

1 participant