[Performance] diffusion timing (#1757)
Signed-off-by: dengyunyang <584797741@qq.com> Signed-off-by: bjf-frz <frz123db@gmail.com> Signed-off-by: Didan Deng <33117903+wtomin@users.noreply.github.com> Co-authored-by: bjf-frz <frz123db@gmail.com> Co-authored-by: Didan Deng <33117903+wtomin@users.noreply.github.com>
This commit is contained in:
43 files changed
+496
-38
No files matched your search
@@ -33,6 +33,7 @@ from vllm_omni.diffusion.models.nextstep_1_1.modeling_nextstep import (
|
||||
NextStepConfig,
|
||||
NextStepModel,
|
||||
)
|
||||
from vllm_omni.diffusion.profiler.diffusion_pipeline_profiler import DiffusionPipelineProfilerMixin
|
||||
from vllm_omni.diffusion.request import OmniDiffusionRequest
|
||||
from vllm_omni.model_executor.model_loader.weight_utils import (
|
||||
download_weights_from_hf_specific,
|
||||
@@ -130,7 +131,7 @@ def get_nextstep11_post_process_func(od_config: OmniDiffusionConfig):
|
||||
return post_process_func
|
||||
|
||||
|
||||
class NextStep11Pipeline(nn.Module):
|
||||
class NextStep11Pipeline(nn.Module, DiffusionPipelineProfilerMixin):
|
||||
"""
|
||||
NextStep-1.1 Pipeline for text-to-image generation.
|
||||
|
||||
@@ -232,6 +233,9 @@ class NextStep11Pipeline(nn.Module):
|
||||
allow_patterns_overrides=["model-*.safetensors", "model.safetensors"],
|
||||
)
|
||||
]
|
||||
self.setup_diffusion_pipeline_profiler(
|
||||
enable_diffusion_pipeline_profiler=self.od_config.enable_diffusion_pipeline_profiler
|
||||
)
|
||||
|
||||
@property
|
||||
def device(self):
|
||||
@@ -702,7 +706,9 @@ class NextStep11Pipeline(nn.Module):
|
||||
sampled_images = self.vae.decode(latents.to(self.vae.dtype)).sample
|
||||
sampled_images = sampled_images.detach().cpu().to(torch.float32)
|
||||
|
||||
return DiffusionOutput(output=sampled_images)
|
||||
return DiffusionOutput(
|
||||
output=sampled_images, stage_durations=self.stage_durations if hasattr(self, "stage_durations") else None
|
||||
)
|
||||
|
||||
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
|
||||
"""Load model weights."""
|
||||
|
||||
Reference in new issue
Block a user