From 871c6482037ea5a968495bd937de1c7e6cb4a931 Mon Sep 17 00:00:00 2001 From: McZyWu Date: Thu, 16 Jul 2026 09:16:57 +0800 Subject: [PATCH] [NPU]revert add scoring func for GLM 4.7 Flash (#31388) --- python/sglang/srt/hardware_backend/npu/moe/topk.py | 2 +- python/sglang/srt/models/glm4_moe_lite.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/python/sglang/srt/hardware_backend/npu/moe/topk.py b/python/sglang/srt/hardware_backend/npu/moe/topk.py index 5c255af57..9aef68476 100644 --- a/python/sglang/srt/hardware_backend/npu/moe/topk.py +++ b/python/sglang/srt/hardware_backend/npu/moe/topk.py @@ -97,7 +97,7 @@ def fused_topk_npu( group_select_mode=(1 if use_grouped_topk else 0), renorm=0, # 1 for sigmoid, 0 for softmax - norm_type=(0 if topk_config.scoring_func == "softmax" else 1), + norm_type=1, routed_scaling_factor=( topk_config.routed_scaling_factor if topk_config.apply_routed_scaling_factor_on_output diff --git a/python/sglang/srt/models/glm4_moe_lite.py b/python/sglang/srt/models/glm4_moe_lite.py index 750117f9d..c650585a5 100644 --- a/python/sglang/srt/models/glm4_moe_lite.py +++ b/python/sglang/srt/models/glm4_moe_lite.py @@ -225,7 +225,6 @@ class Glm4MoeLiteSparseMoeBlock(nn.Module): quant_config=quant_config, routed_scaling_factor=self.routed_scaling_factor, prefix=add_prefix("experts", prefix), - **({"scoring_func": "sigmoid"}), ) self.topk = TopK(