Skip to content

[NPU]Fix GLM-4.7-Flash failed on NPU#22509

Merged
iforgetmyname merged 6 commits intosgl-project:mainfrom
Todobe:GLM47FLash-fix
Apr 22, 2026
Merged

[NPU]Fix GLM-4.7-Flash failed on NPU#22509
iforgetmyname merged 6 commits intosgl-project:mainfrom
Todobe:GLM47FLash-fix

Conversation

@Todobe
Copy link
Copy Markdown
Contributor

@Todobe Todobe commented Apr 10, 2026

Motivation

GPU op optimizations caused GLM-4.7-Flash to fail when running on the NPU; this PR implements compatibility adjustments to address this issue.

Modifications

  1. glm4_moe_lite.py Only import dsv3_router_gemm when running on GPU
  2. deepseek_v2.py Fixed the case where self lacked the _gfx95_quant_format member variable.

Accuracy Tests

ScreenShot_2026-04-10_163301_050

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the robustness of the DeepSeek-V2 and GLM4-MoE-Lite models. In deepseek_v2.py, a safe attribute access is implemented for _gfx95_quant_format using getattr. In glm4_moe_lite.py, the dsv3_router_gemm import is moved inside a CUDA-specific conditional block to prevent import errors on non-CUDA environments. I have no feedback to provide.

@iforgetmyname
Copy link
Copy Markdown
Collaborator

/tag-run-ci-label

@iforgetmyname iforgetmyname merged commit 92f28e9 into sgl-project:main Apr 22, 2026
144 of 194 checks passed
zhangying098 pushed a commit to zhangying098/sglang that referenced this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants