Skip to content

[Ascend]Support qwen3.5#18544

Merged
sglang-npu-bot merged 5 commits intosgl-project:mainfrom
chenxu214:dev_qwen35
Feb 12, 2026
Merged

[Ascend]Support qwen3.5#18544
sglang-npu-bot merged 5 commits intosgl-project:mainfrom
chenxu214:dev_qwen35

Conversation

@chenxu214
Copy link
Copy Markdown
Contributor

@chenxu214 chenxu214 commented Feb 10, 2026

Motivation

Ascend adapts qwen3.5

Modifications

1、Bugfix with load weights: issue
2、The quantization and import kernel error reporting parts have been modified accordingly.

Accuracy Tests

image

Benchmarking and Profiling

python -m sglang.launch_server
--model-path $MODELPATH
--host ${MIX_IP[$i]} --port 6699
--tp-size 16
--quantization modelslim
--nnodes 1 --node-rank $i
--attention-backend ascend
--mem-fraction-static 0.85
--max-running-requests 16
--watchdog-timeout 3600
--disable-radix-cache
--max-prefill-tokens 16384
--max-total-tokens 120000
--chunked-prefill-size -1
--mamba-ssm-dtype bfloat16
--cuda-graph-bs 1 2 4 8 12 16
--enable-multimodal
--mm-attention-backend ascend_attn
--dtype bfloat16

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. 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.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @chenxu214, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces initial support for the Qwen3.5 model, specifically targeting Ascend NPU environments. The changes involve adapting the attention backend to recognize and operate correctly on NPUs, refining the quantization process to handle model-specific prefixing, and updating the Qwen3.5 model's internal component naming for MLP layers to ensure accurate configuration.

Highlights

  • NPU Compatibility for Attention Backend: Conditional imports and assertions in hybrid_linear_attn_backend.py were updated to explicitly include NPU devices, ensuring proper functionality of attention mechanisms on Ascend NPUs.
  • Quantization Description Adaptation: The modelslim.py file was modified to preprocess quantization descriptions by removing "language_model." and "model." prefixes, which likely improves compatibility for various model architectures, including Qwen3.5.
  • Qwen3.5 MLP Prefix Correction: The qwen3_5.py model definition was adjusted to replace .self_attn with .linear_attn when constructing MLP prefixes, aligning with the specific naming conventions or architecture of the Qwen3.5 model.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • python/sglang/srt/layers/attention/hybrid_linear_attn_backend.py
    • Extended import conditions to include NPU devices for cutedsl_fused_sigmoid_gating_delta_rule_update.
    • Modified assertion conditions to account for NPU devices when checking conv_states_shape.
  • python/sglang/srt/layers/quantization/modelslim/modelslim.py
    • Implemented a loop to clean up quant_description prefixes by removing "language_model." and "model." for visual models.
  • python/sglang/srt/models/qwen3_5.py
    • Updated the add_prefix function calls for MLP layers to replace .self_attn with .linear_attn in the prefix string.
Activity
  • No specific activity or comments have been recorded for this pull request yet, beyond its initial creation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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 adds support for qwen3.5 on Ascend NPUs. The changes correctly adjust import paths and logic to be compatible with NPU devices. I've found one area for improvement in python/sglang/srt/layers/quantization/modelslim/modelslim.py where a method has side effects and is inefficient. I've suggested a fix to address this. Other changes look good.

Comment thread python/sglang/srt/layers/quantization/modelslim/modelslim.py Outdated
@iforgetmyname
Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

Comment thread python/sglang/srt/models/qwen3_5.py
@sglang-npu-bot sglang-npu-bot merged commit 1edc69b into sgl-project:main Feb 12, 2026
53 of 61 checks passed
Johnsonms pushed a commit to Johnsonms/sglang that referenced this pull request Feb 14, 2026
This PR affects only the NPU. If any issues arise, please contact iforgetmyname.
magicYang1573 pushed a commit to magicYang1573/sglang that referenced this pull request Mar 9, 2026
This PR affects only the NPU. If any issues arise, please contact iforgetmyname.
@ssshinigami
Copy link
Copy Markdown
Contributor

We faced a fail with Radix cache. Did you test with enable Radix cache?

Wangzheee pushed a commit to Wangzheee/sglang that referenced this pull request Mar 21, 2026
This PR affects only the NPU. If any issues arise, please contact iforgetmyname.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants