Skip to content

[Bugfix][CI/Build] Fix InternViT load crash on transformers v5 (missing all_tied_weights_keys) - #49679

Closed
nikhilkulkarni1755 wants to merge 1 commit into
vllm-project:mainfrom
nikhilkulkarni1755:fix/v5-postinit-all-tied-weights
Closed

nikhilkulkarni1755 wants to merge 1 commit into
vllm-project:mainfrom
nikhilkulkarni1755:fix/v5-postinit-all-tied-weights

Conversation

@nikhilkulkarni1755

Copy link
Copy Markdown
Contributor

Purpose

tests/models/multimodal/pooling/test_intern_vit.py is skipped under transformers v5.
Loading the InternVisionModel reference crashes with AttributeError: 'InternVisionModel' object has no attribute 'all_tied_weights_keys'.
Transformers v5 reads all_tied_weights_keys at modeling_utils.py:4736 but sets it only in PreTrainedModel.post_init() (line 1394).
InternViT's remote InternVisionModel.__init__ never calls post_init(), so the attribute is missing.
Transformers is itself inconsistent here: line 4829 reads it defensively with getattr(...), line 4736 does not.
This seeds a safe empty default on PreTrainedModel in the test conftest, matching what post_init() would set.
It removes the skip on test_intern_vit.py.
No open PR addresses this.

Test Plan

Remove the skip.
Run .venv/bin/python -m pytest tests/models/multimodal/pooling/test_intern_vit.py -v.

Test Result

InternViT-300M passes with cosine similarity mean = 1.0 against the HF reference, no AttributeError.
Validated on an RTX 4060 (WSL2), transformers 5.9.0.
InternViT-6B needs more VRAM than that box has, so it runs in CI.
ruff-check, ruff-format, and mypy pass.

Notes

AI assistance was used.
This is a deterministic test-infrastructure fix, so model evals do not apply.
The root fix belongs upstream: make modeling_utils.py:4736 defensive like line 4829. I will file that with transformers separately.

…ng all_tied_weights_keys)

test_intern_vit.py is skipped because loading the InternVisionModel reference crashes under transformers v5.
Transformers v5 reads all_tied_weights_keys at modeling_utils.py:4736 but sets it only in PreTrainedModel.post_init.
InternViT's remote InternVisionModel.__init__ never calls post_init, so the attribute is missing.
Seed a safe empty default in the test conftest, matching what post_init would set.
Remove the skip on test_intern_vit.py.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Nikhil Kulkarni <nikhilkulkarni1755@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added multi-modality Related to multi-modality (#4194) bug Something isn't working labels Jul 24, 2026
@DarkLight1337

Copy link
Copy Markdown
Member

Sorry for missing this, but I prefer skipping the test because this is an upstream issue

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

Labels

bug Something isn't working multi-modality Related to multi-modality (#4194)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants