Skip to content

Commit e20eba7

Browse files
authored
[VLM][Refactor] Remove useless func get_input_positions in MRotaryEmbedding (#27088)
Signed-off-by: MengqingCao <[email protected]>
1 parent bbc1b29 commit e20eba7

File tree

1 file changed

+0
-34
lines changed
  • vllm/model_executor/layers/rotary_embedding

1 file changed

+0
-34
lines changed

vllm/model_executor/layers/rotary_embedding/mrope.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import numpy as np
66
import torch
7-
from transformers import PretrainedConfig
87

98
from vllm.triton_utils import tl, triton
109

@@ -376,39 +375,6 @@ def forward_cpu(
376375
) -> tuple[torch.Tensor, torch.Tensor | None]:
377376
return self.forward_native(positions, query, key, offsets)
378377

379-
@classmethod
380-
def get_input_positions(
381-
cls,
382-
input_tokens: list[int],
383-
hf_config: PretrainedConfig,
384-
image_grid_thw: list[list[int]] | torch.Tensor | None,
385-
video_grid_thw: list[list[int]] | torch.Tensor | None,
386-
second_per_grid_ts: list[float] | None,
387-
context_len: int = 0,
388-
seq_len: int | None = None,
389-
audio_feature_lengths: torch.Tensor | None = None,
390-
use_audio_in_video: bool = False,
391-
) -> tuple[list[list[int]], int]:
392-
"""Get mrope input positions and delta value."""
393-
394-
image_grid_thw = [] if image_grid_thw is None else image_grid_thw
395-
video_grid_thw = [] if video_grid_thw is None else video_grid_thw
396-
second_per_grid_ts = [] if second_per_grid_ts is None else second_per_grid_ts
397-
398-
llm_positions, mrope_position_delta = cls.get_input_positions_tensor(
399-
input_tokens=input_tokens,
400-
hf_config=hf_config,
401-
image_grid_thw=image_grid_thw,
402-
video_grid_thw=video_grid_thw,
403-
second_per_grid_ts=second_per_grid_ts,
404-
context_len=context_len,
405-
seq_len=seq_len,
406-
audio_feature_lengths=audio_feature_lengths,
407-
use_audio_in_video=use_audio_in_video,
408-
)
409-
410-
return llm_positions.tolist(), mrope_position_delta
411-
412378
@staticmethod
413379
def get_next_input_positions(
414380
mrope_position_delta: int,

0 commit comments

Comments
 (0)