Skip to content

Conversation

@hmellor
Copy link
Member

@hmellor hmellor commented Oct 27, 2025

get_input_embeddings is a getter method of all transformers.PreTrainedModels.

This name had been reused in vLLM to call forward on the model's embedding layer.

Since the method in vLLM is not actually a getter and causes a confusing clash with the getter in Transformers, this PR:

  • Renames get_input_embeddings to embed_input_ids
  • Renames get_multimodal_embeddings to embed_multimodal for consistency
  • Adds fallbacks and deprecation warnings to VllmModel and SupportsMultiModal so that third party vLLM models should still work

@mergify
Copy link

mergify bot commented Oct 27, 2025

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

@mergify mergify bot added documentation Improvements or additions to documentation deepseek Related to DeepSeek models llama Related to Llama models multi-modality Related to multi-modality (#4194) qwen Related to Qwen models gpt-oss Related to GPT-OSS models speculative-decoding labels Oct 27, 2025
@mergify mergify bot added the v1 label Oct 27, 2025
@mergify mergify bot added the tpu Related to Google TPUs label Oct 27, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +64 to 79
def _check_vllm_model_embed_input_ids(model: type[object] | object) -> bool:
model_embed_input_ids = getattr(model, "embed_input_ids", None)
if not callable(model_embed_input_ids):
model_get_input_embeddings = getattr(model, "get_input_embeddings", None)
if callable(model_get_input_embeddings):
logger.warning(
"`get_input_embeddings` for vLLM models is deprecated and will be "
"removed in v0.13.0 or v1.0.0, whichever is earlier. Please rename "
"this method to `embed_input_ids`."
)
model.embed_input_ids = model_get_input_embeddings
logger.warning(
"The model (%s) is missing the `get_input_embeddings` method.",
"The model (%s) is missing the `embed_input_ids` method.",
model,
)
return False

Choose a reason for hiding this comment

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

P1 Badge Allow deprecated get_input_embeddings to satisfy VllmModel check

The new _check_vllm_model_embed_input_ids always returns False when a model still exposes the deprecated get_input_embeddings method, even after binding it to embed_input_ids. As a result, is_vllm_model will reject any third‑party models that follow the old interface, contradicting the intended deprecation fallback and potentially breaking out‑of‑tree integrations until they rename their method. The check should return True when the legacy method exists and is wired up, otherwise the compatibility path never actually works.

Useful? React with 👍 / 👎.

Copy link
Collaborator

@NickLucche NickLucche left a comment

Choose a reason for hiding this comment

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

looks reasonable

@hmellor
Copy link
Member Author

hmellor commented Oct 28, 2025

As per discussion with @ywang96, I'll be pausing work on this until an ongoing new model is added as to not disrupt it.

@hmellor hmellor requested a review from tjtanaa as a code owner November 12, 2025 14:32
Copy link
Member

@DarkLight1337 DarkLight1337 left a comment

Choose a reason for hiding this comment

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

LGTM if tests pass

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Nov 12, 2025
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 12, 2025
@hmellor
Copy link
Member Author

hmellor commented Nov 12, 2025

Failing extended pooling test also failed last night's nightly https://buildkite.com/vllm/ci/builds/38575/steps/canvas?sid=019a7670-4e2e-49b6-8137-1777aa2125f5

@hmellor
Copy link
Member Author

hmellor commented Nov 12, 2025

Failing mm extended 1 test also failed last night's nightly https://buildkite.com/vllm/ci/builds/38575/steps/canvas?sid=019a7670-4e31-45f4-867d-a91104a9c070

Failing mm extended 3 test also failed last night's nightly https://buildkite.com/vllm/ci/builds/38575/steps/canvas?sid=019a7670-4e32-4856-89cf-83eaf9f00b2c

@vllm-bot vllm-bot merged commit 97d1c99 into vllm-project:main Nov 13, 2025
59 of 63 checks passed
@hmellor hmellor deleted the rename-reused-func-names branch November 13, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deepseek Related to DeepSeek models documentation Improvements or additions to documentation gpt-oss Related to GPT-OSS models llama Related to Llama models multi-modality Related to multi-modality (#4194) qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed speculative-decoding tpu Related to Google TPUs v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants