{"record":{"id":"d9a4e4d598dc37d9","repo":"sgl-project/sglang","slug":"the-hpc-ops-moe-runner-backend-does-not-support-ap","errorCode":null,"errorMessage":"The hpc_ops MoE runner backend does not support apply_router_weight_on_input.","messagePattern":"The hpc_ops MoE runner backend does not support apply_router_weight_on_input\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/moe/moe_runner/hpc_ops.py","lineNumber":107,"sourceCode":"    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(\n            \"The hpc_ops MoE runner backend runs a plain SiLU-and-mul; it does \"\n            \"not support gemm1_alpha / gemm1_clamp_limit / swiglu_limit.\"\n        )\n","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/moe/moe_runner/hpc_ops.py#L89-L125","documentation":"The hpc_ops MoE runner backend does not implement apply_router_weight_on_input (multiplying router weights into hidden states before dispatch). _check_runner_config_supported rejects this runner config option because the fused kernel applies routing weights internally.","triggerScenarios":"Loading a model config with apply_router_weight_on_input=true (e.g. some GPT-OSS / Mixtral variants) while --moe-runner-backend hpc_ops is active; check runs when the none->hpc_ops fused-experts path is registered/invoked.","commonSituations":"Enabling hpc_ops for a model whose architecture applies router weights on input; copying server args from a benchmark script to a different model family.","solutions":["Use a different MoE runner backend (triton or the model default)","Use a model that does not set apply_router_weight_on_input","Patch/override the model config to disable the flag only if semantics are understood"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if server_args.moe_runner_backend == 'hpc_ops' and getattr(model_config, 'apply_router_weight_on_input', False):\n    server_args.moe_runner_backend = None  # fall back to default","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate model activation/router flags against the hpc_ops supported set at startup","Log the resolved runner config before launch"],"tags":["sglang","moe","hpc-ops","router-weight","config-validation"],"backgroundTag":"unsupported-backend-configuration","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}