sgl-project/sglang · error · Exception
unsupported mode
Error message
unsupported mode
What it means
DeepEP dispatcher's classmethod set_dispatch_mode routes only two modes — low-latency and normal — and raises a bare Exception for anything else. Since DeepEPMode should always be one of these (AUTO resolves earlier), hitting this indicates an out-of-sync or corrupted enum value, a custom mode, or a stale DeepEPMode across versions. Called during CUDA-graph capture and replay.
Source
Thrown at python/sglang/srt/layers/moe/token_dispatcher/deepep.py:331
@classmethod
def set_dispatch_mode_as_normal(cls):
cls._state().dispatch_mode = DeepEPDispatchMode.NORMAL
@classmethod
def set_dispatch_mode_as_low_latency(cls):
state = cls._state()
if state.dispatch_mode == DeepEPDispatchMode.NORMAL:
cls.clean_buffer()
state.dispatch_mode = DeepEPDispatchMode.LOW_LATENCY
@classmethod
def set_dispatch_mode(cls, mode: DeepEPMode):
if mode.is_low_latency():
cls.set_dispatch_mode_as_low_latency()
elif mode.is_normal():
cls.set_dispatch_mode_as_normal()
else:
raise Exception("unsupported mode")
class DeepEPConfig(BaseDispatcherConfig):
_instance = None
def __init__(self):
config_str = get_deepep_config()
if config_str:
config_parsed = load_json_config(config_str)
if torch.distributed.get_rank() == 0:
logger.info(f"Use DeepEP Config: {config_parsed}")
config_dispatch = config_parsed["normal_dispatch"]
config_combine = config_parsed["normal_combine"]
self.normal_dispatch_config = Config(**config_dispatch)
self.normal_combine_config = Config(**config_combine)
assert config_dispatch["num_sms"] == config_combine["num_sms"]View on GitHub (pinned to 0132848349)
Solutions
- Upgrade/align to a single SGLang version so DeepEPMode enum and dispatcher match
- Ensure the mode passed is a resolved DeepEPMode.NORMAL or LOW_LATENCY (resolve AUTO before capture)
- If you maintain a custom mode, extend set_dispatch_mode to handle it instead of relying on upstream
Example fix
# before DeepEPTokenDispatcher.set_dispatch_mode(DeepEPMode.AUTO) # raises 'unsupported mode' # after DeepEPTokenDispatcher.set_dispatch_mode(deepep_mode.resolve(is_extend_in_batch))
Defensive patterns
Strategy: validation
Validate before calling
from sglang.srt.layers.moe.token_dispatcher.deepep import DeepEPMode m = deepep_mode.resolve(is_extend_in_batch) if deepep_mode == DeepEPMode.AUTO else deepep_mode assert m in (DeepEPMode.NORMAL, DeepEPMode.LOW_LATENCY)
Prevention
- Always resolve AUTO modes before CUDA-graph capture/replay
- Pin a single SGLang version across the process to avoid enum skew
When it happens
Trigger: Invoking DeepEPTokenDispatcher.set_dispatch_mode(mode) with a DeepEPMode that is neither .is_low_latency() nor .is_normal() — e.g. an AUTO value that wasn't resolved, or a custom/int enum from a different SGLang version mixed into a pickle/graph capture path.
Common situations: CUDA graph capture with a stale dispatcher class state after upgrading SGLang mid-checkpoint; monkey-patched or custom DeepEPMode subclasses; mixed-version imports in the same process.
Related errors
- Invalid deepep_mode: {self.deepep_mode}
- DeepEP returned FP8 input while Humming is configured for BF
- Humming expected DeepEP FP8 hidden states and group-128 scal
- Unsupported ascend_dispatcher_output_dtype: {self.ascend_dis
- DeepEP is not installed. Please install DeepEP package from
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/88c7ee573005d4b0.
Report an issue: GitHub.