A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 5, 12:15 UTC
[Refactor] Remove unused dead code (#38842)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
Wentao Ye committed
Apr 6, 2026 at 11:52 UTC
4ae218c122f768ed9e2ff454b8567fd8c9373f6d
3 files changed
-74
vllm/model_executor/models/mlp_speculator.py
-53
@@ -17,8 +17,6 @@ from vllm.model_executor.model_loader.weight_utils import default_weight_loader
17
18
from .utils import maybe_prefix
19
20
-SQRT2 = 2**0.5
21
-
20
21
class MLPSpeculatorLayerNorm(nn.Module):
22
"""
@@ -171,57 +169,6 @@ class MLPSpeculator(nn.Module):
169
config.vocab_size, config.vocab_size, 1.0
170
)
171
174
- # NOTE(woosuk): This method is commented out because it is old code
175
- # using V0. We should either port it to V1 or remove it.
176
-
177
- # def generate_proposals(
178
- # self,
179
- # input_ids: torch.Tensor,
180
- # previous_hidden_states: torch.Tensor,
181
- # num_predict_tokens: int,
182
- # sampling_metadata: SamplingMetadata,
183
- # ) -> list[SamplerOutput]:
184
- # if num_predict_tokens > self.max_speculative_tokens:
185
- # raise ValueError(f"Max speculative tokens for model is "
186
- # f"{self.max_speculative_tokens}, but "
187
- # f"{num_predict_tokens} were requested")
188
-
189
- # # b x 1 x d
190
- # previous_hidden_states = previous_hidden_states.unsqueeze(1)
191
-
192
- # if self.scale_input:
193
- # previous_hidden_states = self.ln0(previous_hidden_states) / SQRT2
194
-
195
- # # b x 1
196
- # last_tokens = input_ids.unsqueeze(1)
197
-
198
- # next_tokens = []
199
-
200
- # for head_index in range(num_predict_tokens):
201
-
202
- # # Project and predict
203
- # z = self.emb[head_index](last_tokens) # b k d
204
- # states = self.proj[head_index](previous_hidden_states)
205
-
206
- # # Weighted add of state_weight*state and emb_weight*z
207
- # # Let subsequent LN take care of denominator
208
- # # state_weight is close to 1, so shouldn't be any precision issues
209
- # states.add_(z, alpha=self.emb_weight / self.state_weight)
210
-
211
- # states = self.activation(self.ln[head_index](states)) # b k d
212
- # previous_hidden_states = states
213
- # # TODO: not yet supporting top_k_tokens_per_head
214
- # states = states.flatten(0, 1)
215
-
216
- # logits = self.logits_processor(self.head[head_index], states,
217
- # sampling_metadata)
218
-
219
- # output = self.sampler(logits, sampling_metadata)
220
- # last_tokens = output.sampled_token_ids
221
- # next_tokens.append(output)
222
-
223
- # return next_tokens
224
-
172
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
173
params_dict = dict(self.named_parameters())
174
loaded_params: set[str] = set()
vllm/v1/attention/ops/flashmla.py
-13
@@ -151,16 +151,3 @@ def flash_mla_with_kvcache_fp8(
151
descale_k,
152
)
153
return out, softmax_lse
154
-
155
-
156
-#
157
-# TODO: Add fake functions
158
-#
159
-# @register_fake("_flashmla_C::get_mla_metadata")
160
-# def _get_mla_metadata_fake(....) -> Tuple[torch.Tensor, torch.Tensor]:
161
-# return ....
162
-#
163
-# @register_fake("_flashmla_C::fwd_kvcache_mla")
164
-# def _fwd_kvcache_mla_fake(....) -> Tuple[torch.Tensor, torch.Tensor]:
165
-# return ....
166
-#
vllm/v1/executor/ray_distributed_executor.py
deleted
-8
@@ -1,8 +0,0 @@
1
-# SPDX-License-Identifier: Apache-2.0
2
-# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
-from vllm.v1.executor.ray_executor import (
4
- RayDistributedExecutor as _RayDistributedExecutor,
5
-)
6
-
7
-# For backwards compatibility.
8
-RayDistributedExecutor = _RayDistributedExecutor