[lora] Fix partial MoE rank loading, VL lm_head, strict loading, deepseek on-demand (#21864)

Co-authored-by: Yusheng Su <yushengsu.thu@gmail.com>
This commit is contained in:
Kurt Shuster
2026-04-12 16:25:02 -07:00
committed by GitHub
co-authored by Yusheng Su
parent 1f8df97054
commit f81b6df3a3
3 changed files with 186 additions and 65 deletions
+10 -2
View File
@@ -475,6 +475,7 @@ class ServerArgs:
lora_backend: str = "csgmv"
max_lora_chunk_size: Optional[int] = 16
experts_shared_outer_loras: Optional[bool] = None
lora_strict_loading: bool = False
# Kernel backend
attention_backend: Optional[str] = None
@@ -4961,6 +4962,13 @@ class ServerArgs:
"(expert_dim=1). Use --no-experts-shared-outer-loras to force disable. "
"By default this is auto-detected from adapter weights.",
)
parser.add_argument(
"--lora-strict-loading",
default=ServerArgs.lora_strict_loading,
action=argparse.BooleanOptionalAction,
help="Enable strict loading for LoRA adapters. "
"When set, mismatched or missing keys in the adapter weights will raise an error.",
)
# Kernel backend
parser.add_argument(
@@ -6669,14 +6677,14 @@ class ServerArgs:
"Expected a list or a dictionary."
)
# Expand target modules
# Normalize target modules to a set; keep {"all"} as a sentinel
# that gets resolved model-awarely in lora_manager.init_lora_shapes().
if self.lora_target_modules:
self.lora_target_modules = set(self.lora_target_modules)
if "all" in self.lora_target_modules:
assert (
len(self.lora_target_modules) == 1
), "If 'all' is specified in --lora-target-modules, it should be the only module specified."
self.lora_target_modules = set(SUPPORTED_LORA_TARGET_MODULES)
# Ensure sufficient information is provided for LoRA initialization.
assert self.lora_paths or (