Skip to content

Conversation

@charlotte12l
Copy link
Contributor

@charlotte12l charlotte12l commented Nov 30, 2025

Purpose

hidden_size() property in ModelConfig was firstly introduced in #25817 (one month ago). We already have get_hidden_size() to get hidden_size from hf_text_config.

vllm/vllm/config/model.py

Lines 1202 to 1203 in 64bc09b

def get_hidden_size(self) -> int:
return getattr(self.hf_text_config, "hidden_size", 0)

Although hidden_size()

vllm/vllm/config/model.py

Lines 1730 to 1734 in 64bc09b

def hidden_size(self):
if hasattr(self.hf_config, "hidden_size"):
return self.hf_config.hidden_size
text_config = self.hf_config.get_text_config()
return text_config.hidden_size

will check hf_config first, but from functionality-wise, hidden_size() is the same as get_hidden_size().

This PR is also a preparation for #28454 which hope to create a model_arch_config that contains/specified the fields that's needed by vLLM engine.

Test Plan

CI

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
@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.

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 removes the redundant hidden_size property from ModelConfig and replaces its usages with the existing get_hidden_size() method. This is a good refactoring that simplifies the code and removes duplicated logic, improving maintainability. The changes are applied consistently in vllm/config/model.py and vllm/model_executor/models/adapters.py. The change is correct and I have no concerns.

@hmellor hmellor enabled auto-merge (squash) November 30, 2025 15:06
@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 30, 2025
@hmellor hmellor merged commit 21c2627 into vllm-project:main Nov 30, 2025
55 checks passed
kitaekatt pushed a commit to kitaekatt/vllm that referenced this pull request Dec 1, 2025
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
amd-hhashemi pushed a commit to amd-hhashemi/vllm that referenced this pull request Dec 2, 2025
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Hashem Hashemi <hashem.hashemi@amd.com>
charlotte12l added a commit to charlotte12l/vllm that referenced this pull request Dec 5, 2025
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
charlotte12l added a commit to charlotte12l/vllm that referenced this pull request Dec 9, 2025
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Somoku pushed a commit to Somoku/vllm that referenced this pull request Dec 15, 2025
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Somoku <linsh0@protonmail.com>
dsuhinin pushed a commit to dsuhinin/vllm that referenced this pull request Jan 21, 2026
…ect#29749)

Signed-off-by: Xingyu Liu <charlotteliu12x@gmail.com>
Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants