-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Description
🚀 The feature, motivation and pitch
Currently, M-RoPE is implemented inside a single file (https://github.com/vllm-project/vllm/blob/main/vllm%2Fmodel_executor%2Flayers%2Frotary_embedding%2Fmrope.py) just like other RoPE methods. However when running the model, the model type in the HF config is used to further select the model-specific M-RoPE implementation. This is not maintainable in the long run as the number of models that use M-RoPE increases.
Considering that much of the M-RoPE code is shared between models, with the main difference being how to get the input positions, I propose a SupportsMRoPE interface for the model class to define this step inside each modeling file. This interface should include a flag variable and also a get_mrope_input_positions method to get the input positions specific to that model.
We can also use this interface to determine whether a model supports M-RoPE, instead of having to set this flag in the HF config.
Alternatives
No response
Additional context
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
Labels
Type
Projects
Status