From 49109d42677d98f2ad19ec815cf05c9cc3448bc3 Mon Sep 17 00:00:00 2001 From: Yuwei An Date: Tue, 7 Jul 2026 18:17:52 -0700 Subject: [PATCH] [Tiny] Fix Import Error for Pure TP config with flashinfer_mxfp4 (#30426) Co-authored-by: Claude Opus 4.8 --- python/sglang/srt/layers/moe/moe_runner/runner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/sglang/srt/layers/moe/moe_runner/runner.py b/python/sglang/srt/layers/moe/moe_runner/runner.py index 69d979f0c..b237c0cb6 100644 --- a/python/sglang/srt/layers/moe/moe_runner/runner.py +++ b/python/sglang/srt/layers/moe/moe_runner/runner.py @@ -65,6 +65,11 @@ class MoeRunner: self.runner_core = None # FlashInfer CUTLASS only supports fused path elif runner_backend.is_flashinfer_mxfp4(): self.runner_core = None # FlashInfer MXFP4 only supports fused path + # Import flashinfer_cutlass here (not at module top, to avoid a circular + # import) to register the flashinfer_mxfp4 fused func before the pool lookup. + from sglang.srt.layers.moe.moe_runner import ( # noqa: F401 + flashinfer_cutlass, + ) elif runner_backend.is_cutlass(): self.runner_core = None # CUTLASS uses the direct cutlass_moe_fp4 path else: