Skip to content

[Docs] Use rope_parameters for the YaRN overrides in the Qwen3-Next and Ling cookbooks - #44155

Open
jinwukong wants to merge 1 commit into
sgl-project:mainfrom
jinwukong:docs/cookbook-rope-parameters
Open

jinwukong wants to merge 1 commit into
sgl-project:mainfrom
jinwukong:docs/cookbook-rope-parameters

Conversation

@jinwukong

@jinwukong jinwukong commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

SGLang pins transformers v5, where rope_scaling is only an alias property of rope_parameters: assigning it replaces the whole dict, and huggingface/transformers#49515 deprecates the setter (a FutureWarning now, a ValueError when rope_theta is missing). Two cookbook recipes still override through the old key:

  • Qwen3-Next (1M context) passes {"rope_scaling": {"rope_type": "yarn", ...}} without rope_theta, so it would start raising on the next transformers release.
  • Ling-2.6 / Ling-3.0-flash-VL carry the full dict (rope_theta, partial_rotary_factor) but under the deprecated key.

This is the cookbook follow-up discussed on huggingface/transformers#49515; the engine side (--json-model-override-args merging the base parameters) is #43067.

Modifications

  • docs/cookbook/autoregressive/Qwen/Qwen3-Next.mdx: both 1M commands pass the complete rope_parameters dict; rope_theta: 10000000 and partial_rotary_factor: 0.25 come from the model's config.json.
  • docs/cookbook/autoregressive/InclusionAI/Ling-2.6.mdx, Ling-3.0-flash-VL.mdx: prose updated to the new key.
  • docs/src/snippets/autoregressive/ling-26-flash-deployment.jsx, docs/src/snippets/configs/inclusionAI/ling-3.0-flash-vl.jsx: the generated commands switch rope_scaling → rope_parameters, values unchanged.

Verification

Loaded the Qwen3-Next config through sglang.srt.utils.hf_transformers.config.get_config with the new override (transformers 5.19.0, CPU):

override rope_parameters after loading rope_theta attribute
none None 10000000
old rope_scaling {rope_type: yarn, factor: 4.0, original_max_position_embeddings: 262144} 10000000
new rope_parameters {rope_type: yarn, factor: 4.0, original_max_position_embeddings: 262144, rope_theta: 10000000, partial_rotary_factor: 0.25} 10000000

get_rope's YaRN branch reads its keys with .get, and SGLang's native v5 configs already pass full rope_parameters dicts (with rope_theta and partial_rotary_factor inside) through the same path, so the extra keys change nothing for the rotary embedding. No rope_scaling reference is left under docs/.

Checklist


CI States

Latest PR Test (Base): ✅ Run #38495646011
Latest PR Test (Extra): ❌ Run #38495646029
Latest PR Test (AMD ROCm 10): ➖ No AMD PR run found for this commit.

…nd Ling cookbooks

SGLang pins transformers v5, where rope_scaling is only an alias of
rope_parameters: assigning it replaces the whole dict, and
huggingface/transformers#49515 deprecates the setter (FutureWarning now,
ValueError when rope_theta is missing). The Qwen3-Next 1M recipe set
rope_scaling without rope_theta, so it would start raising on the next
transformers release; the Ling recipes carried the full dict under the
deprecated key.

Pass the complete rope_parameters dict instead: Qwen3-Next gets its
rope_theta (10000000) and partial_rotary_factor (0.25) from the model
config, the Ling recipes keep their values and only switch the key.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant