{"record":{"id":"017593dbb6f9ce07","repo":"sgl-project/sglang","slug":"the-hpc-ops-moe-runner-backend-does-not-support-mo","errorCode":null,"errorMessage":"The hpc_ops MoE runner backend does not support MoE GEMM biases (w13_weight_bias / w2_weight_bias); use another --moe-runner-backend for this model.","messagePattern":"The hpc_ops MoE runner backend does not support MoE GEMM biases \\(w13_weight_bias / w2_weight_bias\\); use another --moe-runner-backend for this model\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/layers/quantization/fp8.py","lineNumber":2226,"sourceCode":"                    \"'static' in the checkpoint quantization config).\"\n                )\n            layer.hpc_ops_gate_up_alphas = (\n                layer.w13_weight_scale.data.float() * layer.w13_input_scale.data.float()\n            )\n            layer.hpc_ops_down_alphas = (\n                layer.w2_weight_scale.data.float() * layer.w2_input_scale.data.float()\n            )\n\n    def _get_hpc_ops_quant_info(self, layer: torch.nn.Module):\n        from sglang.srt.layers.moe.moe_runner.hpc_ops import HpcOpsMoeQuantInfo\n\n        # The HPC-Ops fused kernels take no per-expert GEMM bias; refuse\n        # instead of silently dropping it.\n        if (\n            getattr(layer, \"w13_weight_bias\", None) is not None\n            or getattr(layer, \"w2_weight_bias\", None) is not None\n        ):\n            raise ValueError(\n                \"The hpc_ops MoE runner backend does not support MoE GEMM \"\n                \"biases (w13_weight_bias / w2_weight_bias); use another \"\n                \"--moe-runner-backend for this model.\"\n            )\n\n        if self.block_quant:\n            return HpcOpsMoeQuantInfo(\n                w13_weight=layer.w13_weight,\n                w2_weight=layer.w2_weight,\n                block_quant=True,\n                global_num_experts=int(layer.num_experts),\n                moe_ep_rank=int(layer.moe_ep_rank),\n                w13_weight_scale_inv=layer.hpc_ops_w13_weight_scale,\n                w2_weight_scale_inv=layer.hpc_ops_w2_weight_scale,\n                block_shape=self.quant_config.weight_block_size,\n            )\n        else:\n            return HpcOpsMoeQuantInfo(","sourceCodeStart":2208,"sourceCodeEnd":2244,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/layers/quantization/fp8.py#L2208-L2244","documentation":"The fused hpc_ops MoE kernels accept no per-expert GEMM bias, so if the model defines w13_weight_bias or w2_weight_bias, _get_hpc_ops_quant_info refuses to run rather than silently dropping the bias and producing wrong outputs.","triggerScenarios":"Applying the Fp8MoEMethod forward path with runner_backend.is_hpc_ops() on a model whose MoE layers carry weight biases (some GPT-NeoX/Qwen-style or fine-tuned checkpoints include MoE biases).","commonSituations":"Selecting --moe-runner-backend=hpc_ops for a model architecture with MoE biases; mixing fused-kernel backends with bias-bearing checkpoints.","solutions":["Switch --moe-runner-backend to auto, triton, or another backend that supports biases","Remove/strip MoE biases via re-quantization if the model tolerates it (usually it doesn't)","Keep hpc_ops only for bias-free models like standard DeepSeek FP8"],"exampleFix":"# before\n--moe-runner-backend hpc_ops  # model has w13_weight_bias\n# after\n--moe-runner-backend auto","handlingStrategy":"type-guard","validationCode":"has_bias = getattr(layer, \"w13_weight_bias\", None) is not None or getattr(layer, \"w2_weight_bias\", None) is not None\nif has_bias and args.moe_runner_backend == \"hpc_ops\":\n    args.moe_runner_backend = \"auto\"  # bias-bearing model needs another backend","typeGuard":"def moe_bias_free(layer) -> bool:\n    return getattr(layer, \"w13_weight_bias\", None) is None and getattr(layer, \"w2_weight_bias\", None) is None","tryCatchPattern":null,"preventionTips":["Probe for MoE weight biases before pinning fused backends","Default to --moe-runner-backend auto except on validated models"],"tags":["quantization","moe","moe-runner-backend","unsupported-feature"],"backgroundTag":"backend-unsupported-model-feature","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}