Add LoRA support for DeepSeek models (V2, V3, R1-0528) (#23971)

Signed-off-by: sadeghja1070 <sadegh.ja1070@gmail.com>
Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jee Jee Li <pandaleefree@gmail.com>
Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk>
This commit is contained in:
sadegh.shokatian
2025-08-30 06:40:02 -07:00
committed by GitHub
parent 3a6acad431
commit 379ea2823a
3 changed files with 12 additions and 7 deletions

View File

@@ -56,7 +56,7 @@ from vllm.model_executor.model_loader.weight_utils import (
from vllm.model_executor.sampling_metadata import SamplingMetadata
from vllm.sequence import IntermediateTensors
from .interfaces import MixtureOfExperts, SupportsPP
from .interfaces import MixtureOfExperts, SupportsLoRA, SupportsPP
from .utils import (PPMissingLayer, is_pp_missing_parameter,
make_empty_intermediate_tensors_factory, make_layers,
maybe_prefix)
@@ -727,7 +727,8 @@ class DeepseekV2Model(nn.Module):
return hidden_states
class DeepseekV2ForCausalLM(nn.Module, SupportsPP, MixtureOfExperts):
class DeepseekV2ForCausalLM(nn.Module, SupportsPP, MixtureOfExperts,
SupportsLoRA):
packed_modules_mapping = {
"gate_up_proj": ["gate_proj", "up_proj"],
}