Repository navigation
[Bugfix][Model] Fix mypy safe-super error in EmbeddingGemma2Model - #60280
Merged
Merged
Conversation
PR vllm-project#60254 added EmbeddingGemma2Model with bases (nn.Module, SupportsMultiModal, VllmModelForPooling). Because VllmModelForPooling is a Protocol whose __init__ requires vllm_config, mypy resolves the argument-free super().__init__() against the protocol's abstract __init__, failing pre-commit (mypy-3.10..3.13) with [safe-super] and [call-arg] errors on main. Call nn.Module.__init__(self) explicitly instead, matching the established pattern in llama_eagle3.py, cohere_eagle.py, opencua.py, qwen3_dflash.py, and openpangu_mtp.py. No runtime behavior change: the MRO already resolved super().__init__() to nn.Module.__init__. Co-authored-by: Kimi Code <noreply@moonshot.cn> Signed-off-by: Roger Wang <hey@rogerw.io>
Member
Author
|
/ci-run |
DarkLight1337
approved these changes
Oct 6, 2026
Member
|
/ci run |
|
✅ Triggered Buildkite CI #93162 for commit |
5 of 6 tasks
5 of 6 tasks
michael-gpu
pushed a commit
to practical-inference/vllm-ampere-extended
that referenced
this pull request
Oct 20, 2026
…lm-project#60280) Signed-off-by: Roger Wang <hey@rogerw.io> Co-authored-by: Kimi Code <noreply@moonshot.cn>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fix the mypy pre-commit failure on
mainintroduced by #60254 (EmbeddingGemma2Model):super().__init__()in a class inheritingVllmModelForPooling(a Protocol) trips[safe-super]+[call-arg].Claims
vllm/model_executor/models/embedding_gemma2.py:1023that break themypy-3.10–mypy-3.13pre-commit hooks on main.super().__init__()tonn.Module.__init__; this makes the call explicit.embedding_gemma2/safe-super/ [Model] Support EmbeddingGemma2 multimodal pooling architecture #60254 follow-ups — none address this.Validation
All pass. The change is typing-visible only (
super().__init__()already resolved tonn.Module.__init__at runtime), so no model eval was run; happy to run one if reviewers want it.Details
Root cause:
VllmModel/VllmModelForPoolingare Protocols whose__init__requiresvllm_config. When a class explicitly inherits such a Protocol, mypy treats the protocol's trivial-body__init__as the abstract method reachable viasuper().__init__()and rejects the argument-free call. Fix follows the established codebase pattern (nn.Module.__init__(self)inllama_eagle3.py,cohere_eagle.py,opencua.py,qwen3_dflash.py,openpangu_mtp.py).AI assistance (Kimi Code) was used to prepare this PR; the submitter has reviewed the change.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.