Skip to content

Commit 23f31d4

Browse files
bugfix: fix moe parameter settings for qwen3 moe vl model on mlu device. (#1102)
Co-authored-by: xuetinggogo <xuetinggo@outlook.com>
1 parent d135444 commit 23f31d4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

xllm/models/vlm/qwen3_vl_moe.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ TORCH_MODULE(Qwen3_VLMoeForConditionalGeneration);
196196
REGISTER_INPUT_PROCESSOR(qwen3_vl_moe, Qwen2_5_VLInputProcessor);
197197
REGISTER_CAUSAL_VLM_MODEL(qwen3_vl_moe, Qwen3_VLMoeForConditionalGeneration);
198198
REGISTER_IMAGE_PROCESSOR(qwen3_vl_moe, Qwen2VLImageProcessor);
199+
199200
// register the model args
200201
REGISTER_MODEL_ARGS(qwen3_vl_moe, [&] {
201202
// text config
@@ -257,5 +258,14 @@ REGISTER_MODEL_ARGS(qwen3_vl_moe, [&] {
257258
LOAD_ARG_OR(video_token_id, "video_token_id", 151656);
258259
LOAD_ARG_OR(vision_end_token_id, "vision_end_token_id", 151653);
259260
LOAD_ARG_OR(vision_start_token_id, "vision_start_token_id", 151652);
261+
262+
// arguments to be compatible with other fused moe models
263+
LOAD_ARG_OR(n_routed_experts, "num_experts", 128);
264+
SET_ARG(n_shared_experts, 0);
265+
SET_ARG(scoring_func, "softmax");
266+
SET_ARG(topk_method, "");
267+
SET_ARG(n_group, -1);
268+
SET_ARG(topk_group, 0);
269+
SET_ARG(routed_scaling_factor, 1.0);
260270
});
261271
} // namespace xllm

0 commit comments

Comments
 (0)