[BugFIX] enable Hunyuan image3 with stage selection among text_to_image/image_to_text (#1826)

Signed-off-by: Chendi Xue <chendi.xue@intel.com>
This commit is contained in:
Chendi.Xue authored and GitHub committed 2026-03-24 13:00:21 +08:00
1 parent 4ac25287fd
commit d71c9ae60f
6 files changed
+227 -2

No files matched your search

@@ -21,6 +21,8 @@ from diffusers.utils.torch_utils import randn_tensor
from einops import rearrange
from torch import Tensor, nn
from vllm_omni.diffusion.distributed.utils import get_local_device
class DiagonalGaussianDistribution:
def __init__(self, parameters: torch.Tensor, deterministic: bool = False):
@@ -506,7 +508,7 @@ class AutoencoderKLConv3D(ModelMixin, ConfigMixin):
self.use_compile = False
self.empty_cache = torch.empty(0, device="cuda")
self.empty_cache = torch.empty(0, device=get_local_device())
def _set_gradient_checkpointing(self, module, value=False):
if isinstance(module, (Encoder, Decoder)):
@@ -2,6 +2,11 @@
# Stage 0: AR Model (vLLM implementation)
# The following config has been verified on 8x L40S-48G GPU.
modes:
- mode: text-to-image
stages: [1]
- mode: image-to-text
stages: [0]
stage_args:
- stage_id: 0
stage_type: llm # Use llm stage type for AR stages
@@ -37,6 +42,40 @@ stage_args:
seed: 42
detokenize: True
repetition_penalty: 1.1
- stage_id: 1
stage_type: diffusion
runtime:
process: true
devices: "0,1,2,3,4,5,6,7"
max_batch_size: 1
engine_args:
model_stage: diffusion
gpu_memory_utilization: 0.9
enforce_eager: true
engine_output_type: image
distributed_executor_backend: "mp"
enable_prefix_caching: false
max_num_batched_tokens: 32768
vae_use_slicing: false
vae_use_tiling: false
cache_backend: null
cache_config: null
enable_cache_dit_summary: false
parallel_config:
pipeline_parallel_size: 1
data_parallel_size: 1
tensor_parallel_size: 8
enable_expert_parallel: false
sequence_parallel_size: 1
ulysses_degree: 1
ring_degree: 1
cfg_parallel_size: 1
vae_patch_parallel_size: 1
use_hsdp: false
hsdp_shard_size: -1
hsdp_replicate_size: 1
final_output: true
final_output_type: image
# Top-level runtime config (concise): default windows and stage edges
runtime: