Skip to content

[Bug]: load_weights() does not work for RobertaModel embeddings since weights start with "roberta." #11821

Closed
@chmeyers

Description

@chmeyers

Your current environment

The output of `python collect_env.py`
Your output of `python collect_env.py` here

Model Input Dumps

No response

🐛 Describe the bug

The RobertaEmbeddingModel here:

return BertModel(vllm_config=vllm_config,

just uses the base BertModel() class, so when model.load_weights() is called the param names don't match, leading to this stack trace:

File "/home/ray/anaconda3/lib/python3.10/site-packages/vllm/model_executor/models/bert.py", line 448, in load_weights
self.model.load_weights(weights)
File "/home/ray/anaconda3/lib/python3.10/site-packages/vllm/model_executor/models/bert.py", line 394, in load_weights
param = params_dict[name]
KeyError: 'roberta.embeddings.LayerNorm.weight'

I think it should be renaming the weights to remove the "roberta." bit similar to

def weight_filter():

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions