Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
e20eba75
Unverified
Commit
e20eba75
authored
Oct 17, 2025
by
Mengqing Cao
Committed by
GitHub
Oct 17, 2025
Browse files
[VLM][Refactor] Remove useless func `get_input_positions` in `MRotaryEmbedding` (#27088)
Signed-off-by:
MengqingCao
<
cmq0113@163.com
>
parent
bbc1b296
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
34 deletions
+0
-34
vllm/model_executor/layers/rotary_embedding/mrope.py
vllm/model_executor/layers/rotary_embedding/mrope.py
+0
-34
No files found.
vllm/model_executor/layers/rotary_embedding/mrope.py
View file @
e20eba75
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
from
transformers
import
PretrainedConfig
from
vllm.triton_utils
import
tl
,
triton
from
vllm.triton_utils
import
tl
,
triton
...
@@ -376,39 +375,6 @@ class MRotaryEmbedding(RotaryEmbedding):
...
@@ -376,39 +375,6 @@ class MRotaryEmbedding(RotaryEmbedding):
)
->
tuple
[
torch
.
Tensor
,
torch
.
Tensor
|
None
]:
)
->
tuple
[
torch
.
Tensor
,
torch
.
Tensor
|
None
]:
return
self
.
forward_native
(
positions
,
query
,
key
,
offsets
)
return
self
.
forward_native
(
positions
,
query
,
key
,
offsets
)
@
classmethod
def
get_input_positions
(
cls
,
input_tokens
:
list
[
int
],
hf_config
:
PretrainedConfig
,
image_grid_thw
:
list
[
list
[
int
]]
|
torch
.
Tensor
|
None
,
video_grid_thw
:
list
[
list
[
int
]]
|
torch
.
Tensor
|
None
,
second_per_grid_ts
:
list
[
float
]
|
None
,
context_len
:
int
=
0
,
seq_len
:
int
|
None
=
None
,
audio_feature_lengths
:
torch
.
Tensor
|
None
=
None
,
use_audio_in_video
:
bool
=
False
,
)
->
tuple
[
list
[
list
[
int
]],
int
]:
"""Get mrope input positions and delta value."""
image_grid_thw
=
[]
if
image_grid_thw
is
None
else
image_grid_thw
video_grid_thw
=
[]
if
video_grid_thw
is
None
else
video_grid_thw
second_per_grid_ts
=
[]
if
second_per_grid_ts
is
None
else
second_per_grid_ts
llm_positions
,
mrope_position_delta
=
cls
.
get_input_positions_tensor
(
input_tokens
=
input_tokens
,
hf_config
=
hf_config
,
image_grid_thw
=
image_grid_thw
,
video_grid_thw
=
video_grid_thw
,
second_per_grid_ts
=
second_per_grid_ts
,
context_len
=
context_len
,
seq_len
=
seq_len
,
audio_feature_lengths
=
audio_feature_lengths
,
use_audio_in_video
=
use_audio_in_video
,
)
return
llm_positions
.
tolist
(),
mrope_position_delta
@
staticmethod
@
staticmethod
def
get_next_input_positions
(
def
get_next_input_positions
(
mrope_position_delta
:
int
,
mrope_position_delta
:
int
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment