[Mini-vLLM] Cut dead subsystems: models, entrypoints, backends, utils, tests
- Drop dead model modules, keeping files live imports require - Remove anthropic, cohere, codegen entrypoints and batch STT modes - Delete unused attention backends, MoE experts, and NPU/XPU util leaves - Strip dead third_party trees and ROCm leaves with no CUDA path - Remove mooncake EC connectors: dependency missing since branch base - Re-audit verified by full import sweep and Qwen3.5 smoke test Co-authored-by: Hinata <hinata@idihore.id> Signed-off-by: MOVZX <movzx@yahoo.com>
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Canvas-width handling and async read deferral for diffusion requests."""
|
||||
|
||||
from vllm.v1.core.sched.async_scheduler import AsyncScheduler
|
||||
from vllm.v1.core.sched.output import SchedulerOutput
|
||||
from vllm.v1.core.sched.scheduler import Scheduler
|
||||
from vllm.v1.outputs import DraftTokenIds
|
||||
from vllm.v1.request import Request
|
||||
|
||||
|
||||
def diffusion_canvas_width(request: Request, canvas_length: int) -> int:
|
||||
"""The canvas width a diffusion request asked for, else the served one."""
|
||||
params = request.sampling_params
|
||||
extra = params.extra_args if params is not None else None
|
||||
width = extra.get("diffusion_canvas_length") if extra else None
|
||||
return int(width) if width else canvas_length
|
||||
|
||||
|
||||
def _read_in_flight(request: Request, width: int) -> bool:
|
||||
"""True when a read-only request has all its denoise steps in flight.
|
||||
|
||||
The request emits its canvas on the last step and ends, so a further
|
||||
step is discarded.
|
||||
"""
|
||||
params = request.sampling_params
|
||||
extra = params.extra_args if params is not None else None
|
||||
if not extra or not extra.get("diffusion_read_only"):
|
||||
return False
|
||||
steps = extra.get("diffusion_max_steps")
|
||||
if not steps:
|
||||
return False
|
||||
# Each in-flight denoise step holds one canvas of placeholders.
|
||||
return request.num_output_placeholders >= steps * width
|
||||
|
||||
|
||||
class DiffusionScheduler(Scheduler):
|
||||
def update_draft_token_ids(self, draft_token_ids: DraftTokenIds) -> None:
|
||||
for i, (req_id, token_ids) in enumerate(
|
||||
zip(draft_token_ids.req_ids, draft_token_ids.draft_token_ids)
|
||||
):
|
||||
request = self.requests.get(req_id)
|
||||
if request is None:
|
||||
continue
|
||||
width = diffusion_canvas_width(request, self.num_spec_tokens)
|
||||
# Remove padded positions before the base scheduler validates grammar.
|
||||
if len(token_ids) > width:
|
||||
draft_token_ids.draft_token_ids[i] = token_ids[:width]
|
||||
super().update_draft_token_ids(draft_token_ids)
|
||||
|
||||
|
||||
class DiffusionAsyncScheduler(DiffusionScheduler, AsyncScheduler):
|
||||
def schedule(self, throttle_prefills: bool = False) -> SchedulerOutput:
|
||||
for request in self.running:
|
||||
width = diffusion_canvas_width(request, self.num_spec_tokens)
|
||||
# The placeholders are as wide as the served canvas.
|
||||
if len(request.spec_token_ids) > width:
|
||||
request.spec_token_ids = request.spec_token_ids[:width]
|
||||
if _read_in_flight(request, width):
|
||||
# Scheduler.schedule()'s max_tokens guard cannot be reached
|
||||
# from a subclass. schedule() advances current_step before it
|
||||
# checks decode eligibility, so current_step + 2 skips this
|
||||
# call alone. max keeps a longer pipeline-parallel wait.
|
||||
request.next_decode_eligible_step = max(
|
||||
request.next_decode_eligible_step, self.current_step + 2
|
||||
)
|
||||
return super().schedule(throttle_prefills)
|
||||
Reference in New Issue
Block a user