@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / e20eba753b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[VLM][Refactor] Remove useless func `get_input_positions` in `MRotaryEmbedding` (#27088)

Signed-off-by: MengqingCao <cmq0113@163.com>

Mengqing Cao committed Oct 17, 2025 at 17:00 UTC e20eba753bbced43837aa92f747e6c50ee36ce09
1 file changed -34
vllm/model_executor/layers/rotary_embedding/mrope.py
-34
@@ -4,7 +4,6 @@
4
5 import numpy as np
6 import torch
7 -from transformers import PretrainedConfig
7
8 from vllm.triton_utils import tl, triton
9
@@ -376,39 +375,6 @@ class MRotaryEmbedding(RotaryEmbedding):
375 ) -> tuple[torch.Tensor, torch.Tensor | None]:
376 return self.forward_native(positions, query, key, offsets)
377
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 -
378 @staticmethod
379 def get_next_input_positions(
380 mrope_position_delta: int,