Skip to content

Fix Qwen3 model conversion perplexity issue#2

Draft
hawkoli1987 wants to merge 1 commit into
feat/qwen3-supportfrom
cursor/fix-qwen3-model-conversion-perplexity-issue-be95
Draft

Fix Qwen3 model conversion perplexity issue#2
hawkoli1987 wants to merge 1 commit into
feat/qwen3-supportfrom
cursor/fix-qwen3-model-conversion-perplexity-issue-be95

Conversation

@hawkoli1987

Copy link
Copy Markdown
Owner

Preserve Qwen3's head-wise QK norms during conversion to fix catastrophic perplexity increase.

Qwen3 models apply per-head RMSNorm (q_norm/k_norm) after the q_proj/k_proj layers. The original conversion pipeline discarded these modules, leading to unnormalized Q/K activations and incorrect dot product scaling, which caused the observed multi-order-of-magnitude perplexity regression. This PR ensures these norms are preserved and applied correctly throughout the conversion process.


Open in Cursor Open in Web

Preserve and apply Qwen3's q_norm/k_norm for accurate MLA conversion.

Co-authored-by: yuli <yuli@aisingapore.org>
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.

2 participants