← Back to Pull requests

fix(llm): preserve RoPE fields in vLLM scaling overrides #6180

Open
unknown opened this pull request with 234 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 23, 2026 04:25 UTC
Author

Fixes #6179

Explicit rope_scaling replaced the caller’s hf_overrides and could discard Qwen3’s saved rotary base or leave YaRN disabled.

For local Hugging Face checkpoints with one flat RoPE mapping, merge checkpoint fields, caller overrides, then explicit scaling at the root or immediate text_config. On Transformers 4, keep the legacy fields and also set rope_parameters when vLLM derives it before applying overrides.

For checkpoints with a nested text_config, Xinference forwards explicit rope_scaling at the root on vLLM releases before 0.11.1 or when the version is unknown, preserving the typed text config on loaders that apply overrides with config.update().

For per-layer control, supply the model’s complete native hf_overrides. Automatic GGUF sidecars, custom config formats, and model-specific defaults are outside this fix.

Tests

Ubuntu 24.04.5, CPU, Python 3.12.3. The Qwen3 test constructs YaRN and checks its saved base of 500000.

python -m pytest -q xinference/model/llm/vllm/tests/test_rope_scaling.py

| vLLM / Transformers | With 5b282329 core.py | 760631b1 |
|---|---:|---:|
| 0.34.0 / 5.22.2 | 9 failed | 9 passed |
| 0.33.0 / 5.20.2 | 9 failed | 9 passed |
| 0.23.0 / 4.57.6 | 9 failed | 9 passed |

Without vLLM, the file had 8 passed and 1 skipped on Python 3.12.3 with Transformers 5.24.0 and 4.57.6, and on Python 3.10.22. Changed-file pre-commit and whole-tree mypy passed. The 46 consumer test files, run on 760631b1 and on 5b282329 in the same environment, gave 2,840 passed, 18 skipped and 16 failed on both, with the same 16 test IDs (7 llama.cpp launch cases in core/tests/test_restful_api.py, which the box cannot run, and 9 in model/llm that fail on main there too).

AI disclosure: this was prepared with AI assistance (Claude Code with Claude Fable 5.2, and OpenAI Codex with GPT-6.2).

Diff: 234 lines (+175 / -59) across 2 files Reviewer: Jackmeson1 Review duration: 3287m
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 234 lines diff across 2 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
42%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.327
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #6180"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 43.0% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.1% (MEDIUM) · Higher = larger blast radius
42.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 43.0% · Lower = rushed or shallow review
43.0%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 24% · Safe to merge
24%