Skip to content
4 changes: 2 additions & 2 deletions python/sglang/srt/models/glm4_moe_lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
from sglang.srt.models.deepseek_common.deepseek_weight_loader import (
DeepseekV2WeightLoaderMixin,
)
from sglang.srt.models.deepseek_common.utils import _is_cuda, _use_aiter
from sglang.srt.models.deepseek_common.utils import _is_cuda, _is_xpu, _use_aiter
from sglang.srt.models.deepseek_v2 import DeepseekV2AttentionMLA
from sglang.srt.runtime_context import get_exec, get_parallel, get_stream
from sglang.srt.utils import (
Expand Down Expand Up @@ -354,7 +354,7 @@ def forward_normal(
topk_output = self.topk.empty_topk_output(hidden_states.device)

final_hidden_states = self.experts(hidden_states, topk_output)
if not _is_cuda and not _use_aiter:
if not _is_cuda and not _is_xpu and not _use_aiter:
final_hidden_states *= self.routed_scaling_factor
if shared_output is not None:
with use_symmetric_memory(
Expand Down
41 changes: 41 additions & 0 deletions test/registered/xpu/llm_models/test_xpu_glm_4_7_flash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""GLM-4.7-Flash GSM8K accuracy on Intel XPU (TP=4).

Scored by sgl-eval's ``gsm8k`` benchmark with the GLM-4.7-Flash cookbook
sampling settings.
"""

import unittest

from sglang.test.ci.ci_register import register_xpu_ci
from sglang.test.test_utils import CustomTestCase
from sglang.test.xpu.simple_eval_gsm8k_xpu_mixin import SimpleEvalGSM8KXPUMixin

register_xpu_ci(est_time=2400, suite="nightly-xpu-kernel-main-4-gpu", nightly=True)


class TestGLM4_7FlashXPU(SimpleEvalGSM8KXPUMixin, CustomTestCase):
model = "zai-org/GLM-4.7-Flash"
tp_size = 4
# 3 runs on 4x B60 scored 0.80-0.90; one question of margin below the lowest.
accuracy = 0.75
timeout_for_server_launch = 3600
num_examples = 20
num_threads = 4
# Cookbook sampling; the chat template thinks by default.
temperature = 0.7
top_p = 0.95
max_tokens = 2048

other_args = SimpleEvalGSM8KXPUMixin.other_args + [
"--reasoning-parser",
"glm45",

@arathi-hlab arathi-hlab Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you confirm sgl-eval is used ? if yes so please collect the number based on that rest is LGTM

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it uses sgl-eval. SimpleEvalGSM8KXPUMixin calls run_sgl_eval(eval_name="gsm8k") (simple_eval_gsm8k_xpu_mixin.py:110), and each run logs sgl-eval gsm8k generation: {'max_tokens': 2048, 'temperature': 0.7, 'top_p': 0.95, ...}. The numbers in the description are from sgl-eval: three runs at 20 questions on 4x B60 scored 0.85, 0.80 and 0.90 (threshold 0.75), and an earlier 50-question run scored 0.90.

"--mem-fraction-static",
"0.85",
# More concurrent requests lose the device on Arc Pro B60.
"--max-running-requests",
"4",
]


if __name__ == "__main__":
unittest.main()
Loading