[Rebase] Rebase to vllm v0.24.0 (#4709)
This commit is contained in:
1 parent
9a105bf90d
commit
a560ed184d
60 files changed
+789
-203
No files matched your search
@@ -53,7 +53,6 @@ from vllm_omni.diffusion.models.dreamzero.utils import (
|
||||
)
|
||||
from vllm_omni.diffusion.models.schedulers.scheduling_flow_unipc_multistep import FlowUniPCMultistepScheduler
|
||||
from vllm_omni.diffusion.worker.request_batch import DiffusionRequestBatch
|
||||
from vllm_omni.platforms import current_omni_platform
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
MAX_DREAMZERO_SESSIONS = 64
|
||||
@@ -487,10 +486,12 @@ class DreamZeroPipeline(nn.Module, CFGParallelMixin):
|
||||
latents: tuple[torch.Tensor, torch.Tensor],
|
||||
do_true_cfg: bool,
|
||||
) -> tuple[torch.Tensor, torch.Tensor]:
|
||||
"""Post-step sync: .contiguous() + platform synchronize."""
|
||||
"""Post-step sync: .contiguous() + cuda.synchronize()"""
|
||||
latents = tuple(t.contiguous() for t in latents)
|
||||
if do_true_cfg and get_classifier_free_guidance_world_size() > 1:
|
||||
current_omni_platform.synchronize()
|
||||
device = next((t.device for t in latents if t.is_cuda), None)
|
||||
if device is not None:
|
||||
torch.cuda.current_stream(device).synchronize()
|
||||
return latents
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
@@ -284,10 +284,17 @@ class HeliosPipeline(
|
||||
) -> DiffusionRequestState:
|
||||
"""Initialize Helios request state for chunk-wise step execution."""
|
||||
del kwargs
|
||||
req = OmniDiffusionRequest(
|
||||
prompt=state.prompt,
|
||||
sampling_params=state.sampling,
|
||||
request_id=state.request_id,
|
||||
# Wrap the single request in a DiffusionRequestBatch so the batch
|
||||
# compatibility properties (`prompts`, etc.) used below are available;
|
||||
# OmniDiffusionRequest itself only exposes a singular `prompt`.
|
||||
req = DiffusionRequestBatch(
|
||||
requests=[
|
||||
OmniDiffusionRequest(
|
||||
prompt=state.prompt,
|
||||
sampling_params=state.sampling,
|
||||
request_id=state.request_id,
|
||||
)
|
||||
]
|
||||
)
|
||||
extra = getattr(state.sampling, "extra_args", {}) or {}
|
||||
|
||||
|
||||
@@ -1282,10 +1282,14 @@ class LTX2TwoStagesPipeline(nn.Module, SupportsComponentDiscovery):
|
||||
self.pipe.scheduler = new_scheduler
|
||||
|
||||
# We only want to change num_inference_steps here, so no need
|
||||
# to deep copy the whole request
|
||||
# to deep copy the whole request. `req` is a DiffusionRequestBatch
|
||||
# whose `sampling_params` is a read-only property, so clone the
|
||||
# underlying request(s) and override their sampling params instead.
|
||||
stage_2_req = copy.copy(req)
|
||||
stage_2_req.sampling_params = req.sampling_params.clone()
|
||||
stage_2_req.sampling_params.num_inference_steps = 3
|
||||
stage_2_req.requests = [copy.copy(r) for r in req.requests]
|
||||
for stage_2_request in stage_2_req.requests:
|
||||
stage_2_request.sampling_params = stage_2_request.sampling_params.clone()
|
||||
stage_2_request.sampling_params.num_inference_steps = 3
|
||||
|
||||
stage2_output = self.pipe(
|
||||
req=stage_2_req,
|
||||
|
||||
@@ -870,9 +870,14 @@ class LTX2ImageToVideoTwoStagesPipeline(nn.Module, SupportsComponentDiscovery):
|
||||
)
|
||||
self.pipe.scheduler = new_scheduler
|
||||
|
||||
# `req` is a DiffusionRequestBatch whose `sampling_params` is a
|
||||
# read-only property; clone the underlying request(s) and override
|
||||
# their sampling params instead of assigning to the batch.
|
||||
stage_2_req = copy.copy(req)
|
||||
stage_2_req.sampling_params = req.sampling_params.clone()
|
||||
stage_2_req.sampling_params.num_inference_steps = 3
|
||||
stage_2_req.requests = [copy.copy(r) for r in req.requests]
|
||||
for stage_2_request in stage_2_req.requests:
|
||||
stage_2_request.sampling_params = stage_2_request.sampling_params.clone()
|
||||
stage_2_request.sampling_params.num_inference_steps = 3
|
||||
|
||||
stage2_output = self.pipe(
|
||||
req=stage_2_req,
|
||||
|
||||
Reference in new issue
Block a user