[Core][Model] Unify XD-RoPE into M-RoPE and derive the channel count - #56078
Merged
Merged
Conversation
hmellor
force-pushed
the
unify-multimodal-rope
branch
2 times, most recently
from
September 9, 2026 13:03
fdf362d to
8fac598
Compare
4 tasks done
1 task done
1 task done
XD-RoPE was added for the native HunYuan-VL implementation, which has since moved to the Transformers modeling backend. Nothing implements `SupportsXDRoPE` any more, so `uses_xdrope_dim` can only return 0 and every XD-RoPE branch is unreachable; a config that did trip the detection would fail the `supports_xdrope` assertion rather than run. Transformers has collapsed the distinction upstream too: it renames `xdrope_section` to `mrope_section` and validates position ids against `len(mrope_section)`. The two vLLM paths only ever differed in whether decode adds a position delta, and M-RoPE with a model-supplied delta subsumes XD-RoPE, whose delta is structurally zero. Fold XD-RoPE into the M-RoPE path, keep `xdrope_section` as a legacy alias so no config loses support, and size the position buffers from the model's section count instead of a hardcoded 3. That count fixes HunyuanOCR (vllm-project#55140), whose four M-RoPE sections crashed `profile_run` against the 3-channel buffer. Also pass `get_rope_index` only the grid arguments its signature accepts: `HunYuanVLModel` takes no `video_grid_thw` and has no `**kwargs`. Supersedes vllm-project#55436. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V52AokcYhV51yU6QTD62i2 Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
hmellor
force-pushed
the
unify-multimodal-rope
branch
from
September 9, 2026 13:09
8fac598 to
f26841b
Compare
Member
Author
|
/ci run |
hmellor
marked this pull request as ready for review
September 9, 2026 13:12
hmellor
requested review from
ApostaC,
MatthewBonanni,
WoosukKwon,
alexm-redhat,
benchislett,
heheda12345,
ivanium,
luccafong,
mgoin,
njhill,
orozery,
robertgshaw2-redhat,
yewentao256,
youkaichao and
ywang96
as code owners
September 9, 2026 13:12
|
✅ Triggered Buildkite CI #87917 for commit |
DarkLight1337
requested review from
Isotr0py
and removed request for
DarkLight1337,
WoosukKwon,
alexm-redhat,
luccafong,
robertgshaw2-redhat,
shen-shanshan,
yewentao256 and
ywang96
September 9, 2026 13:38
Isotr0py
reviewed
Sep 9, 2026
`XDRotaryEmbedding` came with the native HunyuanOCR implementation and had only ever one consumer, which moved to the Transformers modeling backend in vllm-project#53615. That backend builds its rotary embedding in HF modeling code, so `get_rope` is never reached for these models. The `xdrope` branch is unreachable even in principle now: HunYuanVL's config class rewrites `rope_type` from `xdrope` to `dynamic` and renames `xdrope_section` to `mrope_section` in `convert_rope_params_to_dict`, which runs on every `from_pretrained`, so `tencent/HunyuanOCR` loads as a 4-section dynamic-alpha config. Keep the `xdrope_section` alias in `_mrope_section` for configs loaded outside that class. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AFmmDwBKjFxBKkVSYyrWQW Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Isotr0py
approved these changes
Sep 9, 2026
Isotr0py
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the cleanup!
Member
Author
|
/ci run |
hmellor
enabled auto-merge (squash)
September 9, 2026 15:03
|
✅ Triggered Buildkite CI #87940 for commit |
ItsRoy69
pushed a commit
to ItsRoy69/vllm
that referenced
this pull request
Sep 10, 2026
…llm-project#56078) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Jyotirmoy Roy <jyotirmoyroy649@gmail.com>
MrlixiangWE
added a commit
to MrlixiangWE/vllm-omni
that referenced
this pull request
Sep 17, 2026
vLLM 719284f (vllm-project/vllm#56078) unified XD-RoPE into M-RoPE and removed `uses_xdrope_dim` from the model runner, so on a vLLM containing that commit the Omni runners raise AttributeError where they read it. vllm-project#6923 guarded four of the six read sites with getattr. Put the default in `OmniGPUModelRunner.__init__` instead and read the flag plainly everywhere: one enforcement point, and it reaches the two NPU runners that inherit this constructor, which the guards did not cover. The pinned version's value is preserved. The test constructs both GPU runners through the real parent constructor and the installed vLLM's config classes, admits a request through `_update_states`, and checks the position buffers and `_preprocess` output for plain, image and cached input. One case deletes the attribute after the parent constructor runs, so the pinned version also covers what the removal does. Signed-off-by: MrlixiangWE <mrdanaer@gmail.com> Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com>
MrlixiangWE
added a commit
to MrlixiangWE/vllm-omni
that referenced
this pull request
Sep 17, 2026
vLLM 719284f (vllm-project/vllm#56078) unified XD-RoPE into M-RoPE and removed `uses_xdrope_dim` from the model runner, so on a vLLM containing that commit the Omni runners raise AttributeError where they read it. vllm-project#6923 guarded four of the six read sites with getattr. Put the default in `OmniGPUModelRunner.__init__` instead and read the flag plainly everywhere: one enforcement point, and it reaches the two NPU runners that inherit this constructor, which the guards did not cover. The pinned version's value is preserved. The test constructs both GPU runners through the real parent constructor and the installed vLLM's config classes, admits a request through `_update_states`, and checks the position buffers and `_preprocess` output for plain, image and cached input. One case deletes the attribute after the parent constructor runs, so the pinned version also covers what the removal does. Signed-off-by: MrlixiangWE <mrdanaer@gmail.com> Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com>
MrlixiangWE
added a commit
to MrlixiangWE/vllm-omni
that referenced
this pull request
Sep 17, 2026
vLLM 719284f (vllm-project/vllm#56078) unified XD-RoPE into M-RoPE and removed `uses_xdrope_dim` from the model runner, so on a vLLM containing that commit the Omni runners raise AttributeError where they read it. vllm-project#6923 guarded four of the six read sites with getattr. Put the default in `OmniGPUModelRunner.__init__` instead and read the flag plainly everywhere: one enforcement point, and it reaches the two NPU runners that inherit this constructor, which the guards did not cover. The pinned version's value is preserved. The test constructs both GPU runners through the real parent constructor and the installed vLLM's config classes, admits a request through `_update_states`, and checks the position buffers and `_preprocess` output for plain, image and cached input. One case deletes the attribute after the parent constructor runs, so the pinned version also covers what the removal does. Signed-off-by: MrlixiangWE <mrdanaer@gmail.com> Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com>
MrlixiangWE
added a commit
to MrlixiangWE/vllm-omni
that referenced
this pull request
Sep 18, 2026
vLLM 719284f (vllm-project/vllm#56078) unified XD-RoPE into M-RoPE and removed `uses_xdrope_dim` from the model runner, so on a vLLM containing that commit the Omni runners raise AttributeError where they read it. Read the flag with a default in `OmniGPUModelRunner.__init__`. vllm-project#6923 guards four of the six read sites for runners built with `object.__new__`, which this repo does in tests; those guards stay, and this default is what covers the paths they do not, including the two NPU runners that inherit this constructor. The pinned version's value is preserved, and a vLLM that never sets the flag says so once in the log rather than silently serving 1-D positions. The test constructs both GPU runners through the real parent constructor and the installed vLLM's config classes, admits a request through `_update_states`, and checks the position buffers and `_preprocess` output. One case drops the attribute after the parent constructor returns, so the pinned version also covers what the removal does. Signed-off-by: MrlixiangWE <mrdanaer@gmail.com> Co-authored-by: zijianc2 <157244773+zijianc2@users.noreply.github.com>
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.
XD-RoPE was added for the native HunYuan-VL implementation, which has since moved to the Transformers modeling backend. Nothing implements
SupportsXDRoPEany more, souses_xdrope_dimcan only return 0 and every XD-RoPE branch is unreachable; a config that did trip the detection would fail thesupports_xdropeassertion rather than run.Transformers has collapsed the distinction upstream too: it renames
xdrope_sectiontomrope_sectionand validates position ids againstlen(mrope_section). The two vLLM paths only ever differed in whether decode adds a position delta, and M-RoPE with a model-supplied delta subsumes XD-RoPE, whose delta is structurally zero.Fold XD-RoPE into the M-RoPE path, keep
xdrope_sectionas a legacy alias so no config loses support, and size the position buffers from the model's section count instead of a hardcoded 3.That count fixes HunyuanOCR (#55140), whose four M-RoPE sections crashed
profile_runagainst the 3-channel buffer. Also passget_rope_indexonly the grid arguments its signature accepts:HunYuanVLModeltakes novideo_grid_thwand has no**kwargs.Supersedes #55436.