[Feature] Add VidCom2 video token pruning (#47750)

Signed-off-by: Benedikt Falk <bfalk@nvidia.com>
This commit is contained in:
nvbfalk
2026-07-28 03:20:17 +00:00
committed by GitHub
parent 7aea73d83d
commit 60915c972c
17 changed files with 421 additions and 48 deletions
+8
View File
@@ -41,6 +41,7 @@ if TYPE_CHECKING:
SpeechToTextParams,
VllmConfig,
)
from vllm.config.multimodal import VideoPruningMethod
from vllm.inputs import PromptType, TokensPrompt
from vllm.lora.model_manager import LoRAModelManager
from vllm.model_executor.layers.fused_moe import MoERunner
@@ -424,6 +425,13 @@ class SupportsMultiModalPruning(Protocol):
supports_multimodal_pruning: ClassVar[Literal[True]] = True
supported_video_pruning_methods: ClassVar[tuple["VideoPruningMethod", ...]] = (
"evs",
)
"""Video pruning methods (as reported by
`MultiModalConfig.get_video_pruning_spec`) implemented by this model.
Models supporting methods beyond EVS should override this."""
def recompute_mrope_positions(
self,
input_ids: list[int] | torch.Tensor,