mirror of
https://github.com/vllm-project/vllm-ascend.git
synced 2025-10-20 13:43:53 +08:00
[V0.7.3][LoRA][Qwen3] Make v0.7.3 support Qwen3+LoRA (#1037)
### What this PR does / why we need it? Because the EOL vLLM-v0.7.3 lacks this PR(https://github.com/vllm-project/vllm/pull/13166), while launching Qwen3+LoRA on vllm-ascend0.7.3, the error **"Qwen3ForCausalLM" object has no attribute "embedding modules**" will be raised. We modify qwen3.py to support Qwen3+LoRA on vllm-ascend v0.7.3 instead. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? --------- Signed-off-by: paulyu <paulyu0307@gmail.com> Co-authored-by: paulyu <paulyu0307@gmail.com>
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
# Adapted from vllm/model_executor/models/qwen3.py
|
||||
# This file is a part of the vllm-ascend project.
|
||||
|
||||
from typing import Iterable, List, Optional, Set, Tuple, Union
|
||||
from typing import Dict, Iterable, List, Optional, Set, Tuple, Union
|
||||
|
||||
import torch
|
||||
from torch import nn
|
||||
@ -399,6 +399,16 @@ class Qwen3ForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
|
||||
],
|
||||
}
|
||||
|
||||
# LoRA specific attributes
|
||||
supported_lora_modules = [
|
||||
"qkv_proj",
|
||||
"o_proj",
|
||||
"gate_up_proj",
|
||||
"down_proj",
|
||||
]
|
||||
embedding_modules: Dict[str, str] = {}
|
||||
embedding_padding_modules: List[str] = []
|
||||
|
||||
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
|
||||
super().__init__()
|
||||
config = vllm_config.model_config.hf_config
|
||||
|
Reference in New Issue
Block a user