Skip to content

[Bugfix] Raise a clear error when a linear weight parameter is missing - #53188

Closed
33modeling wants to merge 1 commit into
vllm-project:mainfrom
33modeling:fix-linear-missing-parameter-error
Closed

33modeling wants to merge 1 commit into
vllm-project:mainfrom
33modeling:fix-linear-missing-parameter-error

Conversation

@33modeling

Copy link
Copy Markdown

Summary

Improve the error reported by MergedColumnParallelLinear.load_weights when a checkpoint weight does not correspond to a valid parameter.

Previously, a failed parameter lookup could fall back to the layer module itself. The subsequent weight-loading operation would then fail with a confusing AttributeError, making it difficult to identify the actual checkpoint or model-definition mismatch.

This change validates the resolved object before invoking its weight loader and raises a descriptive ValueError when it is not a torch.nn.Parameter.

Changes

  • Detect unresolved or invalid parameter lookups before calling weight_loader.
  • Include the checkpoint weight name and resolved object type in the error message.
  • Preserve the existing behavior for models with an optional, missing bias.
  • Add a regression test for a missing nested parameter.

Testing

  • Verified the patch with git diff --check.
  • Verified both modified Python files with py_compile.
  • The pytest test suite could not be executed locally because pytest is not installed in the current environment.

Fixes #53107

AI Assistance

OpenAI Codex assisted with the implementation and regression-test preparation. I reviewed the resulting changes and take responsibility for the contribution.

@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.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Reviewers with write access and configured trusted contributors can comment /ci run for upstream CI or /amd-ci run for AMD CI only whenever CI signals are needed.

Once the PR is approved or has the ready label, the PR author can also use the corresponding /ci run, /ci retry, and /ci cancel commands, or their /amd-ci variants. New commits do not start upstream CI automatically.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@mergify mergify Bot added the bug Something isn't working label Aug 21, 2026
@33modeling

Copy link
Copy Markdown
Author

Closing this as a duplicate of #53118, which was opened earlier and addresses the same issue with the same parameter-validation approach. Sorry that I missed the existing PR during the duplicate-work check.

@33modeling 33modeling closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: LinearBase.load_weights substitutes the module for a missing parameter, surfacing as a confusing AttributeError

1 participant