{"record":{"id":"b020648e131a94a5","repo":"sgl-project/sglang","slug":"the-hpc-ops-moe-runner-backend-does-not-support-fu","errorCode":null,"errorMessage":"The hpc_ops MoE runner backend does not support fused shared experts.","messagePattern":"The hpc_ops MoE runner backend does not support fused shared experts\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/moe/moe_runner/hpc_ops.py","lineNumber":103,"sourceCode":"    w13_weight_scale_inv: Optional[torch.Tensor] = None\n    w2_weight_scale_inv: Optional[torch.Tensor] = None\n    block_shape: Optional[List[int]] = None\n    # Per-tensor path\n    gate_up_alphas: Optional[torch.Tensor] = None\n    down_alphas: Optional[torch.Tensor] = None\n    w13_input_scale: Optional[torch.Tensor] = None\n    w2_input_scale: Optional[torch.Tensor] = None\n\n\ndef _check_runner_config_supported(runner_config: MoeRunnerConfig) -> None:\n    if runner_config.activation != \"silu\" or not runner_config.is_gated:\n        raise ValueError(\n            \"The hpc_ops MoE runner backend only supports the gated silu \"\n            f\"activation, got activation={runner_config.activation}, \"\n            f\"is_gated={runner_config.is_gated}.\"\n        )\n    if runner_config.num_fused_shared_experts != 0:\n        raise ValueError(\n            \"The hpc_ops MoE runner backend does not support fused shared experts.\"\n        )\n    if runner_config.apply_router_weight_on_input:\n        raise ValueError(\n            \"The hpc_ops MoE runner backend does not support \"\n            \"apply_router_weight_on_input.\"\n        )\n    if runner_config.no_combine:\n        raise ValueError(\n            \"The hpc_ops MoE runner backend does not support no_combine \"\n            \"(the fused kernel always reduces over top-k experts).\"\n        )\n    if (\n        runner_config.gemm1_alpha is not None\n        or runner_config.gemm1_clamp_limit is not None\n        or runner_config.swiglu_limit is not None\n    ):\n        raise ValueError(","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/moe/moe_runner/hpc_ops.py#L85-L121","documentation":"The hpc_ops MoE runner backend in SGLang does not implement fused shared experts (num_fused_shared_experts). The _check_runner_config_supported validation raises this ValueError when the runner config requests fused shared experts while --moe-runner-backend hpc_ops is selected.","triggerScenarios":"Running a model whose MoE layer sets num_fused_shared_experts != 0 (e.g. DeepSeek-V3-style models with fused shared expert projection) together with --moe-runner-backend hpc_ops; the fused_experts_none_to_hpc_ops fused-func path runs the config check on first MoE invocation.","commonSituations":"Switching a shared-expert-fused checkpoint (DeepSeek V2/V3 family) to the hpc_ops backend; enabling shared-expert fusion flags or a server args preset that turns on num_fused_shared_experts.","solutions":["Switch back to the default/triton MoE runner backend (remove --moe-runner-backend hpc_ops)","Disable shared-expert fusion so num_fused_shared_experts == 0 for this model","Use a model without fused shared experts with hpc_ops"],"exampleFix":"# before\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V3 --moe-runner-backend hpc_ops\n# after\npython -m sglang.launch_server --model deepseek-ai/DeepSeek-V3 --moe-runner-backend triton","handlingStrategy":"validation","validationCode":"from sglang.srt.layers.moe.utils import MoeRunnerBackend\nbackend = server_args.moe_runner_backend\nif backend == MoeRunnerBackend.HPC_OPS and model_config.num_fused_shared_experts != 0:\n    raise SystemExit(\"hpc_ops does not support fused shared experts; use triton\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check model config for num_fused_shared_experts before selecting hpc_ops","Keep per-model server-arg presets instead of reusing one script across model families"],"tags":["sglang","moe","hpc-ops","shared-experts","config-validation"],"backgroundTag":"unsupported-backend-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}