diff --git a/python/sglang/srt/models/qwen3_vl_moe.py b/python/sglang/srt/models/qwen3_vl_moe.py index e810dae7e..e3e9e07d1 100644 --- a/python/sglang/srt/models/qwen3_vl_moe.py +++ b/python/sglang/srt/models/qwen3_vl_moe.py @@ -22,6 +22,7 @@ import torch import torch.nn as nn from sglang.srt.configs.qwen3_vl import Qwen3VLMoeConfig, Qwen3VLMoeTextConfig +from sglang.srt.eplb.expert_location import ModelConfigForExpertLocation from sglang.srt.layers.moe.fused_moe_triton.layer import FusedMoE from sglang.srt.layers.quantization.base_config import QuantizationConfig from sglang.srt.model_executor.forward_batch_info import ForwardBatch, PPProxyTensors @@ -326,5 +327,13 @@ class Qwen3VLMoeForConditionalGeneration(Qwen3VLForConditionalGeneration): # if isinstance(self.model.layers[layer_id].mlp, Qwen3MoeSparseMoeBlock) # } + @classmethod + def get_model_config_for_expert_location(cls, config): + return ModelConfigForExpertLocation( + num_layers=config.text_config.num_hidden_layers, + num_logical_experts=config.text_config.num_experts, + num_groups=None, + ) + EntryClass = Qwen3VLMoeForConditionalGeneration