Repository navigation
fix(qwen3): apply configured RoPE scaling - #1398
Merged
Merged
Conversation
Resolve the parsed rope_scaling block once and propagate linear scales or frequency tables through dense, MoE, batched, tensor-parallel, and pipeline construction paths. Frequency-table schemes bypass the fused launcher, while linear scaling remains fused and is checked against the graph implementation. Add focused constructor, scaling, batched, warning-deduplication, distributed, and fused-kernel regression coverage. Refs #1388
Record checkpoint labels in the direct, pipeline, tensor-parallel, and MiniCPM-o Qwen3 loaders so warning deduplication cannot silence a later model that declares the same unsupported RoPE scheme. Preserve the diagnostic label through tensor-parallel argument cloning and cover dense and MoE label selection in focused tests. Refs #1388
Add a branch-scoped Apple Silicon workflow that compares the issue-specified Qwen3 checkpoints against origin/main and validates an injected 2201-token linear-scaling config against pinned mlx-lm. This workflow is temporary validation instrumentation and will be removed after its hosted run reaches a terminal result. Refs #1388
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
* fix(qwen3): apply configured RoPE scaling Resolve the parsed rope_scaling block once and propagate linear scales or frequency tables through dense, MoE, batched, tensor-parallel, and pipeline construction paths. Frequency-table schemes bypass the fused launcher, while linear scaling remains fused and is checked against the graph implementation. Add focused constructor, scaling, batched, warning-deduplication, distributed, and fused-kernel regression coverage. Refs lablup#1388 * fix(qwen3): key RoPE warnings by checkpoint Record checkpoint labels in the direct, pipeline, tensor-parallel, and MiniCPM-o Qwen3 loaders so warning deduplication cannot silence a later model that declares the same unsupported RoPE scheme. Preserve the diagnostic label through tensor-parallel argument cloning and cover dense and MoE label selection in focused tests. Refs lablup#1388 * ci(qwen3): run one-off real-model validation Add a branch-scoped Apple Silicon workflow that compares the issue-specified Qwen3 checkpoints against origin/main and validates an injected 2201-token linear-scaling config against pinned mlx-lm. This workflow is temporary validation instrumentation and will be removed after its hosted run reaches a terminal result. Refs lablup#1388 * fix(ci): parse Qwen3 generation output * fix(ci): pin Qwen3 validation Python * fix(ci): provision validation Python with uv * fix(ci): allow full Qwen3 MoE validation * chore(ci): remove one-off Qwen3 validation * docs(qwen3): record RoPE scaling validation
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.
Summary
rope_scalingonce per model and propagate linear position scales or Llama 3 frequency tables to every attention layer.Validation
cargo fmt --all -- --checkcargo test -p mlxcel --profile test-fast --lib qwen3 -- --nocaptureon integrated latestmain(110 passed, 20 existing hardware/large-model tests ignored)cargo clippy -p mlxcel --all-targets -- -D warningsMLX_CUDA_ARCHITECTURES=121 cargo build --release --features cuda --bin mlxcelmodels/mlx/qwen3-4b-4bit: PR and latestmainmatched for 128 greedy tokensmodels/mlx/qwen3-30b-a3b-4bit: PR and latestmainmatched for 128 greedy tokensThe quick. The quick brown fox.), while latestmaindiverged because it ignored the blockNotes
The dense implementation follows upstream mlx-lm's
scaling_configpath. Qwen3-MoE intentionally applies the same config even though current mlx-lm still constructs a plain RoPE module there, matching the issue's documented compatibility decision.The default fused decode path shares the graph path's scale and passes direct numerical parity tests. Cross-runtime generated text can diverge after a shared prefix through the issue's documented f16 reduction-order jitter, so the real-model oracle comparison also selected the graph path used by upstream.
Bilingual qualification details are recorded in
TECHNICAL_REPORTS/1398-qwen3-rope-scaling-20260824.{en,ko}.md.Closes #1388