From b3d0b37908c349ddbb1591bdf2325af15cd21620 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Fri, 20 Mar 2026 18:12:51 -0400 Subject: [PATCH] [Refactor] Remove unused dead code (#36171) Signed-off-by: yewentao256 --- .../v1/moriio/moriio_connector.py | 3 --- .../fused_moe/deepep_ll_prepare_finalize.py | 5 ----- vllm/model_executor/layers/fused_moe/utils.py | 21 ------------------- 3 files changed, 29 deletions(-) diff --git a/vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_connector.py b/vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_connector.py index 1861c9e8e..dcde7665f 100644 --- a/vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_connector.py +++ b/vllm/distributed/kv_transfer/kv_connector/v1/moriio/moriio_connector.py @@ -1396,9 +1396,6 @@ class MoRIIOConnectorWorker: remote_ip=meta.remote_host, ) - def _is_last_layer(self, layer_name): - return layer_name == list(self.kv_caches.keys())[-1] - def merge_contiguous_blocks( self, offsets_local: list[int], diff --git a/vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py b/vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py index a22b89415..e1d2d5740 100644 --- a/vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py +++ b/vllm/model_executor/layers/fused_moe/deepep_ll_prepare_finalize.py @@ -158,11 +158,6 @@ class DeepEPLLPrepareAndFinalize(mk.FusedMoEPrepareAndFinalizeModular): return topk_ids return self.global_to_physical[topk_ids] - def _map_local_to_global_ids(self, expert_topk_ids: torch.Tensor) -> torch.Tensor: - if self.local_expert_global_ids is None: - return expert_topk_ids - return self.local_expert_global_ids[expert_topk_ids] - def _do_quant( self, x: torch.Tensor | tuple[torch.Tensor, torch.Tensor], diff --git a/vllm/model_executor/layers/fused_moe/utils.py b/vllm/model_executor/layers/fused_moe/utils.py index 4adb7f1cf..c733f233f 100644 --- a/vllm/model_executor/layers/fused_moe/utils.py +++ b/vllm/model_executor/layers/fused_moe/utils.py @@ -316,27 +316,6 @@ def normalize_batched_scales_shape( return scales -def _validate_scale_shape( - a: torch.Tensor, - a_scale: torch.Tensor | None, - per_act_token_quant: bool, - block_shape: list[int] | None, -) -> None: - if a_scale is None: - return - - if not per_act_token_quant and block_shape is None: - assert a_scale.numel() == 1, f"{a_scale.shape}" - elif per_act_token_quant: - assert a_scale.shape[0] == a.shape[0] and a_scale.shape[1] == 1, ( - f"{a_scale.shape[0]} == {a.shape[0]} and {a_scale.shape[1]} == 1" - ) - else: - assert block_shape is not None - expected = (a.shape[0], cdiv(a.shape[1], block_shape[1])) - assert a_scale.shape == expected, f"{a_scale.shape} == {expected}" - - # Torch custom ops can't deal with outputs aliasing inputs so we need to # disable inplace for torch >= 2.9. # See https://github.com/vllm-project/vllm/issues/26378