[Diffusion] Enable Cosmos3 denoising profiling (#27439)
This commit is contained in:
+9
@@ -41,6 +41,7 @@ from sglang.multimodal_gen.runtime.pipelines_core.stages.validators import (
|
|||||||
from sglang.multimodal_gen.runtime.platforms import current_platform
|
from sglang.multimodal_gen.runtime.platforms import current_platform
|
||||||
from sglang.multimodal_gen.runtime.server_args import ServerArgs
|
from sglang.multimodal_gen.runtime.server_args import ServerArgs
|
||||||
from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
from sglang.multimodal_gen.runtime.utils.logging_utils import init_logger
|
||||||
|
from sglang.multimodal_gen.runtime.utils.profiler import SGLDiffusionProfiler
|
||||||
from sglang.srt.utils.common import get_compiler_backend
|
from sglang.srt.utils.common import get_compiler_backend
|
||||||
|
|
||||||
logger = init_logger(__name__)
|
logger = init_logger(__name__)
|
||||||
@@ -484,6 +485,11 @@ class Cosmos3DenoisingStage(PipelineStage):
|
|||||||
result.add_check("timesteps", batch.timesteps, V.is_tensor)
|
result.add_check("timesteps", batch.timesteps, V.is_tensor)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def step_profile(self):
|
||||||
|
profiler = SGLDiffusionProfiler.get_instance()
|
||||||
|
if profiler:
|
||||||
|
profiler.step_denoising_step()
|
||||||
|
|
||||||
def _run_transformer(
|
def _run_transformer(
|
||||||
self,
|
self,
|
||||||
latents: torch.Tensor,
|
latents: torch.Tensor,
|
||||||
@@ -700,6 +706,9 @@ class Cosmos3DenoisingStage(PipelineStage):
|
|||||||
if image_latent is not None:
|
if image_latent is not None:
|
||||||
latents[:, :, 0:1, :, :] = image_latent
|
latents[:, :, 0:1, :, :] = image_latent
|
||||||
|
|
||||||
|
if batch.profile and not batch.is_warmup:
|
||||||
|
self.step_profile()
|
||||||
|
|
||||||
batch.latents = latents
|
batch.latents = latents
|
||||||
self.log_info("Denoising complete")
|
self.log_info("Denoising complete")
|
||||||
return batch
|
return batch
|
||||||
|
|||||||
Reference in New Issue
Block a user