Skip to content

Conversation

@mgoin
Copy link
Member

@mgoin mgoin commented Aug 14, 2024

It is pretty easy to run into issues when loading scalar weights from checkpoints into parameters, since they can have no shape in some cases, resulting in errors like

  File "/home/mgoin/code/vllm/vllm/model_executor/model_loader/weight_utils.py", line 525, in default_weight_loader
    assert param.size() == loaded_weight.size(), (
AssertionError: Attempted to load weight (torch.Size([1])) into parameter (torch.Size([]))

I think it makes sense to detect and allow "broadcasting" in this special case for ease of use.

@mgoin mgoin requested review from comaniac and youkaichao August 14, 2024 22:57
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge).

To run full CI, you can do one of these:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

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

LGTM. I've been faced to this several times...

@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 15, 2024
@mgoin mgoin mentioned this pull request Aug 15, 2024
@simon-mo simon-mo merged commit 21313e0 into main Aug 15, 2024
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
@simon-mo simon-mo deleted the fix-scalar-loading branch October 28, 2024 16:50
LeiWang1999 pushed a commit to LeiWang1999/vllm-bitblas that referenced this pull request Mar 26, 2025
Signed-off-by: LeiWang1999 <leiwang1999@outlook.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.

4 participants