[diffusion] feat: support resolution check for video model (#14881)

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