{"record":{"id":"a5ea67ded832f149","repo":"sgl-project/sglang","slug":"experimental-sgl-marlin-lora-requires-lora-use-v-a5ea67","errorCode":null,"errorMessage":"experimental_sgl_marlin LoRA requires --lora-use-virtual-experts","messagePattern":"experimental_sgl_marlin LoRA requires --lora-use-virtual-experts","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/lora/marlin_lora_temp/policy.py","lineNumber":33,"sourceCode":") -> None:\n    \"\"\"Validate startup options before the experimental runner is constructed.\"\"\"\n    from sglang.srt.arg_groups.overrides import resolving_view\n\n    cfg = resolving_view(server_args)\n\n    if resolved_args.ep_size > 1 and resolved_args.moe_a2a_backend != \"none\":\n        raise ValueError(\"experimental_sgl_marlin EP requires --moe-a2a-backend none\")\n\n    # A provided adapter path implicitly enables LoRA later unless it was\n    # explicitly disabled. No-LoRA delegates to the stock Marlin fused path.\n    lora_enabled = bool(resolved_args.enable_lora) or (\n        resolved_args.enable_lora is None and bool(cfg.lora_paths)\n    )\n    if not lora_enabled:\n        return\n\n    if not cfg.lora_use_virtual_experts:\n        raise ValueError(\n            \"experimental_sgl_marlin LoRA requires --lora-use-virtual-experts\"\n        )\n    if cfg.lora_backend != \"triton\":\n        # The temporary dense/sink kernels consume Triton SGEMM batch metadata\n        # directly; other global backends are not adapted in this tree.\n        raise ValueError(\"experimental_sgl_marlin LoRA requires --lora-backend triton\")\n    if resolved_args.ep_size <= 1:\n        return\n\n    if (\n        cfg.init_expert_location != \"trivial\"\n        or cfg.ep_num_redundant_experts != 0\n        or cfg.enable_eplb\n        or cfg.elastic_ep_backend is not None\n        or cfg.enable_elastic_expert_backup\n        or cfg.elastic_ep_rejoin\n    ):\n        raise ValueError(","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/lora/marlin_lora_temp/policy.py#L15-L51","documentation":"Startup validation in validate_experimental_sgl_marlin_server_args: when LoRA is enabled for the experimental SGLang Marlin runner (either explicit --enable-lora or an adapter path implicitly enabling it) but --lora-use-virtual-experts is off, the server refuses to start. The experimental kernels require the virtual-experts representation of LoRA.","triggerScenarios":"Starting with the experimental_sgl_marlin runner plus lora_paths / --enable-lora, while cfg.lora_use_virtual_experts is False. This is the startup-time twin of the runtime check in moe_runner.py.","commonSituations":"Enabling LoRA for benchmarking the marlin path but forgetting the virtual-experts flag; lora implicitly enabled by --lora-paths without the accompanying flag.","solutions":["Add --lora-use-virtual-experts to the launch command","Also ensure --lora-backend triton and --max-lora-rank > 0 as required by sibling checks","Remove LoRA paths if LoRA is not intended"],"exampleFix":"# before\n--enable-lora --lora-paths /ckpt/a\n# after\n--enable-lora --lora-paths /ckpt/a --lora-use-virtual-experts --lora-backend triton","handlingStrategy":"validation","validationCode":"lora_enabled = bool(server_args.enable_lora) or bool(server_args.lora_paths)\nif lora_enabled:\n    assert server_args.lora_use_virtual_experts, 'add --lora-use-virtual-experts'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember --lora-paths implicitly enables LoRA — include the virtual-experts flag too","Script launch configs as one unit so flags stay consistent"],"tags":["lora","marlin","virtual-experts","startup-validation","experimental","sglang"],"backgroundTag":"missing-feature-flag","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}