Skip to content

fix: honor YaRN scaling for Qwen3.5 MRoPE - #1582

Merged
shihaobai merged 1 commit into
mainfrom
bsh/fix_yarn
Sep 18, 2026
Merged

shihaobai merged 1 commit into
mainfrom
bsh/fix_yarn

Conversation

@shihaobai

@shihaobai shihaobai commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Qwen3.5-27B configurations containing both mrope_section and rope_type: yarn currently take the default rotary path, silently applying linear scaling instead of YaRN. Respect the explicit RoPE scaling type while retaining the multimodal position layout.

Compute YaRN frequencies using head_dim * partial_rotary_factor, store the half-width cache consumed by the rotary kernels, and apply magnitude scaling in FP32 before casting to the model dtype.

@shihaobai
shihaobai merged commit f538475 into main Sep 18, 2026
1 check passed
@shihaobai
shihaobai deleted the bsh/fix_yarn branch September 18, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant