Skip to content

[AMD] Fix/qwen3 5 amd rope cutedsl fallback#18753

Merged
HaiShaw merged 2 commits intosgl-project:mainfrom
andyluo7:fix/qwen3-5-amd-rope-cutedsl-fallback
Feb 15, 2026
Merged

[AMD] Fix/qwen3 5 amd rope cutedsl fallback#18753
HaiShaw merged 2 commits intosgl-project:mainfrom
andyluo7:fix/qwen3-5-amd-rope-cutedsl-fallback

Conversation

@andyluo7
Copy link
Contributor

Motivation

This PR fixes two startup failures encountered when serving Qwen 3.5 MoE on AMD ROCm:

RoPE config parsing failure in Qwen3.5:
Some checkpoints provide RoPE settings in text_config.rope_parameters.
In current Qwen3_5TextConfig init, these values can be lost, leading to:
ValueError: Unknown RoPE scaling type
ROCm import-time failure in hybrid linear attention backend:
hybrid_linear_attn_backend.py unconditionally imports CuTe DSL kernel code.
CuTe DSL depends on cuda.bindings (CUDA-specific), unavailable on ROCm.
This causes:
ModuleNotFoundError: No module named 'cuda'

Modifications

qwen3_5.py
In Qwen3_5TextConfig.init:
Read rope_parameters from kwargs.
If rope_scaling is not set, populate it from rope_parameters before parent init.
Ensure both self.rope_scaling and self.rope_parameters are populated and consistent for downstream compatibility.

hybrid_linear_attn_backend.py
Make CuTe DSL import optional with try/except ModuleNotFoundError.
If SGLANG_USE_CUTEDSL_GDN_DECODE=1 but CuTe deps are unavailable, log a fallback message and use the existing non-CuTe FLA decode kernel instead of failing.

Accuracy Tests

No kernel math or model forward computation logic was changed.
Changes are limited to:
config normalization (rope_parameters/rope_scaling mapping)
backend import/fallback behavior
Therefore, no expected accuracy delta.

Validation performed:

Confirmed Qwen3_5MoeTextConfig(**text_config) now preserves:
rope_parameters["rope_type"] == "default"
mirrored rope_scaling content
Confirmed the previous RoPE-scaling initialization failure path is removed.

Benchmarking and Profiling

No intended performance optimization in this PR.
CuTe path is still used when available and enabled.
On environments without CuTe dependencies (e.g., ROCm), this PR avoids import-time crash and uses existing fallback kernel path.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@HaiShaw
Copy link
Collaborator

HaiShaw commented Feb 14, 2026

/tag-and-rerun-ci

@HaiShaw
Copy link
Collaborator

HaiShaw commented Feb 14, 2026

@zju-stu-lizheng @hebiao064 Please have a review on qwen3_5.py

@HaiShaw HaiShaw merged commit 944a9f6 into sgl-project:main Feb 15, 2026
202 of 221 checks passed
@HaiShaw HaiShaw added the amd label Feb 15, 2026
@HaiShaw HaiShaw changed the title Fix/qwen3 5 amd rope cutedsl fallback [AMD] Fix/qwen3 5 amd rope cutedsl fallback Feb 15, 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.

3 participants