[diffusion] feat: support sp for image models (#13180)

This commit is contained in:
Mick
2025-11-23 18:11:42 +08:00
committed by GitHub
parent 53fffefd5d
commit d4593964fe
19 changed files with 624 additions and 393 deletions

View File

@@ -15,25 +15,40 @@ class TestFlux_T2V(TestGenerateBase):
extra_args = []
data_type: DataType = DataType.IMAGE
thresholds = {
"test_single_gpu": 6.90 * 1.05,
"test_single_gpu": 6.5 * 1.05,
"test_usp": 8.3 * 1.05,
}
def test_cfg_parallel(self):
pass
def test_mixed(self):
pass
class TestQwenImage(TestGenerateBase):
model_path = "Qwen/Qwen-Image"
extra_args = []
data_type: DataType = DataType.IMAGE
thresholds = {
"test_single_gpu": 11.7 * 1.05,
"test_single_gpu": 10.4 * 1.05,
"test_usp": 20.2 * 1.05,
}
def test_cfg_parallel(self):
pass
def test_mixed(self):
pass
class TestQwenImageEdit(TestGenerateBase):
model_path = "Qwen/Qwen-Image-Edit"
extra_args = []
data_type: DataType = DataType.IMAGE
thresholds = {
"test_single_gpu": 43.5 * 1.05,
"test_single_gpu": 33.4 * 1.05,
"test_usp": 26.9 * 1.05,
}
prompt: str | None = (
@@ -57,13 +72,11 @@ class TestQwenImageEdit(TestGenerateBase):
f"--output-path={self.output_path}",
] + [f"--image-path={img_path}"]
def test_single_gpu(self):
self._run_test(
name=f"{self.model_name()}_single_gpu",
args=None,
model_path=self.model_path,
test_key="test_single_gpu",
)
def test_cfg_parallel(self):
pass
def test_mixed(self):
pass
if __name__ == "__main__":

View File

@@ -9,7 +9,7 @@
"denoise_stage": 0.05,
"non_denoise_stage": 0.4,
"denoise_step": 0.2,
"denoise_agg": 0.08
"denoise_agg": 0.1
},
"improvement_reporting": {
"threshold": 0.2
@@ -96,6 +96,72 @@
"49": 410.42
}
},
"qwen_image_t2i_2_gpus": {
"stages_ms": {
"InputValidationStage": 0.04,
"TextEncodingStage": 693.2,
"ConditioningStage": 0.02,
"TimestepPreparationStage": 2.84,
"LatentPreparationStage": 9.13,
"DenoisingStage": 24529.77,
"DecodingStage": 612.79
},
"denoise_step_ms": {
"0": 405.94,
"1": 420.06,
"2": 414.79,
"3": 392.4,
"4": 408.14,
"5": 605.0,
"6": 469.39,
"7": 574.04,
"8": 539.61,
"9": 452.93,
"10": 279.36,
"11": 271.8,
"12": 438.26,
"13": 552.65,
"14": 576.1,
"15": 679.84,
"16": 543.0,
"17": 512.81,
"18": 522.27,
"19": 545.06,
"20": 545.85,
"21": 523.83,
"22": 519.36,
"23": 513.78,
"24": 532.54,
"25": 524.94,
"26": 542.59,
"27": 570.91,
"28": 568.73,
"29": 564.52,
"30": 564.57,
"31": 544.94,
"32": 496.81,
"33": 488.98,
"34": 457.18,
"35": 441.42,
"36": 437.44,
"37": 477.6,
"38": 429.17,
"39": 465.55,
"40": 448.25,
"41": 511.83,
"42": 450.6,
"43": 375.78,
"44": 504.4,
"45": 524.44,
"46": 535.22,
"47": 514.52,
"48": 431.58,
"49": 410.68
},
"expected_e2e_ms": 25850.45,
"expected_avg_denoise_ms": 490.43,
"expected_median_denoise_ms": 512.32
},
"flux_image_t2i": {
"stages_ms": {
"InputValidationStage": 0.03,
@@ -162,6 +228,72 @@
"expected_avg_denoise_ms": 165.83,
"expected_median_denoise_ms": 169.33
},
"flux_image_t2i_2_gpus": {
"stages_ms": {
"InputValidationStage": 0.03,
"TextEncodingStage": 74.47,
"ConditioningStage": 0.01,
"TimestepPreparationStage": 2.23,
"LatentPreparationStage": 6.17,
"DenoisingStage": 8400.49,
"DecodingStage": 381.56
},
"denoise_step_ms": {
"0": 166.27,
"1": 59.6,
"2": 167.31,
"3": 168.7,
"4": 168.83,
"5": 171.05,
"6": 174.64,
"7": 170.92,
"8": 169.69,
"9": 169.21,
"10": 167.71,
"11": 177.62,
"12": 166.44,
"13": 174.61,
"14": 170.43,
"15": 169.47,
"16": 167.24,
"17": 169.15,
"18": 169.51,
"19": 172.3,
"20": 172.19,
"21": 172.36,
"22": 168.39,
"23": 168.47,
"24": 170.55,
"25": 170.96,
"26": 168.43,
"27": 169.01,
"28": 169.62,
"29": 170.95,
"30": 171.83,
"31": 171.92,
"32": 170.1,
"33": 170.46,
"34": 169.91,
"35": 168.91,
"36": 170.27,
"37": 170.23,
"38": 169.62,
"39": 169.66,
"40": 169.57,
"41": 169.42,
"42": 168.59,
"43": 171.12,
"44": 169.6,
"45": 169.93,
"46": 171.23,
"47": 171.03,
"48": 170.14,
"49": 169.4
},
"expected_e2e_ms": 9006.3,
"expected_avg_denoise_ms": 167.89,
"expected_median_denoise_ms": 169.67
},
"qwen_image_edit_ti2i": {
"notes": "single uploaded reference image, Qwen/Qwen-Image-Edit",
"expected_e2e_ms": 138500.0,
@@ -465,197 +597,195 @@
},
"wan2_1_i2v_14b_480P_2gpu": {
"stages_ms": {
"InputValidationStage": 32.94,
"TextEncodingStage": 2316.5,
"ImageEncodingStage": 3026.2,
"InputValidationStage": 33.57,
"TextEncodingStage": 2424.73,
"ImageEncodingStage": 3462.55,
"ConditioningStage": 0.01,
"TimestepPreparationStage": 2.69,
"LatentPreparationStage": 9.73,
"ImageVAEEncodingStage": 2290.98,
"DenoisingStage": 385080.09,
"DecodingStage": 2984.69,
"per_frame_generation": null
"DenoisingStage": 414428.85,
"DecodingStage": 3016.1
},
"denoise_step_ms": {
"0": 8785.36,
"1": 7644.16,
"2": 7687.27,
"3": 7703.9,
"4": 7710.61,
"5": 7716.32,
"6": 7714.26,
"7": 7711.27,
"8": 7711.08,
"9": 7706.57,
"10": 7700.78,
"11": 7696.03,
"12": 7704.73,
"13": 7699.99,
"14": 7705.33,
"15": 7701.11,
"16": 7704.04,
"17": 7695.31,
"18": 7693.63,
"19": 7686.34,
"20": 7683.27,
"21": 7689.82,
"22": 7688.74,
"23": 7686.01,
"24": 7675.43,
"25": 7679.86,
"26": 7676.75,
"27": 7671.65,
"28": 7667.0,
"29": 7669.83,
"30": 7660.5,
"31": 7666.82,
"32": 7660.89,
"33": 7668.75,
"34": 7662.27,
"35": 7659.71,
"36": 7661.36,
"37": 7664.87,
"38": 7666.93,
"39": 7661.05,
"40": 7661.88,
"41": 7657.96,
"42": 7660.6,
"43": 7669.82,
"44": 7655.78,
"45": 7654.25,
"46": 7656.56,
"47": 7652.37,
"48": 7657.61,
"49": 7644.6
"0": 9304.67,
"1": 8218.78,
"2": 8269.27,
"3": 8291.59,
"4": 8308.29,
"5": 8300.75,
"6": 8302.76,
"7": 8297.95,
"8": 8295.26,
"9": 8296.45,
"10": 8287.48,
"11": 8275.98,
"12": 8281.9,
"13": 8283.39,
"14": 8264.96,
"15": 8275.66,
"16": 8271.89,
"17": 8273.77,
"18": 8279.34,
"19": 8271.89,
"20": 8265.83,
"21": 8259.99,
"22": 8260.36,
"23": 8270.06,
"24": 8271.58,
"25": 8272.39,
"26": 8267.87,
"27": 8277.09,
"28": 8264.49,
"29": 8266.14,
"30": 8263.67,
"31": 8273.82,
"32": 8260.5,
"33": 8268.44,
"34": 8253.2,
"35": 8244.32,
"36": 8258.15,
"37": 8256.65,
"38": 8255.48,
"39": 8260.09,
"40": 8250.99,
"41": 8253.52,
"42": 8247.39,
"43": 8252.7,
"44": 8243.67,
"45": 8251.94,
"46": 8258.73,
"47": 8240.57,
"48": 8249.64,
"49": 8248.14
},
"expected_e2e_ms": 395758.23,
"expected_avg_denoise_ms": 7701.42,
"expected_median_denoise_ms": 7676.09
"expected_e2e_ms": 425569.98,
"expected_avg_denoise_ms": 8288.39,
"expected_median_denoise_ms": 8267.01
},
"wan2_1_i2v_14b_720P_2gpu": {
"stages_ms": {
"InputValidationStage": 53.67,
"TextEncodingStage": 2838,
"ImageEncodingStage": 3123.99,
"ConditioningStage": 0.02,
"ConditioningStage": 0.01,
"TimestepPreparationStage": 3.39,
"LatentPreparationStage": 6.68,
"LatentPreparationStage": 8.41,
"ImageVAEEncodingStage": 2261.05,
"DenoisingStage": 386761.14,
"DecodingStage": 2968.35,
"per_frame_generation": null
"DenoisingStage": 417418.12,
"DecodingStage": 2968.35
},
"denoise_step_ms": {
"0": 10021.98,
"1": 7633.62,
"2": 7676.46,
"3": 7704.68,
"4": 7725.09,
"5": 7732.86,
"6": 7735.42,
"7": 7739.05,
"8": 7740.89,
"9": 7724.35,
"10": 7730.2,
"11": 7713.23,
"12": 7715.93,
"13": 7710.93,
"14": 7699.95,
"15": 7704.72,
"16": 7704.03,
"17": 7700.47,
"18": 7702.0,
"19": 7705.92,
"20": 7704.35,
"21": 7705.11,
"22": 7693.85,
"23": 7696.91,
"24": 7689.6,
"25": 7681.2,
"26": 7675.63,
"27": 7678.95,
"28": 7683.82,
"29": 7681.07,
"30": 7671.07,
"31": 7674.65,
"32": 7679.56,
"33": 7674.59,
"34": 7672.16,
"35": 7679.68,
"36": 7670.81,
"37": 7661.84,
"38": 7668.58,
"39": 7667.1,
"40": 7670.22,
"41": 7664.97,
"42": 7667.3,
"43": 7668.87,
"44": 7663.43,
"45": 7656.34,
"46": 7662.81,
"47": 7662.05,
"48": 7654.13,
"49": 7648.62
"0": 11848.08,
"1": 8220.3,
"2": 8274.3,
"3": 8298.9,
"4": 8303.34,
"5": 8322.44,
"6": 8314.37,
"7": 8318.54,
"8": 8304.94,
"9": 8303.04,
"10": 8305.22,
"11": 8296.22,
"12": 8289.2,
"13": 8294.19,
"14": 8294.87,
"15": 8285.96,
"16": 8284.98,
"17": 8281.61,
"18": 8277.35,
"19": 8287.46,
"20": 8280.3,
"21": 8279.18,
"22": 8279.37,
"23": 8280.16,
"24": 8282.67,
"25": 8272.14,
"26": 8279.37,
"27": 8271.66,
"28": 8274.6,
"29": 8272.88,
"30": 8273.76,
"31": 8266.17,
"32": 8267.77,
"33": 8266.88,
"34": 8263.14,
"35": 8265.97,
"36": 8267.76,
"37": 8268.03,
"38": 8262.24,
"39": 8261.4,
"40": 8263.65,
"41": 8272.46,
"42": 8254.9,
"43": 8261.03,
"44": 8252.92,
"45": 8262.49,
"46": 8253.67,
"47": 8254.92,
"48": 8257.08,
"49": 8236.56
},
"expected_e2e_ms": 397541.45,
"expected_avg_denoise_ms": 7735.02,
"expected_median_denoise_ms": 7681.14
"expected_e2e_ms": 427536.9,
"expected_avg_denoise_ms": 8348.21,
"expected_median_denoise_ms": 8274.45
},
"wan2_2_t2v_a14b_2gpu": {
"stages_ms": {
"InputValidationStage": 0.09,
"TextEncodingStage": 2322.57,
"ConditioningStage": 0.03,
"TimestepPreparationStage": 2.29,
"LatentPreparationStage": 3.08,
"DenoisingStage": 79913.08,
"DecodingStage": 1339.58
"InputValidationStage": 0.07,
"TextEncodingStage": 2507.83,
"ConditioningStage": 0.02,
"TimestepPreparationStage": 3.22,
"LatentPreparationStage": 2.99,
"DenoisingStage": 103136.69,
"DecodingStage": 1431.71
},
"denoise_step_ms": {
"0": 19269.37,
"1": 691.64,
"2": 699.28,
"3": 696.55,
"4": 698.6,
"5": 704.56,
"6": 699.26,
"7": 700.84,
"8": 700.27,
"9": 704.15,
"10": 699.04,
"11": 704.79,
"12": 701.48,
"13": 707.24,
"14": 697.54,
"15": 698.89,
"16": 697.97,
"17": 699.34,
"18": 697.68,
"19": 697.42,
"20": 697.14,
"21": 700.14,
"22": 696.75,
"23": 702.36,
"24": 697.3,
"25": 703.97,
"26": 33676.93,
"27": 700.4,
"28": 703.68,
"29": 691.86,
"30": 706.1,
"31": 704.18,
"32": 700.34,
"33": 698.62,
"34": 698.66,
"35": 699.77,
"36": 700.96,
"37": 701.02,
"38": 703.98,
"39": 702.18
"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
},
"expected_e2e_ms": 83595.94,
"expected_avg_denoise_ms": 1988.81,
"expected_median_denoise_ms": 700.2
"expected_e2e_ms": 106895.63,
"expected_avg_denoise_ms": 2550.47,
"expected_median_denoise_ms": 756.59
},
"wan2_1_t2v_14b_2gpu": {
"stages_ms": {

View File

@@ -132,7 +132,7 @@ class ServerManager:
env["SGLANG_PERF_LOG_DIR"] = log_dir.as_posix()
# TODO: unify with run_command
print(f"Running command: {shlex.join(command)}")
logger.info(f"Running command: {shlex.join(command)}")
process = subprocess.Popen(
command,

View File

@@ -369,6 +369,25 @@ TWO_GPU_CASES = [
custom_validator="video",
num_gpus=2,
),
DiffusionTestCase(
id="qwen_image_t2i_2_gpus",
model_path="Qwen/Qwen-Image",
modality="image",
prompt="A futuristic cityscape at sunset with flying cars",
output_size="1024x1024",
warmup_text=1,
warmup_edit=0,
num_gpus=2,
),
DiffusionTestCase(
id="flux_image_t2i_2_gpus",
model_path="black-forest-labs/FLUX.1-dev",
modality="image",
prompt="A futuristic cityscape at sunset with flying cars",
output_size="1024x1024",
warmup_text=1,
warmup_edit=0,
),
]
# Load global configuration

View File

@@ -385,8 +385,6 @@ class TestGenerateBase(TestCLIBase):
def test_cfg_parallel(self):
"""cfg parallel"""
if self.data_type == DataType.IMAGE:
return
self._run_test(
name=f"{self.model_name()}_cfg_parallel",
args="--num-gpus 2 --enable-cfg-parallel",
@@ -396,8 +394,6 @@ class TestGenerateBase(TestCLIBase):
def test_usp(self):
"""usp"""
if self.data_type == DataType.IMAGE:
return
self._run_test(
name=f"{self.model_name()}_usp",
args="--num-gpus 4 --ulysses-degree=2 --ring-degree=2",
@@ -407,8 +403,6 @@ class TestGenerateBase(TestCLIBase):
def test_mixed(self):
"""mixed"""
if self.data_type == DataType.IMAGE:
return
self._run_test(
name=f"{self.model_name()}_mixed",
args="--num-gpus 4 --ulysses-degree=2 --ring-degree=1 --enable-cfg-parallel",