sgl-project/sglang · error · ValueError
LoRA adapter ' ' contains target modules that are not…
Error message
LoRA adapter '{lora_name}' contains target modules {sorted(unsupported_modules)} that are not included in the specified --lora-target-modules {sorted(self.target_modules)}. Please update --lora-target-modules to include all required modules: {sorted(self.target_modules | adapter_target_modules)}, or use 'all' to enable all supported modules. What it means
Raised in init_lora_shapes when --lora-target-modules was explicitly provided but an adapter contains target module suffixes outside that set. Since the pool and wrappers are only built for the specified modules, an adapter targeting e.g. gate_up_proj when only q_proj/k_proj were configured cannot be applied.
Solutions
- Restart with the union of modules, e.g. --lora-target-modules including everything in the error message
- Use --lora-target-modules all to enable every supported module type
- Use an adapter whose targets match the server configuration
Example fix
# before --lora-target-modules q_proj k_proj v_proj # after --lora-target-modules q_proj k_proj v_proj gate_up_proj down_proj
Defensive patterns
Strategy: validation
Validate before calling
adapter_targets = set(config.target_modules)
server_targets = set(server_args.lora_target_modules)
missing = adapter_targets - server_targets
if missing:
print(f'add to --lora-target-modules: {sorted(server_targets | adapter_targets)}') Prevention
- Derive --lora-target-modules from your adapter configs (union), not from docs of another model
- Use 'all' during experimentation
When it happens
Trigger: Server started with --lora-target-modules q_proj k_proj v_proj and an adapter whose config also lists gate_up_proj/down_proj; the issubset check fails and unsupported_modules is non-empty.
Common situations: Copy-pasting a target-module list from a different model architecture; using an adapter trained on MLP modules with a projection-only server config.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- SGLang currently only supports inferring LoRA target…
- SGLang does not recognize target_modules=
- DSA indexer weights_proj LoRA is incompatible with…
- experimental_sgl_marlin LoRA requires --lora-backend triton
- experimental_sgl_marlin LoRA requires…
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/03e28eab0289efab.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/srt/lora/lora_manager.py:721
if not isinstance(config.target_modules, list):
raise ValueError(
f"SGLang currently only supports inferring LoRA target modules when a list of "
"suffixes is provided in `target_modules` field of PEFT config. Please explicitly "
"specify `--lora-target-modules` during server startup. You can specify `all` to "
"enable all support modules types. "
)
adapter_target_modules = get_normalized_target_modules(
config.target_modules
)
if target_modules is not None:
# When `--lora-target-modules` is provided, validate adapter target modules is a subset of the specified target modules.
if not adapter_target_modules.issubset(self.target_modules):
unsupported_modules = adapter_target_modules - self.target_modules
lora_name = self.lora_refs[lora_id].lora_name
raise ValueError(
f"LoRA adapter '{lora_name}' contains target modules {sorted(unsupported_modules)} "
f"that are not included in the specified --lora-target-modules {sorted(self.target_modules)}. "
f"Please update --lora-target-modules to include all required modules: "
f"{sorted(self.target_modules | adapter_target_modules)}, or use 'all' to enable all supported modules."
)
else:
# Otherwise, infer target_modules from adapter configs.
self.target_modules.update(adapter_target_modules)
# Fusion folds wk + weights_proj into wk_weights_proj, so the modules
# LoRA wraps are absent and an indexer-targeted adapter is silently dropped.
indexer_targets = self.target_modules & DSA_INDEXER_LORA_NAMES
if indexer_targets:
from sglang.srt.layers.attention.dsa.dsa_indexer import (
_use_dsa_indexer_fusion,
)
if _use_dsa_indexer_fusion:View on GitHub (pinned to 0132848349)