{"record":{"id":"e7a57fc187b078bf","repo":"sgl-project/sglang","slug":"native-mxfp8-moe-only-supports-gated-swiglu-oai-g","errorCode":null,"errorMessage":"native MXFP8 MoE only supports gated swiglu-oai, got {activation=} {is_gated=}.","messagePattern":"native MXFP8 MoE only supports gated swiglu-oai, got (.+?) (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"python/sglang/kernels/ops/moe/mxfp8_moe_amd_gfx95.py","lineNumber":392,"sourceCode":"    no_combine: bool = False,\n    inplace: bool = False,\n    apply_router_weight_on_input: bool = False,\n    routed_scaling_factor: Optional[float] = None,\n    gemm1_alpha: Optional[float] = None,\n    gemm1_limit: Optional[float] = None,\n    swiglu_limit: Optional[float] = None,\n    gate_up_interleaved: bool = True,\n    expert_map: Optional[torch.Tensor] = None,\n) -> torch.Tensor:\n    \"\"\"Native MXFP8 MoE entry (CDNA4 ``dot_scaled``).\n\n    Keeps the SGLang ``fused_experts_mxfp8`` call contract but routes to the\n    single grouped-GEMM kernel. Only the MiniMax-M3 SwiGLU-OAI (split,\n    uninterleaved, gated silu with ``gemm1_alpha``/``gemm1_limit``) configuration\n    is supported -- the unsupported cases below never occur on the M3 path.\n    \"\"\"\n    if not (activation == \"silu\" and is_gated):\n        raise NotImplementedError(\n            f\"native MXFP8 MoE only supports gated swiglu-oai, got \"\n            f\"{activation=} {is_gated=}.\"\n        )\n    if b1 is not None or b2 is not None:\n        raise NotImplementedError(\"native MXFP8 MoE does not support expert bias.\")\n    if apply_router_weight_on_input:\n        raise NotImplementedError(\n            \"native MXFP8 MoE does not support apply_router_weight_on_input.\"\n        )\n    if gate_up_interleaved:\n        raise NotImplementedError(\n            \"native MXFP8 MoE expects uninterleaved (split) gate/up layout.\"\n        )\n\n    # SwiGLU-OAI default activation alpha (gpt-oss); M3 may override via gemm1_alpha.\n    alpha = 1.702 if gemm1_alpha is None else float(gemm1_alpha)\n    beta = 1.0\n    limit = None if gemm1_limit is None else float(gemm1_limit)","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/kernels/ops/moe/mxfp8_moe_amd_gfx95.py#L374-L410","documentation":"NotImplementedError from the AMD gfx95 native MXFP8 grouped-GEMM MoE: the single fused kernel hard-codes the MiniMax-M3 SwiGLU-OAI configuration (gated silu with gemm1_alpha/gemm1_limit). Any other activation or a non-gated MLP is rejected because no kernel variant exists for it.","triggerScenarios":"Calling fused_experts_mxfp8 with activation != \"silu\" or is_gated=False, e.g. wiring a gelu-based or ungated MLP model onto this ROCm path.","commonSituations":"Porting a new MXFP8-quantized model to MI300-class hardware; a model config where activation=\"gelu\" or the MLP has no gate; overriding activation flags from config without checking the AMD kernel's supported matrix.","solutions":["Confirm the model actually uses gated silu (SwiGLU); if config says otherwise, this path cannot serve it","Route the model to the generic Triton fused-MoE path instead of the native MXFP8 AMD kernel","If you control the kernel, add support for the needed activation in the grouped-GEMM epilogue"],"exampleFix":"// before\nfused_experts_mxfp8(..., activation=\"gelu\", is_gated=False)\n// after\n# use the generic triton path for non-swiglu models\nout = fused_experts_triton(..., activation=\"gelu\", is_gated=False)","handlingStrategy":"validation","validationCode":"assert activation == \"silu\" and is_gated, \"native MXFP8 AMD path requires gated silu\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate the native AMD path on a model-support matrix checked at load time","Default unknown models to the Triton fused path"],"tags":["moe","mxfp8","rocm","not-implemented","activation"],"backgroundTag":"unsupported-quantized-moe-config","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}