From ceb87de065b9cbdaffd34a0e6aed86c99e772b95 Mon Sep 17 00:00:00 2001 From: Adababy Date: Wed, 16 Sep 2026 17:17:07 +0800 Subject: [PATCH] [Misc] Remove no-op self-assignments across vLLM (#55988) Signed-off-by: shaolila Co-authored-by: shaolila --- .../layers/fused_moe/routed_experts.py | 15 ++++++++------- vllm/model_executor/models/deepencoder.py | 4 +--- vllm/model_executor/models/mimo_v2_omni.py | 1 - vllm/model_executor/models/step3p5.py | 1 - 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/vllm/model_executor/layers/fused_moe/routed_experts.py b/vllm/model_executor/layers/fused_moe/routed_experts.py index 2dafb6c493..257e19b034 100644 --- a/vllm/model_executor/layers/fused_moe/routed_experts.py +++ b/vllm/model_executor/layers/fused_moe/routed_experts.py @@ -615,14 +615,15 @@ class RoutedExperts(PluggableLayer): # compressed-tensors checkpoints with packed weights are stored flipped # TODO (mgoin): check self.quant_method.quant_config.quant_format # against known CompressionFormat enum values that have this quality - if quant_method_name in ( - "CompressedTensorsWNA16MoEMethod", - "CompressedTensorsW4A16FlydslMoEMethod", + if ( + quant_method_name + in ( + "CompressedTensorsWNA16MoEMethod", + "CompressedTensorsW4A16FlydslMoEMethod", + ) + and is_transposed ): - if is_transposed: - loaded_weight = loaded_weight.t().contiguous() - else: - loaded_weight = loaded_weight + loaded_weight = loaded_weight.t().contiguous() if shard_id not in ("w1", "w2", "w3"): raise ValueError(f"shard_id must be ['w1','w2','w3'] but got {shard_id}.") diff --git a/vllm/model_executor/models/deepencoder.py b/vllm/model_executor/models/deepencoder.py index 189e8b55e5..d75e5bb77d 100644 --- a/vllm/model_executor/models/deepencoder.py +++ b/vllm/model_executor/models/deepencoder.py @@ -780,9 +780,7 @@ class DeepCLIPVisionEmbeddings(CLIPVisionEmbeddings): self, pixel_values: torch.Tensor, patch_embeds: torch.Tensor | None = None ) -> torch.Tensor: batch_size = pixel_values.shape[0] - if patch_embeds is not None: - patch_embeds = patch_embeds - else: + if patch_embeds is None: patch_embeds = self.patch_embedding(pixel_values) patch_embeds = patch_embeds.flatten(2).transpose(1, 2) diff --git a/vllm/model_executor/models/mimo_v2_omni.py b/vllm/model_executor/models/mimo_v2_omni.py index 93bd6a44b5..9281a1689a 100644 --- a/vllm/model_executor/models/mimo_v2_omni.py +++ b/vllm/model_executor/models/mimo_v2_omni.py @@ -964,7 +964,6 @@ class MiMoV2OmniMultiModalProcessor(BaseMultiModalProcessor[MiMoV2OmniProcessing assert isinstance(va_item, (list, tuple)) and len(va_item) == 2 vid, audio_src = va_item va_item = VideoAudioInput(video=vid, audio=audio_src) - vid = vid # Convert video frames to (TCHW, timestamps) if needed if ( isinstance(vid, tuple) diff --git a/vllm/model_executor/models/step3p5.py b/vllm/model_executor/models/step3p5.py index 3a928aa59d..03343a89a1 100644 --- a/vllm/model_executor/models/step3p5.py +++ b/vllm/model_executor/models/step3p5.py @@ -173,7 +173,6 @@ class Step3p5Attention(nn.Module): rope_scaling = None if sliding_window is not None and enable_sliding_window: - sliding_window = sliding_window if swa_num_attention_heads is not None: num_heads = swa_num_attention_heads self.total_num_heads = swa_num_attention_heads