[Refactor] Remove unused dead code (#40640)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-04-25 07:28:18 +08:00
committed by GitHub
parent ce6a199ecc
commit a474da2813
4 changed files with 4 additions and 22 deletions
-5
View File
@@ -1,8 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import numpy as np
import torch
import torch.distributed as dist
@@ -167,7 +165,6 @@ def coordinate_batch_across_dp(
parallel_config: ParallelConfig,
num_tokens_padded: int | None = None,
uniform_decode: bool | None = None,
num_scheduled_tokens_per_request: np.ndarray | None = None,
cudagraph_mode: int = 0,
) -> tuple[bool, torch.Tensor | None, int]:
"""
@@ -182,8 +179,6 @@ def coordinate_batch_across_dp(
TP, etc)
uniform_decode: Only used if allow_microbatching is True. True if the batch
only contains single token decodes
num_scheduled_tokens_per_request: Only used if allow_microbatching is True. The
number of tokens per request.
cudagraph_mode: The cudagraph mode for this rank (0=NONE, 1=PIECEWISE, 2=FULL).
DP padding is enabled when synced cudagraph mode across ranks is not NONE.
-6
View File
@@ -13,12 +13,6 @@ from vllm.v1.worker.gpu.cudagraph_utils import (
)
def make_num_tokens_across_dp(dp_size: int, num_tokens: int) -> torch.Tensor | None:
if dp_size == 1:
return None
return torch.full((dp_size,), num_tokens, dtype=torch.int32, device="cpu")
def sync_cudagraph_and_dp_padding(
cudagraph_manager: CudaGraphManager | None,
desired_batch_desc: BatchExecutionDescriptor,
+1 -6
View File
@@ -3362,7 +3362,6 @@ class GPUModelRunner(
logits: torch.Tensor | None,
hidden_states: torch.Tensor,
num_scheduled_tokens: int,
spec_decode_metadata: SpecDecodeMetadata | None,
) -> tuple[
dict[str, int],
LogprobsLists | None,
@@ -3630,7 +3629,6 @@ class GPUModelRunner(
allow_microbatching=allow_microbatching,
num_tokens_padded=num_tokens_padded,
uniform_decode=uniform_decode,
num_scheduled_tokens_per_request=num_scheduled_tokens_np,
cudagraph_mode=cudagraph_mode.value,
)
)
@@ -4308,7 +4306,6 @@ class GPUModelRunner(
logits,
hidden_states,
scheduler_output.total_num_scheduled_tokens,
spec_decode_metadata,
)
if propose_drafts_after_bookkeeping:
@@ -6540,7 +6537,6 @@ class GPUModelRunner(
def _reshape_kv_cache_tensors(
self,
kv_cache_config: KVCacheConfig,
kv_cache_raw_tensors: dict[str, torch.Tensor],
kernel_block_sizes: list[int],
) -> dict[str, torch.Tensor]:
@@ -6548,7 +6544,6 @@ class GPUModelRunner(
Reshape the KV cache tensors to the desired shape and dtype.
Args:
kv_cache_config: The KV cache config
kv_cache_raw_tensors: The KV cache buffer of each layer, with
correct size but uninitialized shape.
kernel_block_sizes: The kernel block sizes for each KV cache group.
@@ -6712,7 +6707,7 @@ class GPUModelRunner(
# Change the memory buffer to the desired shape
kv_caches = self._reshape_kv_cache_tensors(
kv_cache_config, kv_cache_raw_tensors, kernel_block_sizes
kv_cache_raw_tensors, kernel_block_sizes
)
# Set up cross-layer KV cache sharing