[AMD] Fix/qwen3 5 amd rope cutedsl fallback#18753
Merged
HaiShaw merged 2 commits intosgl-project:mainfrom Feb 15, 2026
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Collaborator
|
/tag-and-rerun-ci |
HaiShaw
approved these changes
Feb 14, 2026
Collaborator
|
@zju-stu-lizheng @hebiao064 Please have a review on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.