diff --git a/python/sglang/multimodal_gen/configs/sample/hunyuan.py b/python/sglang/multimodal_gen/configs/sample/hunyuan.py index d6e33a81c..ae69dbd62 100644 --- a/python/sglang/multimodal_gen/configs/sample/hunyuan.py +++ b/python/sglang/multimodal_gen/configs/sample/hunyuan.py @@ -18,6 +18,24 @@ class HunyuanSamplingParams(SamplingParams): guidance_scale: float = 1.0 + # HunyuanVideo supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + # 540p resolutions + (960, 544), # 9:16 + (544, 960), # 16:9 + (832, 624), # 4:3 + (624, 832), # 3:4 + (720, 720), # 1:1 + # 720p resolutions (recommended) + (1280, 720), # 9:16 + (720, 1280), # 16:9 + (832, 1104), # 4:3 + (1104, 832), # 3:4 + (960, 960), # 1:1 + ] + ) + teacache_params: TeaCacheParams = field( default_factory=lambda: TeaCacheParams( teacache_thresh=0.15, diff --git a/python/sglang/multimodal_gen/configs/sample/sampling_params.py b/python/sglang/multimodal_gen/configs/sample/sampling_params.py index 3beb3c0d1..98bdc2a50 100644 --- a/python/sglang/multimodal_gen/configs/sample/sampling_params.py +++ b/python/sglang/multimodal_gen/configs/sample/sampling_params.py @@ -115,6 +115,11 @@ class SamplingParams: width_not_provided: bool = False fps: int = 24 + # Resolution validation + supported_resolutions: list[tuple[int, int]] | None = ( + None # None means all resolutions allowed + ) + # Denoising parameters num_inference_steps: int = None guidance_scale: float = None @@ -223,6 +228,27 @@ class SamplingParams: f"num_frames={self.num_frames}" ) + # Validate resolution against pipeline-specific supported resolutions + if self.height is None and self.width is None: + if self.supported_resolutions is not None: + self.width, self.height = self.supported_resolutions[0] + logger.info( + f"Resolution unspecified, using default: {self.supported_resolutions[0]}" + ) + + if self.height is not None and self.width is not None: + if self.supported_resolutions is not None: + if (self.width, self.height) not in self.supported_resolutions: + supported_str = ", ".join( + [f"{w}x{h}" for w, h in self.supported_resolutions] + ) + error_msg = ( + f"Unsupported resolution: {self.width}x{self.height}. " + f"Supported resolutions: {supported_str}" + ) + logger.error(error_msg) + raise ValueError(error_msg) + 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") @@ -558,7 +584,9 @@ class SamplingParams: args.width = 1280 args.height = 720 - attrs = [attr.name for attr in dataclasses.fields(cls)] + sampling_params_fields = {attr.name for attr in dataclasses.fields(cls)} + args_attrs = set(vars(args).keys()) + attrs = sampling_params_fields & args_attrs args.height_not_provided = False args.width_not_provided = False return {attr: getattr(args, attr) for attr in attrs} diff --git a/python/sglang/multimodal_gen/configs/sample/wan.py b/python/sglang/multimodal_gen/configs/sample/wan.py index 9a23fb0bf..839dc4049 100644 --- a/python/sglang/multimodal_gen/configs/sample/wan.py +++ b/python/sglang/multimodal_gen/configs/sample/wan.py @@ -22,6 +22,14 @@ class WanT2V_1_3B_SamplingParams(SamplingParams): ) num_inference_steps: int = 50 + # Wan T2V 1.3B supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + teacache_params: WanTeaCacheParams = field( default_factory=lambda: WanTeaCacheParams( teacache_thresh=0.08, @@ -58,6 +66,16 @@ class WanT2V_14B_SamplingParams(SamplingParams): ) num_inference_steps: int = 50 + # Wan T2V 14B supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (1280, 720), # 16:9 + (720, 1280), # 9:16 + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + teacache_params: WanTeaCacheParams = field( default_factory=lambda: WanTeaCacheParams( teacache_thresh=0.20, @@ -87,6 +105,14 @@ class WanI2V_14B_480P_SamplingParam(WanT2V_1_3B_SamplingParams): num_inference_steps: int = 50 # num_inference_steps: int = 40 + # Wan I2V 480P supported resolutions (override parent) + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + teacache_params: WanTeaCacheParams = field( default_factory=lambda: WanTeaCacheParams( teacache_thresh=0.26, @@ -115,6 +141,16 @@ class WanI2V_14B_720P_SamplingParam(WanT2V_14B_SamplingParams): num_inference_steps: int = 50 # num_inference_steps: int = 40 + # Wan I2V 720P supported resolutions (override parent) + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (1280, 720), # 16:9 + (720, 1280), # 9:16 + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + teacache_params: WanTeaCacheParams = field( default_factory=lambda: WanTeaCacheParams( teacache_thresh=0.3, @@ -188,6 +224,14 @@ class Wan2_2_TI2V_5B_SamplingParam(Wan2_2_Base_SamplingParams): guidance_scale: float = 5.0 num_inference_steps: int = 50 + # Wan2.2 TI2V 5B supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (1280, 704), # 16:9-ish + (704, 1280), # 9:16-ish + ] + ) + @dataclass class Wan2_2_T2V_A14B_SamplingParam(Wan2_2_Base_SamplingParams): @@ -198,6 +242,16 @@ class Wan2_2_T2V_A14B_SamplingParam(Wan2_2_Base_SamplingParams): # NOTE(will): default boundary timestep is tracked by PipelineConfig, but # can be overridden during sampling + # Wan2.2 T2V A14B supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (1280, 720), # 16:9 + (720, 1280), # 9:16 + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + @dataclass class Wan2_2_I2V_A14B_SamplingParam(Wan2_2_Base_SamplingParams): @@ -208,6 +262,16 @@ class Wan2_2_I2V_A14B_SamplingParam(Wan2_2_Base_SamplingParams): # NOTE(will): default boundary timestep is tracked by PipelineConfig, but # can be overridden during sampling + # Wan2.2 I2V A14B supported resolutions + supported_resolutions: list[tuple[int, int]] | None = field( + default_factory=lambda: [ + (1280, 720), # 16:9 + (720, 1280), # 9:16 + (832, 480), # 16:9 + (480, 832), # 9:16 + ] + ) + # ============================================= # ============= Causal Self-Forcing ============= diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py b/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py index ba8607dac..9153e3c5d 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/http_server.py @@ -6,8 +6,7 @@ from contextlib import asynccontextmanager from fastapi import APIRouter, FastAPI from sglang.multimodal_gen.runtime.entrypoints.openai import image_api, video_api -from sglang.multimodal_gen.runtime.server_args import ServerArgs, prepare_server_args -from sglang.multimodal_gen.runtime.utils.logging_utils import configure_logger +from sglang.multimodal_gen.runtime.server_args import ServerArgs @asynccontextmanager @@ -63,18 +62,3 @@ def create_app(server_args: ServerArgs): app.state.server_args = server_args return app - - -if __name__ == "__main__": - import uvicorn - - server_args = prepare_server_args([]) - configure_logger(server_args) - app = create_app(server_args) - uvicorn.run( - app, - host=server_args.host, - port=server_args.port, - use_colors=True, - reload=False, # Set to True during development for auto-reloading - ) diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/openai/protocol.py b/python/sglang/multimodal_gen/runtime/entrypoints/openai/protocol.py index d8fdd7c42..bafb97cce 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/openai/protocol.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/openai/protocol.py @@ -39,7 +39,7 @@ class VideoResponse(BaseModel): status: str = "queued" progress: int = 0 created_at: int = Field(default_factory=lambda: int(time.time())) - size: str = "720x1280" + size: str = "" seconds: str = "4" quality: str = "standard" remixed_from_video_id: Optional[str] = None @@ -53,7 +53,7 @@ class VideoGenerationsRequest(BaseModel): input_reference: Optional[str] = None model: Optional[str] = None seconds: Optional[int] = 4 - size: Optional[str] = "720x1280" + size: Optional[str] = "" fps: Optional[int] = None num_frames: Optional[int] = None seed: Optional[int] = 1024 diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/openai/utils.py b/python/sglang/multimodal_gen/runtime/entrypoints/openai/utils.py index 8607f06ad..4e09b34df 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/openai/utils.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/openai/utils.py @@ -79,7 +79,7 @@ def post_process_sample( return frames -def _parse_size(size: str) -> tuple[int, int]: +def _parse_size(size: str) -> tuple[int, int] | tuple[None, None]: try: parts = size.lower().replace(" ", "").split("x") if len(parts) != 2: @@ -88,7 +88,7 @@ def _parse_size(size: str) -> tuple[int, int]: return w, h except Exception: # Fallback to default portrait 720x1280 - return 720, 1280 + return None, None # Helpers diff --git a/python/sglang/multimodal_gen/runtime/entrypoints/openai/video_api.py b/python/sglang/multimodal_gen/runtime/entrypoints/openai/video_api.py index 6f6743a47..0b68efaea 100644 --- a/python/sglang/multimodal_gen/runtime/entrypoints/openai/video_api.py +++ b/python/sglang/multimodal_gen/runtime/entrypoints/openai/video_api.py @@ -166,7 +166,7 @@ async def create_video( input_reference=input_path, model=model, seconds=seconds if seconds is not None else 4, - size=size or "720x1280", + size=size, fps=fps_val, num_frames=num_frames_val, ) diff --git a/python/sglang/multimodal_gen/test/run_suite.py b/python/sglang/multimodal_gen/test/run_suite.py index 579a9493b..26578edbd 100644 --- a/python/sglang/multimodal_gen/test/run_suite.py +++ b/python/sglang/multimodal_gen/test/run_suite.py @@ -117,6 +117,7 @@ def run_pytest(files): if not is_perf_assertion: return returncode + logger.info(f"Max retry exceeded") return returncode diff --git a/python/sglang/multimodal_gen/test/server/perf_baselines.json b/python/sglang/multimodal_gen/test/server/perf_baselines.json index dc3cdc0c3..15a0d3083 100644 --- a/python/sglang/multimodal_gen/test/server/perf_baselines.json +++ b/python/sglang/multimodal_gen/test/server/perf_baselines.json @@ -523,70 +523,70 @@ }, "wan2_1_t2v_1.3b": { "stages_ms": { - "InputValidationStage": 0.06, - "TextEncodingStage": 3595.12, - "ConditioningStage": 0.02, - "TimestepPreparationStage": 2.39, - "LatentPreparationStage": 15.27, - "DenoisingStage": 91099.4, - "DecodingStage": 4330.65, + "InputValidationStage": 0.07, + "TextEncodingStage": 2237.78, + "ConditioningStage": 0.01, + "TimestepPreparationStage": 2.1, + "LatentPreparationStage": 0.84, + "DenoisingStage": 13041.23, + "DecodingStage": 1274.63, "per_frame_generation": null }, "denoise_step_ms": { - "0": 2918.67, - "1": 1784.23, - "2": 1797.72, - "3": 1798.8, - "4": 1798.19, - "5": 1799.27, - "6": 1798.54, - "7": 1798.67, - "8": 1798.76, - "9": 1798.34, - "10": 1799.22, - "11": 1798.61, - "12": 1799.4, - "13": 1799.04, - "14": 1797.41, - "15": 1799.05, - "16": 1798.32, - "17": 1799.12, - "18": 1799.56, - "19": 1797.01, - "20": 1798.28, - "21": 1799.06, - "22": 1800.05, - "23": 1797.76, - "24": 1798.16, - "25": 1798.62, - "26": 1798.64, - "27": 1799.44, - "28": 1798.79, - "29": 1798.13, - "30": 1797.47, - "31": 1799.4, - "32": 1798.77, - "33": 1799.47, - "34": 1798.49, - "35": 1796.51, - "36": 1799.68, - "37": 1799.24, - "38": 1798.49, - "39": 1799.66, - "40": 1797.04, - "41": 1799.58, - "42": 1797.35, - "43": 1798.07, - "44": 1798.6, - "45": 1798.95, - "46": 1799.51, - "47": 1798.25, - "48": 1799.04, - "49": 1798.34 + "0": 879.71, + "1": 248.13, + "2": 246.48, + "3": 247.87, + "4": 249.38, + "5": 246.76, + "6": 250.42, + "7": 250.81, + "8": 250.98, + "9": 249.9, + "10": 246.72, + "11": 249.79, + "12": 250.46, + "13": 249.19, + "14": 247.55, + "15": 250.12, + "16": 247.57, + "17": 247.21, + "18": 247.32, + "19": 247.42, + "20": 248.21, + "21": 247.19, + "22": 247.72, + "23": 247.45, + "24": 247.9, + "25": 247.87, + "26": 247.18, + "27": 247.65, + "28": 246.91, + "29": 248.26, + "30": 247.82, + "31": 247.73, + "32": 247.38, + "33": 247.84, + "34": 247.46, + "35": 247.52, + "36": 247.94, + "37": 248.76, + "38": 248.01, + "39": 247.45, + "40": 247.84, + "41": 248.33, + "42": 247.41, + "43": 248.16, + "44": 248.18, + "45": 248.44, + "46": 248.65, + "47": 247.73, + "48": 247.48, + "49": 247.54 }, - "expected_e2e_ms": 99083.75, - "expected_avg_denoise_ms": 1820.02, - "expected_median_denoise_ms": 1798.65 + "expected_e2e_ms": 16563.83, + "expected_avg_denoise_ms": 260.76, + "expected_median_denoise_ms": 247.84 }, "wan2_2_ti2v_5b": { "stages_ms": { @@ -677,82 +677,84 @@ }, "fast_hunyuan_video": { "stages_ms": { - "InputValidationStage": 0.09, - "TextEncodingStage": 845.64, - "ConditioningStage": 0.04, - "TimestepPreparationStage": 125.22, - "LatentPreparationStage": 29.34, - "DenoisingStage": 3860.64, - "DecodingStage": 2580.55 + "InputValidationStage": 0.34, + "TextEncodingStage": 550.63, + "ConditioningStage": 0.02, + "TimestepPreparationStage": 44.28, + "LatentPreparationStage": 0.29, + "DenoisingStage": 9054.39, + "DecodingStage": 5995.09, + "per_frame_generation": null }, "denoise_step_ms": { - "0": 2063.08, - "1": 164.02, - "2": 406.99, - "3": 407.95, - "4": 407.51, - "5": 404.2 + "0": 2518.62, + "1": 578.59, + "2": 1485.76, + "3": 1490.86, + "4": 1489.93, + "5": 1487.02 }, - "expected_e2e_ms": 7487.87, - "expected_avg_denoise_ms": 642.29, - "expected_median_denoise_ms": 407.25 + "expected_e2e_ms": 15672.15, + "expected_avg_denoise_ms": 1508.46, + "expected_median_denoise_ms": 1488.48 }, "wan2_2_i2v_a14b_2gpu": { "stages_ms": { - "InputValidationStage": 59.33, - "TextEncodingStage": 6062.41, - "ConditioningStage": 0.02, - "TimestepPreparationStage": 2.2, - "LatentPreparationStage": 8.93, - "ImageVAEEncodingStage": 2075.47, - "DenoisingStage": 382628.41, - "DecodingStage": 2820.89 + "InputValidationStage": 18.45, + "TextEncodingStage": 3337.77, + "ConditioningStage": 0.03, + "TimestepPreparationStage": 2.9, + "LatentPreparationStage": 1.25, + "ImageVAEEncodingStage": 1655.89, + "DenoisingStage": 100544.98, + "DecodingStage": 1355.52, + "per_frame_generation": null }, "denoise_step_ms": { - "0": 31228.27, - "1": 7723.86, - "2": 7769.69, - "3": 7795.93, - "4": 7815.58, - "5": 7829.48, - "6": 7827.34, - "7": 7825.35, - "8": 7828.05, - "9": 7809.53, - "10": 7801.29, - "11": 7790.96, - "12": 7785.88, - "13": 7785.5, - "14": 7780.32, - "15": 55411.1, - "16": 7722.27, - "17": 7761.31, - "18": 7789.46, - "19": 7800.6, - "20": 7814.91, - "21": 7799.62, - "22": 7801.25, - "23": 7798.27, - "24": 7797.67, - "25": 7795.97, - "26": 7781.74, - "27": 7784.16, - "28": 7796.64, - "29": 7789.75, - "30": 7792.13, - "31": 7790.99, - "32": 7778.1, - "33": 7777.78, - "34": 7780.56, - "35": 7778.22, - "36": 7770.88, - "37": 7771.56, - "38": 7767.82, - "39": 7769.23 + "0": 15659.6, + "1": 1582.6, + "2": 1597.84, + "3": 1601.34, + "4": 1600.86, + "5": 1598.32, + "6": 1600.93, + "7": 1599.88, + "8": 1600.0, + "9": 1600.55, + "10": 1599.27, + "11": 1600.59, + "12": 1600.17, + "13": 1599.72, + "14": 1599.76, + "15": 24098.85, + "16": 1601.29, + "17": 1598.89, + "18": 1600.12, + "19": 1600.52, + "20": 1599.59, + "21": 1600.37, + "22": 1600.35, + "23": 1599.7, + "24": 1599.92, + "25": 1599.75, + "26": 1600.2, + "27": 1600.06, + "28": 1600.41, + "29": 1599.35, + "30": 1600.69, + "31": 1600.15, + "32": 1599.33, + "33": 1599.86, + "34": 1600.52, + "35": 1599.84, + "36": 1600.38, + "37": 1599.23, + "38": 1600.27, + "39": 1599.78 }, - "expected_e2e_ms": 393606.77, - "expected_avg_denoise_ms": 9565.48, - "expected_median_denoise_ms": 7790.98 + "expected_e2e_ms": 123182.9887, + "expected_avg_denoise_ms": 2513.52, + "expected_median_denoise_ms": 1600.09 }, "wan2_1_i2v_14b_480P_2gpu": { "stages_ms": { @@ -894,58 +896,59 @@ "wan2_2_t2v_a14b_2gpu": { "stages_ms": { "InputValidationStage": 0.07, - "TextEncodingStage": 2507.83, - "ConditioningStage": 0.02, - "TimestepPreparationStage": 3.22, - "LatentPreparationStage": 2.99, - "DenoisingStage": 103136.69, - "DecodingStage": 1431.71 + "TextEncodingStage": 2575.3, + "ConditioningStage": 0.01, + "TimestepPreparationStage": 1.99, + "LatentPreparationStage": 1.26, + "DenoisingStage": 156678.8406, + "DecodingStage": 2702.7, + "per_frame_generation": null }, "denoise_step_ms": { - "0": 24471.86, - "1": 757.31, - "2": 760.07, - "3": 758.74, - "4": 762.4, - "5": 755.83, - "6": 760.06, - "7": 756.38, - "8": 755.38, - "9": 754.25, - "10": 754.51, - "11": 753.46, - "12": 753.67, - "13": 753.08, - "14": 754.83, - "15": 753.04, - "16": 754.28, - "17": 754.45, - "18": 758.19, - "19": 756.23, - "20": 755.14, - "21": 755.92, - "22": 759.52, - "23": 762.09, - "24": 756.8, - "25": 758.86, - "26": 48787.27, - "27": 758.5, - "28": 757.57, - "29": 757.16, - "30": 758.43, - "31": 763.31, - "32": 753.69, - "33": 754.91, - "34": 752.03, - "35": 763.65, - "36": 760.96, - "37": 754.31, - "38": 753.64, - "39": 756.95 + "0": 17908.3, + "1": 2379.69, + "2": 2393.59, + "3": 2400.91, + "4": 2398.76, + "5": 2403.1, + "6": 2403.26, + "7": 2399.48, + "8": 2401.33, + "9": 2398.4, + "10": 2401.14, + "11": 2409.1, + "12": 2401.16, + "13": 2408.74, + "14": 2404.97, + "15": 2400.51, + "16": 2402.84, + "17": 2401.87, + "18": 2399.67, + "19": 2400.71, + "20": 2399.23, + "21": 2400.13, + "22": 2400.64, + "23": 2399.15, + "24": 2399.58, + "25": 2400.26, + "26": 35247.02, + "27": 2390.25, + "28": 2398.42, + "29": 2399.8, + "30": 2400.08, + "31": 2400.58, + "32": 2403.68, + "33": 2399.37, + "34": 2401.53, + "35": 2399.69, + "36": 2399.9, + "37": 2400.75, + "38": 2398.97, + "39": 2399.12 }, - "expected_e2e_ms": 106895.63, - "expected_avg_denoise_ms": 2550.47, - "expected_median_denoise_ms": 756.59 + "expected_e2e_ms": 149864.99, + "expected_avg_denoise_ms": 3608.89, + "expected_median_denoise_ms": 2400.38 }, "wan2_1_t2v_14b_2gpu": { "stages_ms": { @@ -1016,196 +1019,196 @@ }, "wan2_2_t2v_a14b_lora_2gpu": { "stages_ms": { - "InputValidationStage": 0.06, - "TextEncodingStage": 2582.35, - "ConditioningStage": 0.02, - "TimestepPreparationStage": 2.11, - "LatentPreparationStage": 1.45, - "DenoisingStage": 80688.12, - "DecodingStage": 1346.2, + "InputValidationStage": 0.09, + "TextEncodingStage": 2552.97, + "ConditioningStage": 0.03, + "TimestepPreparationStage": 1.99, + "LatentPreparationStage": 1.29, + "DenoisingStage": 154340.69, + "DecodingStage": 2730.86, "per_frame_generation": null }, "denoise_step_ms": { - "0": 19129.79, - "1": 770.1, - "2": 895.12, - "3": 756.23, - "4": 761.9, - "5": 758.9, - "6": 760.59, - "7": 756.3, - "8": 761.7, - "9": 754.23, - "10": 756.11, - "11": 755.59, - "12": 756.8, - "13": 763.12, - "14": 757.43, - "15": 760.82, - "16": 758.13, - "17": 759.67, - "18": 756.83, - "19": 757.86, - "20": 757.75, - "21": 757.41, - "22": 755.53, - "23": 759.37, - "24": 758.09, - "25": 756.58, - "26": 32148.89, - "27": 760.46, - "28": 756.69, - "29": 756.47, - "30": 759.02, - "31": 757.31, - "32": 754.43, - "33": 759.34, - "34": 760.11, - "35": 758.23, - "36": 763.78, - "37": 758.4, - "38": 758.26, - "39": 758.46 + "0": 26510.7, + "1": 2381.25, + "2": 2396.9, + "3": 2400.96, + "4": 2402.47, + "5": 2399.6, + "6": 2400.5, + "7": 2401.13, + "8": 2399.32, + "9": 2400.0, + "10": 2401.35, + "11": 2400.04, + "12": 2408.27, + "13": 2407.08, + "14": 2405.92, + "15": 2403.99, + "16": 2402.12, + "17": 2402.52, + "18": 2398.08, + "19": 2399.9, + "20": 2400.14, + "21": 2398.64, + "22": 2401.32, + "23": 2400.75, + "24": 2399.27, + "25": 2400.21, + "26": 36387.55, + "27": 2399.77, + "28": 2398.09, + "29": 2404.64, + "30": 2400.68, + "31": 2404.3, + "32": 2392.44, + "33": 2390.56, + "34": 2396.05, + "35": 2394.86, + "36": 2396.07, + "37": 2398.49, + "38": 2394.77, + "39": 2394.19 }, - "expected_e2e_ms": 84633.71, - "expected_avg_denoise_ms": 2006.04, - "expected_median_denoise_ms": 758.24 + "expected_e2e_ms": 159643.06, + "expected_avg_denoise_ms": 3851.87, + "expected_median_denoise_ms": 2400.09 }, "wan2_1_t2v_1_3b_lora_1gpu": { "stages_ms": { - "InputValidationStage": 0.08, - "TextEncodingStage": 2392.95, + "InputValidationStage": 0.06, + "TextEncodingStage": 2467.44, "ConditioningStage": 0.02, - "TimestepPreparationStage": 2.19, - "LatentPreparationStage": 1.28, - "DenoisingStage": 8752.65, - "DecodingStage": 743.42, + "TimestepPreparationStage": 2.96, + "LatentPreparationStage": 1.87, + "DenoisingStage": 14859.47, + "DecodingStage": 1199.31, "per_frame_generation": null }, "denoise_step_ms": { - "0": 1782.77, - "1": 149.53, - "2": 147.3, - "3": 143.89, - "4": 143.48, - "5": 142.72, - "6": 141.11, - "7": 142.73, - "8": 138.91, - "9": 143.41, - "10": 142.53, - "11": 139.12, - "12": 142.67, - "13": 143.35, - "14": 142.36, - "15": 139.34, - "16": 142.94, - "17": 141.88, - "18": 138.48, - "19": 148.75, - "20": 138.57, - "21": 138.3, - "22": 138.4, - "23": 137.78, - "24": 138.1, - "25": 138.35, - "26": 138.75, - "27": 138.31, - "28": 138.48, - "29": 137.58, - "30": 137.96, - "31": 145.2, - "32": 145.89, - "33": 143.23, - "34": 144.19, - "35": 142.49, - "36": 141.82, - "37": 142.4, - "38": 144.86, - "39": 144.42, - "40": 142.97, - "41": 142.26, - "42": 142.75, - "43": 142.45, - "44": 142.62, - "45": 145.97, - "46": 147.18, - "47": 143.28, - "48": 142.66, - "49": 142.32 + "0": 1964.07, + "1": 265.02, + "2": 257.83, + "3": 260.27, + "4": 261.43, + "5": 258.58, + "6": 256.64, + "7": 256.91, + "8": 258.41, + "9": 257.84, + "10": 257.08, + "11": 257.0, + "12": 258.44, + "13": 257.1, + "14": 256.95, + "15": 257.2, + "16": 256.84, + "17": 257.64, + "18": 257.22, + "19": 257.42, + "20": 256.91, + "21": 256.99, + "22": 257.17, + "23": 257.63, + "24": 258.89, + "25": 257.46, + "26": 257.3, + "27": 257.42, + "28": 257.19, + "29": 257.65, + "30": 257.39, + "31": 256.93, + "32": 258.23, + "33": 257.62, + "34": 281.86, + "35": 295.86, + "36": 296.73, + "37": 287.21, + "38": 300.87, + "39": 303.47, + "40": 294.09, + "41": 270.52, + "42": 256.53, + "43": 256.58, + "44": 256.29, + "45": 255.81, + "46": 256.34, + "47": 256.08, + "48": 255.92, + "49": 255.87 }, - "expected_e2e_ms": 11905.69, - "expected_avg_denoise_ms": 174.94, - "expected_median_denoise_ms": 142.57 + "expected_e2e_ms": 18547.46, + "expected_avg_denoise_ms": 297.09, + "expected_median_denoise_ms": 257.42 }, "wan2_1_i2v_14b_lora_2gpu": { "stages_ms": { - "InputValidationStage": 37.9, - "TextEncodingStage": 2581.79, - "ImageEncodingStage": 1607.56, + "InputValidationStage": 23.97, + "TextEncodingStage": 2485.39, + "ImageEncodingStage": 2372.07, "ConditioningStage": 0.01, - "TimestepPreparationStage": 2.13, - "LatentPreparationStage": 0.13, - "ImageVAEEncodingStage": 2405.17, - "DenoisingStage": 188146.58, - "DecodingStage": 3392.12, + "TimestepPreparationStage": 2.6, + "LatentPreparationStage": 0.18, + "ImageVAEEncodingStage": 2500.13, + "DenoisingStage": 193514.04, + "DecodingStage": 3341.78, "per_frame_generation": null }, "denoise_step_ms": { - "0": 5373.79, - "1": 3671.13, - "2": 3676.21, - "3": 3678.12, - "4": 3687.34, - "5": 3693.02, - "6": 3699.22, - "7": 3701.94, - "8": 3709.51, - "9": 3711.35, - "10": 3713.63, - "11": 3714.26, - "12": 3732.48, - "13": 3734.85, - "14": 3718.94, - "15": 3719.6, - "16": 3724.61, - "17": 3725.0, - "18": 3727.77, - "19": 3727.89, - "20": 3726.51, - "21": 3727.26, - "22": 3726.27, - "23": 3726.55, - "24": 3725.91, - "25": 3726.53, - "26": 3725.54, - "27": 3728.39, - "28": 3724.19, - "29": 3727.76, - "30": 3720.69, - "31": 3724.38, - "32": 3723.14, - "33": 3723.73, - "34": 3728.07, - "35": 3728.38, - "36": 3745.83, - "37": 3733.19, - "38": 3724.01, - "39": 3722.51, - "40": 3733.28, - "41": 3723.43, - "42": 3724.11, - "43": 3725.56, - "44": 3720.57, - "45": 3719.53, - "46": 3713.17, - "47": 3721.05, - "48": 3721.72, - "49": 3715.61 + "0": 7828.3, + "1": 3765.8, + "2": 3774.63, + "3": 3772.93, + "4": 3781.13, + "5": 3778.22, + "6": 3776.41, + "7": 3772.02, + "8": 3776.15, + "9": 3768.82, + "10": 3775.31, + "11": 3771.32, + "12": 3774.33, + "13": 3772.5, + "14": 3778.41, + "15": 3775.31, + "16": 3771.38, + "17": 3774.87, + "18": 3780.01, + "19": 3772.85, + "20": 3773.65, + "21": 3774.47, + "22": 3774.39, + "23": 3773.08, + "24": 3776.71, + "25": 3780.01, + "26": 3774.83, + "27": 3773.27, + "28": 3773.76, + "29": 3772.75, + "30": 3773.01, + "31": 3773.34, + "32": 3773.13, + "33": 3774.12, + "34": 3772.19, + "35": 3774.7, + "36": 3773.98, + "37": 3772.47, + "38": 3771.72, + "39": 3774.07, + "40": 3773.71, + "41": 3773.6, + "42": 3772.12, + "43": 3773.75, + "44": 3782.43, + "45": 3779.66, + "46": 3779.86, + "47": 3774.58, + "48": 3770.54, + "49": 3776.76 }, - "expected_e2e_ms": 220000, - "expected_avg_denoise_ms": 3751.95, - "expected_median_denoise_ms": 3724.06 + "expected_e2e_ms": 204257.12, + "expected_avg_denoise_ms": 3855.55, + "expected_median_denoise_ms": 3774.03 } } } diff --git a/python/sglang/multimodal_gen/test/server/test_server_common.py b/python/sglang/multimodal_gen/test/server/test_server_common.py index b7666de04..4b9212f45 100644 --- a/python/sglang/multimodal_gen/test/server/test_server_common.py +++ b/python/sglang/multimodal_gen/test/server/test_server_common.py @@ -491,6 +491,7 @@ Consider updating perf_baselines.json with the snippets below: case.id, generate_fn, ) + self._validate_and_record(case, perf_record) # LoRA API functionality test with E2E validation (only for LoRA-enabled cases) diff --git a/python/sglang/multimodal_gen/test/server/testcase_configs.py b/python/sglang/multimodal_gen/test/server/testcase_configs.py index 250ef6c9a..ac476ac23 100644 --- a/python/sglang/multimodal_gen/test/server/testcase_configs.py +++ b/python/sglang/multimodal_gen/test/server/testcase_configs.py @@ -227,7 +227,6 @@ TI2I_sampling_params = DiffusionSamplingParams( T2V_PROMPT = "A curious raccoon" TI2V_sampling_params = DiffusionSamplingParams( - output_size="832x1104", prompt="The man in the picture slowly turns his head, his expression enigmatic and otherworldly. The camera performs a slow, cinematic dolly out, focusing on his face. Moody lighting, neon signs glowing in the background, shallow depth of field.", image_path="https://is1-ssl.mzstatic.com/image/thumb/Music114/v4/5f/fa/56/5ffa56c2-ea1f-7a17-6bad-192ff9b6476d/825646124206.jpg/600x600bb.jpg", ) @@ -302,7 +301,6 @@ ONE_GPU_CASES_B: list[DiffusionTestCase] = [ ), DiffusionSamplingParams( prompt=T2V_PROMPT, - output_size="848x480", ), ), # LoRA test case for single transformer + merge/unmerge API test @@ -319,7 +317,6 @@ ONE_GPU_CASES_B: list[DiffusionTestCase] = [ ), DiffusionSamplingParams( prompt="csetiarcane Nfj1nx with blue hair, a woman walking in a cyberpunk city at night", - output_size="480x320", num_frames=8, ), ), @@ -355,7 +352,6 @@ ONE_GPU_CASES_B: list[DiffusionTestCase] = [ ), DiffusionSamplingParams( prompt=T2V_PROMPT, - output_size="720x480", ), ), # === Text and Image to Video (TI2V) === @@ -384,7 +380,6 @@ ONE_GPU_CASES_B: list[DiffusionTestCase] = [ ] TWO_GPU_CASES_A = [ - # TODO: Timeout with Torch2.9. Add back when it can pass CI DiffusionTestCase( "wan2_2_i2v_a14b_2gpu", DiffusionServerArgs( @@ -408,7 +403,6 @@ TWO_GPU_CASES_A = [ ), DiffusionSamplingParams( prompt=T2V_PROMPT, - output_size="720x480", ), ), # LoRA test case for transformer_2 support @@ -425,7 +419,6 @@ TWO_GPU_CASES_A = [ ), DiffusionSamplingParams( prompt="Nfj1nx with blue hair, a woman walking in a cyberpunk city at night", - output_size="720x480", ), ), DiffusionTestCase( @@ -440,7 +433,7 @@ TWO_GPU_CASES_A = [ ), DiffusionSamplingParams( prompt=T2V_PROMPT, - output_size="720x480", + output_size="832x480", ), ), ]