From a8e4bb998434ffc9eedd9d1202a77526108c36be Mon Sep 17 00:00:00 2001 From: TaffyOfficial <2324465096@qq.com> Date: Wed, 27 May 2026 15:36:24 +0800 Subject: [PATCH 1/3] [Test] Use HunyuanImage3 DiT deploy config in perf tests Signed-off-by: TaffyOfficial <2324465096@qq.com> --- .../test_hunyuan_image_tp2_fp8_cfgp2.json | 23 ++++++++++++++++--- .../tests/test_hunyuan_image_tp2_fp8_sp2.json | 23 ++++++++++++++++--- .../tests/test_hunyuan_image_tp4_fp8.json | 4 ++-- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json index e6271545f77..f269346822e 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json @@ -5,12 +5,29 @@ "server_type": "vllm-omni", "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", + "stage_overrides": { + "0": { + "parallel_config": { + "pipeline_parallel_size": 1, + "data_parallel_size": 1, + "tensor_parallel_size": 2, + "enable_expert_parallel": true, + "sequence_parallel_size": 1, + "ulysses_degree": 1, + "ring_degree": 1, + "cfg_parallel_size": 2, + "vae_patch_parallel_size": 1, + "use_hsdp": false, + "hsdp_shard_size": -1, + "hsdp_replicate_size": 1 + } + } + }, "serve_args": { - "tensor-parallel-size": 2, - "cfg-parallel-size": 2, + "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", - "enforce-eager": true, + "trust-remote-code": true, "enable-diffusion-pipeline-profiler": true } }, diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json index 0112fc51a0e..24e788b09e9 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json @@ -5,12 +5,29 @@ "server_type": "vllm-omni", "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", + "stage_overrides": { + "0": { + "parallel_config": { + "pipeline_parallel_size": 1, + "data_parallel_size": 1, + "tensor_parallel_size": 2, + "enable_expert_parallel": true, + "sequence_parallel_size": 2, + "ulysses_degree": 2, + "ring_degree": 1, + "cfg_parallel_size": 1, + "vae_patch_parallel_size": 1, + "use_hsdp": false, + "hsdp_shard_size": -1, + "hsdp_replicate_size": 1 + } + } + }, "serve_args": { - "tensor-parallel-size": 2, - "usp": 2, + "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", - "enforce-eager": true, + "trust-remote-code": true, "enable-diffusion-pipeline-profiler": true } }, diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json b/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json index 8f6bad2f84f..e750c63ad2a 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json @@ -6,10 +6,10 @@ "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", "serve_args": { - "tensor-parallel-size": 4, + "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", - "enforce-eager": true, + "trust-remote-code": true, "enable-diffusion-pipeline-profiler": true } }, From e387a5465697a4fe3ce19ae6df17146afbc644f5 Mon Sep 17 00:00:00 2001 From: TaffyOfficial <2324465096@qq.com> Date: Fri, 29 May 2026 10:53:01 +0800 Subject: [PATCH 2/3] [Test] Resolve HunyuanImage3 perf deploy config path Signed-off-by: TaffyOfficial <2324465096@qq.com> --- tests/dfx/perf/scripts/run_benchmark.py | 2 +- tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json | 2 +- tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json | 2 +- tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/dfx/perf/scripts/run_benchmark.py b/tests/dfx/perf/scripts/run_benchmark.py index 55ad2f8b2b7..c653e7fa48d 100644 --- a/tests/dfx/perf/scripts/run_benchmark.py +++ b/tests/dfx/perf/scripts/run_benchmark.py @@ -53,7 +53,7 @@ def _get_config_file_from_argv() -> str | None: BENCHMARK_CONFIGS = load_configs(CONFIG_FILE_PATH) -DEPLOY_CONFIGS_DIR = Path(__file__).parent.parent / "deploy" +DEPLOY_CONFIGS_DIR = Path(__file__).resolve().parent.parent.parent.parent.parent / "vllm_omni" / "deploy" test_params = create_unique_server_params(BENCHMARK_CONFIGS, DEPLOY_CONFIGS_DIR) server_to_benchmark_mapping = create_test_parameter_mapping(BENCHMARK_CONFIGS) diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json index f269346822e..cc2ffc925be 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_cfgp2.json @@ -5,6 +5,7 @@ "server_type": "vllm-omni", "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", + "stage_config_name": "hunyuan_image3_dit.yaml", "stage_overrides": { "0": { "parallel_config": { @@ -24,7 +25,6 @@ } }, "serve_args": { - "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", "trust-remote-code": true, diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json index 24e788b09e9..c3a3535a2f4 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp2_fp8_sp2.json @@ -5,6 +5,7 @@ "server_type": "vllm-omni", "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", + "stage_config_name": "hunyuan_image3_dit.yaml", "stage_overrides": { "0": { "parallel_config": { @@ -24,7 +25,6 @@ } }, "serve_args": { - "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", "trust-remote-code": true, diff --git a/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json b/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json index e750c63ad2a..c0f51cd7242 100644 --- a/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json +++ b/tests/dfx/perf/tests/test_hunyuan_image_tp4_fp8.json @@ -5,8 +5,8 @@ "server_type": "vllm-omni", "server_params": { "model": "tencent/HunyuanImage-3.0-Instruct", + "stage_config_name": "hunyuan_image3_dit.yaml", "serve_args": { - "deploy-config": "vllm_omni/deploy/hunyuan_image3_dit.yaml", "quantization": "fp8", "distributed-executor-backend": "mp", "trust-remote-code": true, From d5aac3ea38e9254a0c71cd5f8c822794574fe9b2 Mon Sep 17 00:00:00 2001 From: TaffyOfficial <2324465096@qq.com> Date: Fri, 29 May 2026 15:50:50 +0800 Subject: [PATCH 3/3] [Test] Forward trust remote code to Hunyuan tokenizer Signed-off-by: TaffyOfficial <2324465096@qq.com> --- .../models/hunyuan_image3/hunyuan_image3_tokenizer.py | 8 ++++++-- .../models/hunyuan_image3/pipeline_hunyuan_image3.py | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/vllm_omni/diffusion/models/hunyuan_image3/hunyuan_image3_tokenizer.py b/vllm_omni/diffusion/models/hunyuan_image3/hunyuan_image3_tokenizer.py index 751bfb21af8..83f99f45d74 100644 --- a/vllm_omni/diffusion/models/hunyuan_image3/hunyuan_image3_tokenizer.py +++ b/vllm_omni/diffusion/models/hunyuan_image3/hunyuan_image3_tokenizer.py @@ -45,9 +45,13 @@ class Conversation: class TokenizerWrapper: - def __init__(self, tokenizer): + def __init__(self, tokenizer, *, trust_remote_code: bool = False, revision: str | None = None): if isinstance(tokenizer, str): - self.tokenizer = AutoTokenizer.from_pretrained(tokenizer) + self.tokenizer = AutoTokenizer.from_pretrained( + tokenizer, + revision=revision, + trust_remote_code=trust_remote_code, + ) else: self.tokenizer = tokenizer diff --git a/vllm_omni/diffusion/models/hunyuan_image3/pipeline_hunyuan_image3.py b/vllm_omni/diffusion/models/hunyuan_image3/pipeline_hunyuan_image3.py index 677d67796be..6764f73e526 100644 --- a/vllm_omni/diffusion/models/hunyuan_image3/pipeline_hunyuan_image3.py +++ b/vllm_omni/diffusion/models/hunyuan_image3/pipeline_hunyuan_image3.py @@ -351,7 +351,11 @@ def __init__(self, od_config: OmniDiffusionConfig) -> None: self.vae = DistributedAutoencoderKLHunyuan.from_config(self.hf_config.vae) self.vae.use_spatial_tiling = self.od_config.vae_use_tiling self._pipeline = None - self._tkwrapper = TokenizerWrapper(od_config.model) + self._tkwrapper = TokenizerWrapper( + od_config.model, + revision=od_config.revision, + trust_remote_code=od_config.trust_remote_code, + ) self.image_processor = HunyuanImage3ImageProcessor(self.hf_config) self.vision_model = Siglip2VisionTransformer(self.hf_config.vit) # self.vision_model = vision_model.vision_model