{"record":{"id":"8483c91a532bd209","repo":"sgl-project/sglang","slug":"lora-targets-the-dsa-indexer-sorted-indexer-targ","errorCode":null,"errorMessage":"LoRA targets the DSA indexer ({sorted(indexer_targets)}), which is incompatible with DSA indexer Q/K fusion. Set SGLANG_DISABLE_DSA_INDEXER_FUSION=1 to disable fusion and use indexer LoRA.","messagePattern":"LoRA targets the DSA indexer \\((.+?)\\), which is incompatible with DSA indexer Q/K fusion\\. Set SGLANG_DISABLE_DSA_INDEXER_FUSION=1 to disable fusion and use indexer LoRA\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/lora/lora_manager.py","lineNumber":740,"sourceCode":"                        f\"LoRA adapter '{lora_name}' contains target modules {sorted(unsupported_modules)} \"\n                        f\"that are not included in the specified --lora-target-modules {sorted(self.target_modules)}. \"\n                        f\"Please update --lora-target-modules to include all required modules: \"\n                        f\"{sorted(self.target_modules | adapter_target_modules)}, or use 'all' to enable all supported modules.\"\n                    )\n            else:\n                # Otherwise, infer target_modules from adapter configs.\n                self.target_modules.update(adapter_target_modules)\n\n        # Fusion folds wk + weights_proj into wk_weights_proj, so the modules\n        # LoRA wraps are absent and an indexer-targeted adapter is silently dropped.\n        indexer_targets = self.target_modules & DSA_INDEXER_LORA_NAMES\n        if indexer_targets:\n            from sglang.srt.layers.attention.dsa.dsa_indexer import (\n                _use_dsa_indexer_fusion,\n            )\n\n            if _use_dsa_indexer_fusion:\n                raise ValueError(\n                    f\"LoRA targets the DSA indexer ({sorted(indexer_targets)}), which is \"\n                    \"incompatible with DSA indexer Q/K fusion. Set \"\n                    \"SGLANG_DISABLE_DSA_INDEXER_FUSION=1 to disable fusion and use indexer LoRA.\"\n                )\n\n        if max_lora_rank is not None:\n            self.max_lora_rank = max_lora_rank\n        else:\n            self.max_lora_rank = max(\n                [x.r for x in self.configs.values()],\n                default=0,\n            )\n\n        # Auto-infer self.lora_added_vocab_size from loaded LoRA configs\n        # This happens automatically without requiring user input\n        # if self.lora_added_vocab_size is None:\n        if self.lora_added_tokens_size is None:\n            inferred_extra_vocab_size = next(","sourceCodeStart":722,"sourceCodeEnd":758,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/lora/lora_manager.py#L722-L758","documentation":"Raised in init_lora_shapes when an adapter targets the DSA (DeepSeek Sparse Attention) indexer modules while DSA indexer Q/K fusion is enabled. The fused indexer kernel does not expose separate Q/K projection points for LoRA insertion, so indexer-targeting LoRA is incompatible with the fusion path.","triggerScenarios":"Loading a LoRA whose target modules include DSA indexer projections on a model with DSA, while the SGLANG_DISABLE_DSA_INDEXER_FUSION env var is unset so _use_dsa_indexer_fusion is True.","commonSituations":"Fine-tuning DSA indexer projections with PEFT and loading the adapter into a default SGLang server that fuses indexer Q/K by default; a runtime version where fusion became the default.","solutions":["Restart the server with SGLANG_DISABLE_DSA_INDEXER_FUSION=1","Retrain the adapter without targeting the indexer modules"],"exampleFix":"# before\npython -m sglang.launch_server --model ... --enable-lora\n# after\nSGLANG_DISABLE_DSA_INDEXER_FUSION=1 python -m sglang.launch_server --model ... --enable-lora","handlingStrategy":"validation","validationCode":"import os, json\ncfg = json.load(open(f'{path}/adapter_config.json'))\nindexer_targets = {'indexer_wq', 'indexer_wk'} & set(cfg['target_modules'])\nif indexer_targets and os.environ.get('SGLANG_DISABLE_DSA_INDEXER_FUSION') != '1':\n    os.environ['SGLANG_DISABLE_DSA_INDEXER_FUSION'] = '1'  # before server start","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set SGLANG_DISABLE_DSA_INDEXER_FUSION=1 whenever serving indexer LoRAs","Keep indexer-targeting adapters on a dedicated server instance"],"tags":["lora","dsa","indexer","fusion","env-var","sglang"],"backgroundTag":"incompatible-feature-flag","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}