diff --git a/vllm/compilation/passes/fx_utils.py b/vllm/compilation/passes/fx_utils.py index a87ffea783..5b949d6140 100644 --- a/vllm/compilation/passes/fx_utils.py +++ b/vllm/compilation/passes/fx_utils.py @@ -14,10 +14,6 @@ def is_func(node: fx.Node, target: Target) -> bool: return bool(node.op == "call_function" and node.target == target) -def is_auto_func(node: fx.Node, op: OpOverload) -> bool: - return is_func(node, auto_functionalized) and node.args[0] == op - - # Returns the first auto_functionalized node with the given op (if it exists) def find_auto_fn_maybe(nodes: Iterable[fx.Node], op: OpOverload) -> fx.Node | None: for node in nodes: @@ -42,13 +38,6 @@ def find_getitem_maybe(node: fx.Node, idx: int) -> fx.Node | None: return None -# Returns the getitem node that extracts the idx-th element from node -def find_getitem(node: fx.Node, idx: int) -> fx.Node: - ret = find_getitem_maybe(node, idx) - assert ret is not None, f"Could not find getitem {idx} in node {node}" - return ret - - # An auto-functionalization-aware utility for finding nodes with a specific op # Also handles op overload packets and finds all overloads def find_op_nodes( @@ -67,11 +56,3 @@ def find_op_nodes( for n in graph.find_nodes(op="call_function", target=auto_functionalized): if n.args[0] == op: yield n - - -# Asserts that the node only has one user and returns it -# Even if a node has only 1 user, it might share storage with another node, -# which might need to be taken into account. -def get_only_user(node: fx.Node) -> fx.Node: - assert len(node.users) == 1 - return next(iter(node.users)) diff --git a/vllm/compilation/passes/vllm_inductor_pass.py b/vllm/compilation/passes/vllm_inductor_pass.py index 95a9e0b37f..351d83e918 100644 --- a/vllm/compilation/passes/vllm_inductor_pass.py +++ b/vllm/compilation/passes/vllm_inductor_pass.py @@ -333,12 +333,3 @@ class VllmFusionPatternMatcherPass(VllmPatternMatcherPass): def __call__(self, graph: torch.fx.Graph) -> None: self.matched_count = self.pm_pass.apply(graph) VllmPatternMatcherPass.match_table[self.pass_name] += self.matched_count - - -class PrinterInductorPass(VllmInductorPass): - def __init__(self, name: str, config: VllmConfig) -> None: - super().__init__(config) - self.name = name - - def __call__(self, graph: torch.fx.Graph) -> None: - self.dump_graph(graph, self.name) diff --git a/vllm/distributed/parallel_state.py b/vllm/distributed/parallel_state.py index a90e8acbca..dd3b1f4d2f 100644 --- a/vllm/distributed/parallel_state.py +++ b/vllm/distributed/parallel_state.py @@ -2081,9 +2081,6 @@ def model_parallel_is_initialized(): return _TP is not None and _PP is not None -_TP_STATE_PATCHED = False - - def get_tensor_model_parallel_world_size() -> int: """Return world size for the tensor model parallel group.""" return get_tp_group().world_size diff --git a/vllm/entrypoints/chat_utils.py b/vllm/entrypoints/chat_utils.py index 2f8e11714b..30b6ecc76b 100644 --- a/vllm/entrypoints/chat_utils.py +++ b/vllm/entrypoints/chat_utils.py @@ -2029,15 +2029,6 @@ async def parse_chat_messages_async( return conversation, mm_data, mm_uuids -def get_history_tool_calls_cnt(conversation: list[ConversationMessage]): - idx = 0 - for msg in conversation: - if msg["role"] == "assistant": - tool_calls = msg.get("tool_calls") - idx += len(list(tool_calls)) if tool_calls is not None else 0 # noqa - return idx - - _KIMI_MODEL_TYPES = ("kimi_k2", "kimi_k25", "kimi_k3") diff --git a/vllm/model_executor/layers/activation.py b/vllm/model_executor/layers/activation.py index 953a47e0fa..eb8fcb0962 100644 --- a/vllm/model_executor/layers/activation.py +++ b/vllm/model_executor/layers/activation.py @@ -8,14 +8,8 @@ import torch import torch.nn as nn import torch.nn.functional as F -from vllm.distributed import ( - divide, - get_tensor_model_parallel_rank, - get_tensor_model_parallel_world_size, -) from vllm.logger import init_logger from vllm.model_executor.custom_op import CustomOp -from vllm.model_executor.utils import set_weight_attrs from vllm.platforms import CpuArchEnum, current_platform from vllm.triton_utils import tl, triton from vllm.utils.collection_utils import LazyDict @@ -788,48 +782,6 @@ class XIELU(CustomOp): return self.forward_native(input) -class ScaledActivation(nn.Module): - """An activation function with post-scale parameters. - - This is used for some quantization methods like AWQ. - """ - - def __init__( - self, - act_module: nn.Module, - intermediate_size: int, - input_is_parallel: bool = True, - params_dtype: torch.dtype | None = None, - ): - super().__init__() - self.act = act_module - self.input_is_parallel = input_is_parallel - if input_is_parallel: - tp_size = get_tensor_model_parallel_world_size() - intermediate_size_per_partition = divide(intermediate_size, tp_size) - else: - intermediate_size_per_partition = intermediate_size - if params_dtype is None: - params_dtype = torch.get_default_dtype() - self.scales = nn.Parameter( - torch.empty(intermediate_size_per_partition, dtype=params_dtype) - ) - set_weight_attrs(self.scales, {"weight_loader": self.weight_loader}) - - def forward(self, x: torch.Tensor) -> torch.Tensor: - return self.act(x) / self.scales - - def weight_loader(self, param: nn.Parameter, loaded_weight: torch.Tensor): - param_data = param.data - if self.input_is_parallel: - tp_rank = get_tensor_model_parallel_rank() - shard_size = param_data.shape[0] - start_idx = tp_rank * shard_size - loaded_weight = loaded_weight.narrow(0, start_idx, shard_size) - assert param_data.shape == loaded_weight.shape - param_data.copy_(loaded_weight) - - _ACTIVATION_REGISTRY = LazyDict( { "gelu": lambda: GELU(), diff --git a/vllm/model_executor/layers/conv.py b/vllm/model_executor/layers/conv.py index 51314263b7..14f60231cd 100644 --- a/vllm/model_executor/layers/conv.py +++ b/vllm/model_executor/layers/conv.py @@ -155,58 +155,6 @@ class Conv2dLayer(ConvLayerBase): return self._forward_conv(x) -class CausalConv2dLayer(Conv2dLayer): - """ - A causal version of nn.Conv2d where each location in the 2D matrix would - have no access to locations on its right or down - All arguments are the same as nn.Conv2d except padding which should be - set as None - """ - - def __init__( - self, - in_channels: int, - out_channels: int, - kernel_size: int, - stride: int, - padding: int = 0, - dilation: int = 1, - groups: int = 1, - bias: bool = True, - padding_mode: str = "zeros", - *, - params_dtype: torch.dtype | None = None, - ) -> None: - if padding is not None: - raise ValueError( - "Argument padding should be set to None for CausalConv2dLayer." - ) - self._left_padding: int = kernel_size - 1 - self._right_padding: int = stride - 1 - padding = 0 - - super().__init__( - in_channels, - out_channels, - kernel_size, - stride, - padding, - dilation, - groups, - bias, - padding_mode, - params_dtype=params_dtype, - ) - - def forward( - self, - x: torch.Tensor, - ) -> torch.Tensor: - x = F.pad(x, pad=(self._left_padding, self._right_padding, 0, 0)) - x = super().forward(x) - return x - - # --8<-- [start:conv3d] @CustomOp.register("conv3d") class Conv3dLayer(ConvLayerBase): diff --git a/vllm/model_executor/layers/quantization/fp8.py b/vllm/model_executor/layers/quantization/fp8.py index 49dd3a6d22..251e4b9999 100644 --- a/vllm/model_executor/layers/quantization/fp8.py +++ b/vllm/model_executor/layers/quantization/fp8.py @@ -4,7 +4,6 @@ from typing import TYPE_CHECKING, Any import torch -from torch.utils._python_dispatch import TorchDispatchMode import vllm.envs as envs import vllm.model_executor.layers.fused_moe.modular_kernel as mk @@ -234,26 +233,6 @@ class Fp8Config(QuantizationConfig): return cache_scale_mapper | QuantizationConfig.get_cache_scale_mapper() -class CopyNumelCounter(TorchDispatchMode): - """ - Tracks total number of elements modified with `copy_`. Useful for keeping - track of weight loading where underlying weights can be arbitrarily - transformed (such as with `narrow`) before calling copy. - """ - - def __init__(self): - super().__init__() - self.copied_numel = 0 - - def __torch_dispatch__(self, func, types, args=(), kwargs=None): - if kwargs is None: - kwargs = {} - out = func(*args, **kwargs) - if func == torch.ops.aten.copy_.default: - self.copied_numel += args[0].numel() - return out - - class Fp8LinearMethod(LinearMethodBase): """Linear method for FP8. Supports loading FP8 checkpoints with static weight scale and diff --git a/vllm/model_executor/layers/utils.py b/vllm/model_executor/layers/utils.py index 1f65a21a4f..45180c545f 100644 --- a/vllm/model_executor/layers/utils.py +++ b/vllm/model_executor/layers/utils.py @@ -25,12 +25,6 @@ MOE_LAYER_ROUTER_GATE_SUFFIXES = { } -def is_layer_moe_router_gate(prefix: str) -> bool: - if not prefix: - return False - return prefix.rsplit(".", 1)[-1] in MOE_LAYER_ROUTER_GATE_SUFFIXES - - def get_token_bin_counts_and_mask( tokens: torch.Tensor, vocab_size: int, diff --git a/vllm/model_executor/models/glm_ocr.py b/vllm/model_executor/models/glm_ocr.py index 7d7ec73509..9ead8854de 100644 --- a/vllm/model_executor/models/glm_ocr.py +++ b/vllm/model_executor/models/glm_ocr.py @@ -242,10 +242,6 @@ class GlmOcrVisionBlock(Glm4vVisionBlock): ) -class GlmOcrVisionPatchEmbed(Glm4vVisionPatchEmbed): - pass - - class GlmOcrPatchMerger(Glm4vPatchMerger): pass diff --git a/vllm/model_executor/models/idefics3.py b/vllm/model_executor/models/idefics3.py index 4b3cbcabd2..732f5c021a 100644 --- a/vllm/model_executor/models/idefics3.py +++ b/vllm/model_executor/models/idefics3.py @@ -103,41 +103,6 @@ class Idefics3ProcessingInfo(BaseProcessingInfo): def get_supported_mm_limits(self) -> Mapping[str, int | None]: return {"image": None} - def _resize_output_size( - self, - *, - height: int, - width: int, - max_len: int | None = None, - min_len: int = 1, - max_size: int | None = None, - ) -> tuple[int, int]: - # Set default value for max_len if not provided - max_len = max(height, width) if max_len is None else max_len - aspect_ratio = width / height - - # Handle the maximum size constraint - if max_size is not None: - max_len = min(max_len, max_size) - - # Adjust dimensions according to the aspect ratio - if width >= height: - width = max_len - height = int(width / aspect_ratio) - else: - height = max_len - width = int(height * aspect_ratio) - - # Ensure both width and height are even (if needed) - height += height % 2 - width += width % 2 - - # Ensure dimensions are not smaller than the minimum length - height = max(height, min_len) - width = max(width, min_len) - - return height, width - def _get_image_feature_grid_size( self, *, diff --git a/vllm/model_executor/models/llava_onevision2.py b/vllm/model_executor/models/llava_onevision2.py index 9dc11d493a..84b6c369df 100644 --- a/vllm/model_executor/models/llava_onevision2.py +++ b/vllm/model_executor/models/llava_onevision2.py @@ -1531,13 +1531,6 @@ class LlavaOnevision2MultiModalDataParser(MultiModalDataParser): class LlavaOnevision2MultiModalProcessor( BaseMultiModalProcessor[LlavaOnevision2ProcessingInfo] ): - def _get_data_parser(self) -> MultiModalDataParser: - # Retained for symmetry; vLLM actually fetches the parser via - # info.get_data_parser() (see ProcessingInfo override above). - return LlavaOnevision2MultiModalDataParser( - self.info.get_hf_config().vision_config.spatial_merge_size - ) - def _call_hf_processor( self, prompt: str, diff --git a/vllm/model_executor/models/nemotron_parse.py b/vllm/model_executor/models/nemotron_parse.py index 6e52e7cfe7..793682b99c 100644 --- a/vllm/model_executor/models/nemotron_parse.py +++ b/vllm/model_executor/models/nemotron_parse.py @@ -77,24 +77,6 @@ class BartScaledWordEmbedding(VocabParallelEmbedding): return super().forward(input_ids) * self.embed_scale -class BartParallelLMHead(ParallelLMHead): - """ - This module overrides ParallelLMHead's - forward by dividing by embeddings scale, - yielding effectively the inverse of - BartScaledWordEmbedding - """ - - def __init__( - self, num_embeddings: int, embedding_dim: int, embed_scale: float = 1.0 - ): - super().__init__(num_embeddings, embedding_dim) - self.embed_scale = embed_scale - - def forward(self, input_ids: torch.Tensor) -> torch.Tensor: - return super().forward(input_ids) / self.embed_scale - - class BartDecoderLayer(nn.Module): def __init__( self, diff --git a/vllm/model_executor/models/phi4mm.py b/vllm/model_executor/models/phi4mm.py index dc05597866..8bb2d3dea9 100644 --- a/vllm/model_executor/models/phi4mm.py +++ b/vllm/model_executor/models/phi4mm.py @@ -521,32 +521,6 @@ class Phi4MMAudioEmbeddingInputs(TensorSchema): Phi4MMAudioInputs: TypeAlias = Phi4MMAudioFeatureInputs | Phi4MMAudioEmbeddingInputs -def cat_with_pad(tensors, dim, padding_value=0): - """ - cat along dim, while pad to max for all other dims - """ - ndim = tensors[0].dim() - assert all(t.dim() == ndim for t in tensors[1:]), ( - "All tensors must have the same number of dimensions" - ) - - out_size = [max(t.shape[i] for t in tensors) for i in range(ndim)] - out_size[dim] = sum(t.shape[dim] for t in tensors) - output = tensors[0].new_full(out_size, padding_value) - - index = 0 - for t in tensors: - # Create a slice list where every dimension except dim is full slice - slices = [slice(0, t.shape[d]) for d in range(ndim)] - # Update only the concat dimension slice - slices[dim] = slice(index, index + t.shape[dim]) - - output[slices] = t - index += t.shape[dim] - - return output - - def stack_with_pad( tensors: torch.Tensor | list[torch.Tensor], padding_value: int | float = 0, diff --git a/vllm/model_executor/models/phi4mm_utils.py b/vllm/model_executor/models/phi4mm_utils.py index 0965f28165..d7663ca71b 100644 --- a/vllm/model_executor/models/phi4mm_utils.py +++ b/vllm/model_executor/models/phi4mm_utils.py @@ -1595,14 +1595,6 @@ class AttModule(nn.Module): return x, memory, pos_emb, att_mask -class AttBlock(BlockBase, AttModule): - """Attention Block module to support both Attention and Block module.""" - - def memory_dims(self, max_len: bool = False) -> tuple[int, int]: - """memory dimensions""" - return (1, self.input_size) - - def masked_softmax( scores: Tensor, mask: Tensor | None, diff --git a/vllm/model_executor/models/skyworkr1v.py b/vllm/model_executor/models/skyworkr1v.py index d57da08598..255827eff3 100644 --- a/vllm/model_executor/models/skyworkr1v.py +++ b/vllm/model_executor/models/skyworkr1v.py @@ -7,7 +7,7 @@ # Copyright (c) 2025 Skywork # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- -from collections.abc import Iterable, Mapping +from collections.abc import Iterable from typing import Annotated, Literal, TypeAlias import torch @@ -15,8 +15,6 @@ import torch.nn as nn from transformers import PretrainedConfig from vllm.config import VllmConfig -from vllm.config.multimodal import BaseDummyOptions -from vllm.inputs import MultiModalDataDict from vllm.model_executor.layers.linear import ReplicatedLinear from vllm.model_executor.layers.quantization import QuantizationConfig from vllm.model_executor.layers.quantization.auto_awq import AutoAWQConfig @@ -24,7 +22,6 @@ from vllm.model_executor.models.intern_vit import ( InternVisionModel, ) from vllm.multimodal import MULTIMODAL_REGISTRY -from vllm.multimodal.processing import BaseDummyInputsBuilder from vllm.sequence import IntermediateTensors from vllm.transformers_utils.processors.internvl import ( InternVLImageProcessor, @@ -117,33 +114,6 @@ class SkyworkR1VProcessingInfo(BaseInternVLProcessingInfo): ) -class SkyworkR1VDummyInputsBuilder(BaseDummyInputsBuilder[SkyworkR1VProcessingInfo]): - def get_dummy_text(self, mm_counts: Mapping[str, int]) -> str: - num_images = mm_counts.get("image", 0) - - return "" * num_images - - def get_dummy_mm_data( - self, - seq_len: int, - mm_counts: Mapping[str, int], - mm_options: Mapping[str, BaseDummyOptions], - ) -> MultiModalDataDict: - target_width, target_height = self.info.get_image_size_with_most_features() - num_images = mm_counts.get("image", 0) - - image_overrides = mm_options.get("image") - - return { - "image": self._get_dummy_images( - width=target_width, - height=target_height, - num_images=num_images, - overrides=image_overrides, - ) - } - - @MULTIMODAL_REGISTRY.register_processor( BaseInternVLMultiModalProcessor, info=SkyworkR1VProcessingInfo, diff --git a/vllm/model_executor/models/utils.py b/vllm/model_executor/models/utils.py index f92aa4f086..5e1236a7eb 100644 --- a/vllm/model_executor/models/utils.py +++ b/vllm/model_executor/models/utils.py @@ -27,7 +27,6 @@ from vllm.multimodal import NestedTensors from vllm.sequence import IntermediateTensors from vllm.utils.math_utils import cdiv from vllm.utils.torch_utils import ( - async_tensor_h2d, direct_register_custom_op, ) @@ -673,17 +672,6 @@ def _merge_multimodal_embeddings( return inputs_embeds -def isin_list( - elements: torch.Tensor, - test_elements_list: list[int], -) -> torch.Tensor: - test_elements = async_tensor_h2d( - test_elements_list, dtype=torch.int64, device=elements.device - ) - - return torch.isin(elements, test_elements) - - class StageMissingLayer(nn.Module): def __init__(self, stage_name: str, module: nn.Module | None = None) -> None: super().__init__() diff --git a/vllm/model_executor/models/vision.py b/vllm/model_executor/models/vision.py index 18e994c95d..9423cbb5cf 100644 --- a/vllm/model_executor/models/vision.py +++ b/vllm/model_executor/models/vision.py @@ -580,40 +580,3 @@ def run_dp_sharded_mrope_vision_model( "Found unassigned embeddings" ) return out_embeddings - - -def get_llm_pos_ids_for_vision( - start_idx: int, - vision_idx: int, - spatial_merge_size: int, - t_index: list[int], - grid_hs: torch.Tensor, - grid_ws: torch.Tensor, -) -> torch.Tensor: - llm_pos_ids_list = [] - llm_grid_h = grid_hs[vision_idx] // spatial_merge_size - llm_grid_w = grid_ws[vision_idx] // spatial_merge_size - h_index = ( - torch.arange(llm_grid_h) - .view(1, -1, 1) - .expand(len(t_index), -1, llm_grid_w) - .flatten() - ) - w_index = ( - torch.arange(llm_grid_w) - .view(1, 1, -1) - .expand(len(t_index), llm_grid_h, -1) - .flatten() - ) - t_index_tensor = ( - torch.Tensor(t_index) - .to(llm_grid_h.device) - .view(-1, 1) - .expand(-1, llm_grid_h * llm_grid_w) - .long() - .flatten() - ) - _llm_pos_ids = torch.stack([t_index_tensor, h_index, w_index]) - llm_pos_ids_list.append(_llm_pos_ids + start_idx) - llm_pos_ids = torch.cat(llm_pos_ids_list, dim=1) - return llm_pos_ids diff --git a/vllm/models/minimax_m3/common/mm_preprocess.py b/vllm/models/minimax_m3/common/mm_preprocess.py index e8e0ca063d..2b32ae8611 100644 --- a/vllm/models/minimax_m3/common/mm_preprocess.py +++ b/vllm/models/minimax_m3/common/mm_preprocess.py @@ -23,7 +23,6 @@ from vllm.multimodal.inputs import ( from vllm.multimodal.parse import ( ImageSize, MultiModalDataItems, - MultiModalDataParser, ) from vllm.multimodal.processing import ( BaseDummyInputsBuilder, @@ -307,14 +306,6 @@ class MiniMaxM3VLDummyInputsBuilder(BaseDummyInputsBuilder[MiniMaxM3VLProcessing class MiniMaxM3VLMultiModalProcessor( BaseMultiModalProcessor[MiniMaxM3VLProcessingInfo] ): - def _get_data_parser(self) -> MultiModalDataParser: - # Request video metadata (fps + sampled frame indices) so the HF - # processor can emit per-frame ``]<]X.X seconds[>[`` timestamp markers, - # matching MiniMax's reference video token stream. ``_get_prompt_updates`` - # reconstructs the same markers from the metadata to keep the prompt - # replacement aligned with the processor output. - return MultiModalDataParser(video_needs_metadata=True) - def _call_hf_processor( self, prompt: str, diff --git a/vllm/profiler/utils.py b/vllm/profiler/utils.py index 1ef229f276..5f3c5eaaec 100644 --- a/vllm/profiler/utils.py +++ b/vllm/profiler/utils.py @@ -12,15 +12,6 @@ from torch._C._profiler import _EventType, _ProfilerEvent, _TensorMetadata # -def trim_string_front(string: str, width: int) -> str: - if len(string) > width: - offset = len(string) - width + 3 - string = string[offset:] - if len(string) > 3: - string = "..." + string[3:] - return string - - def trim_string_back(string: str, width: int) -> str: if len(string) > width: offset = len(string) - width + 3 diff --git a/vllm/utils/cache.py b/vllm/utils/cache.py index 5f7647dce6..e45c2f6a8b 100644 --- a/vllm/utils/cache.py +++ b/vllm/utils/cache.py @@ -182,10 +182,6 @@ class LRUCache(cachetools.LRUCache[_K, _V]): self.popitem(remove_pinned=remove_pinned) - def _remove_old_if_needed(self) -> None: - while self.currsize > self.capacity: - self.remove_oldest() - def popitem(self, remove_pinned: bool = False): """Remove and return the `(key, value)` pair least recently used.""" if not remove_pinned: diff --git a/vllm/utils/multi_stream_utils.py b/vllm/utils/multi_stream_utils.py index 5e4aec9b3c..a8286c8480 100644 --- a/vllm/utils/multi_stream_utils.py +++ b/vllm/utils/multi_stream_utils.py @@ -8,10 +8,6 @@ from typing import Any import torch -class AuxStreamType(Enum): - Attention = 1 - - class EventType(Enum): Main = 0 Attention = 1 diff --git a/vllm/v1/core/kv_cache_utils.py b/vllm/v1/core/kv_cache_utils.py index 9aea061097..6c7f930d85 100644 --- a/vllm/v1/core/kv_cache_utils.py +++ b/vllm/v1/core/kv_cache_utils.py @@ -427,26 +427,6 @@ class FreeKVCacheBlockQueue: curr_block = curr_block.next_free_block -def need_extra_keys(request: Request) -> bool: - """Check whether the blocks allocated to this request need extra hash keys. - - Args: - request (Request): The request. - - Returns: - bool: Whether blocks allocated to this request need extra hash keys. - """ - - # Multimodal requests need to include the MM hash. - # LoRA requests need to include the LoRA name. - # Request with provided cache salt need to include the salt. - return ( - bool(request.mm_features) - or (request.lora_request is not None) - or (request.cache_salt is not None) - ) - - def _gen_mm_extra_hash_keys( request: Request, start_token_idx: int, end_token_idx: int, start_mm_idx: int ) -> tuple[list[Any], int]: @@ -1053,20 +1033,6 @@ def _get_kv_cache_groups_uniform_type( return [KVCacheGroupSpec(list(spec.kv_cache_specs.keys()), spec)] -def is_kv_cache_page_size_uniform(kv_cache_spec: dict[str, KVCacheSpec]) -> bool: - """ - Whether all layers in the given KVCacheSpec have the same page size. - Args: - kv_cache_spec: The KVCacheSpec of each attention layer in the model - - Returns: - True if all layers have the same page size, False otherwise. - """ - - page_sizes = {layer.page_size_bytes for layer in kv_cache_spec.values()} - return len(page_sizes) == 1 - - def unify_kv_cache_spec_page_size( kv_cache_spec: dict[str, KVCacheSpec], ) -> dict[str, KVCacheSpec]: