{"record":{"id":"e06cd5f724ab16c0","repo":"sgl-project/sglang","slug":"deepep-v2-moe-is-not-validated-for-architecture-r","errorCode":null,"errorMessage":"DeepEP v2 MoE is not validated for {architecture!r}; supported architectures are {sorted(validated_architectures)}. Other model workflows may require an all-reduce after A2A combine. Use --moe-a2a-backend deepep.","messagePattern":"DeepEP v2 MoE is not validated for (.+?); supported architectures are (.+?)\\. Other model workflows may require an all-reduce after A2A combine\\. Use --moe-a2a-backend deepep\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/server_args.py","lineNumber":7614,"sourceCode":"                \"DeepEP v2 MoE cannot validate a model loaded through an instance \"\n                \"connector. Load it from a model path or use \"\n                \"--moe-a2a-backend deepep.\"\n            )\n\n        architectures = (\n            getattr(self.get_model_config().hf_config, \"architectures\", None) or []\n        )\n\n        architecture = architectures[0] if architectures else None\n        # These architectures take the A2A MoE path and skip post-expert\n        # all-reduce.\n        validated_architectures = (\n            \"DeepseekV3ForCausalLM\",\n            \"DeepseekV4ForCausalLM\",\n            \"Qwen3MoeForCausalLM\",\n        )\n        if architecture not in validated_architectures:\n            raise ValueError(\n                f\"DeepEP v2 MoE is not validated for {architecture!r}; supported \"\n                f\"architectures are {sorted(validated_architectures)}. \"\n                \"Other model workflows may require an all-reduce after A2A \"\n                \"combine. Use --moe-a2a-backend deepep.\"\n            )\n\n    def _validate_deepep_v2_speculative_draft(self) -> None:\n        \"\"\"Reject an explicit or inherited DeepEP v2 draft backend.\"\"\"\n        view = resolved_view(self)\n        draft_backend = view.speculative_moe_a2a_backend\n        if draft_backend is None and view.speculative_algorithm:\n            from sglang.srt.speculative.spec_info import SpeculativeAlgorithm\n\n            algorithm = SpeculativeAlgorithm.from_string(view.speculative_algorithm)\n            if not algorithm.is_ngram():\n                draft_backend = view.moe_a2a_backend\n        if draft_backend == \"deepep_v2\":\n            raise ValueError(","sourceCodeStart":7596,"sourceCodeEnd":7632,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/server_args.py#L7596-L7632","documentation":"Raised during server-args resolution when --moe-a2a-backend deepep_v2 is used with a model architecture outside the validated set (DeepseekV3ForCausalLM, DeepseekV4ForCausalLM, Qwen3MoeForCausalLM). DeepEP v2's low-latency buffer/combine path is only validated on those models; other workflows may miss the all-reduce after A2A combine and produce incorrect results.","triggerScenarios":"Launching the server with --moe-a2a-backend deepep_v2 where config.json architectures[] contains something like LlamaForCausalLM, MixtralForCausalLM, or any MoE arch not in the validated tuple.","commonSituations":"Switching an existing serving stack to deepep_v2 for perf gains on a non-DeepSeek/Qwen MoE model; using a fine-tuned/custom checkpoint with a renamed architecture string.","solutions":["Switch to --moe-a2a-backend deepep (v1), which supports the broader set of models","Use a DeepseekV3/V4 or Qwen3MoE checkpoint with deepep_v2","Remove --moe-a2a-backend deepep_v2 and let the default a2a backend run"],"exampleFix":"# before\npython -m sglang.launch_server --model mistralai/Mixtral-8x7B-Instruct --moe-a2a-backend deepep_v2\n# after\npython -m sglang.launch_server --model mistralai/Mixtral-8x7B-Instruct --moe-a2a-backend deepep","handlingStrategy":"validation","validationCode":"from transformers import AutoConfig\nVALID = {\"DeepseekV3ForCausalLM\",\"DeepseekV4ForCausalLM\",\"Qwen3MoeForCausalLM\"}\narch = AutoConfig.from_pretrained(model).architectures[0]\nif a2a_backend == \"deepep_v2\" and arch not in VALID:\n    a2a_backend = \"deepep\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check config.json architectures before selecting deepep_v2","Pin deepep (v1) in shared launch scripts for heterogeneous model fleets"],"tags":["moe","deepep","a2a-backend","server-args","model-architecture"],"backgroundTag":"unsupported-configuration-combo","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}