diff --git a/python/sglang/multimodal_gen/benchmarks/bench_serving.py b/python/sglang/multimodal_gen/benchmarks/bench_serving.py index 5044581eb..63eaf5c4c 100644 --- a/python/sglang/multimodal_gen/benchmarks/bench_serving.py +++ b/python/sglang/multimodal_gen/benchmarks/bench_serving.py @@ -3,8 +3,18 @@ Benchmark online serving for diffusion models (Image/Video Generation). Usage: - + # Video t2v: + python3 -m sglang.multimodal_gen.benchmarks.bench_serving \ + --backend sglang-video --dataset vbench --task t2v --num-prompts 20 + + i2v: + python3 -m sglang.multimodal_gen.benchmarks.bench_serving \ + --backend sglang-video --dataset vbench --task i2v --num-prompts 20 + + + # Image + t2i: python3 -m sglang.multimodal_gen.benchmarks.bench_serving \ --backend sglang-image --dataset vbench --task t2v --num-prompts 20 @@ -13,8 +23,6 @@ Usage: --backend sglang-image --dataset vbench --task i2v --num-prompts 20 - - """ import argparse diff --git a/python/sglang/multimodal_gen/configs/sample/sampling_params.py b/python/sglang/multimodal_gen/configs/sample/sampling_params.py index cae219655..e9b733d81 100644 --- a/python/sglang/multimodal_gen/configs/sample/sampling_params.py +++ b/python/sglang/multimodal_gen/configs/sample/sampling_params.py @@ -258,7 +258,7 @@ class SamplingParams: if pipeline_config.task_type.is_image_gen(): # settle num_frames - logger.debug(f"Setting num_frames to 1 because this is an image-gen model") + logger.debug(f"num_frames set to 1 for image generation model") self.num_frames = 1 self.data_type = DataType.IMAGE elif self.adjust_frames: diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/__init__.py b/python/sglang/multimodal_gen/runtime/entrypoints/__init__.py index af2eb7d10..362da9eaf 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/__init__.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/__init__.py @@ -1 +1,7 @@ # Copied and adapted from: https://github.com/hao-ai-lab/FastVideo +from sglang.multimodal_gen.runtime.utils.logging_utils import suppress_loggers + +# globally suppress some obsessive loggers +suppress_loggers( + ["imageio", "imageio_ffmpeg", "PIL", "PIL_Image", "multipart", "filelock"] +) diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py b/python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py index f1075d190..88784a58c 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py @@ -34,11 +34,8 @@ from sglang.multimodal_gen.runtime.utils.logging_utils import ( init_logger, log_batch_completion, log_generation_timer, - suppress_loggers, ) -suppress_loggers(["imageio", "imageio_ffmpeg", "PIL", "PIL_Image"]) - logger = init_logger(__name__) # TODO: move to somewhere appropriate @@ -52,7 +49,6 @@ except RuntimeError: pass -# TODO: rename class DiffGenerator: """ A unified class for generating images/videos using diffusion models. @@ -413,9 +409,6 @@ class DiffGenerator: sync_scheduler_client.close() self.owns_scheduler_client = False - def __enter__(self): - return self - def __exit__(self, exc_type, exc_val, exc_tb): self.shutdown() diff --git a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/input_validation.py b/python/sglang/multimodal_gen/runtime/pipelines_core/stages/input_validation.py index 7d68a14a4..3276e6bad 100644 --- a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/input_validation.py +++ b/python/sglang/multimodal_gen/runtime/pipelines_core/stages/input_validation.py @@ -294,16 +294,6 @@ class InputValidationStage(PipelineStage): result = VerificationResult() result.add_check("height", batch.height, V.positive_int) result.add_check("width", batch.width, V.positive_int) - - # Validate height and width - def check_size(value: int, name: str): - if value % (8 * server_args.num_gpus) != 0: - raise ValueError( - f"{name} must be divisible by (8 x num_gpus) but {value} % (8 * {server_args.num_gpus}) != 0." - ) - - check_size(batch.height, "Height") - check_size(batch.width, "Width") result.add_check("seeds", batch.seeds, V.list_not_empty) result.add_check("generator", batch.generator, V.generator_or_list_generators) return result