[Config] Add HunyuanImage3 deploy configs (#3172)
Signed-off-by: KexiongYu <yukexiong1@huawei.com> Signed-off-by: Y. Fisher <yukexiong1@huawei.com>
This commit is contained in:
1 parent
c9a8556c24
commit
a33e2eb588
26 files changed
+672
-742
No files matched your search
@@ -1517,14 +1517,9 @@ class HunyuanImage3ForConditionalGeneration(nn.Module, SupportsMultiModal, Suppo
|
||||
|
||||
# For comprehension mode, block image generation tokens but allow
|
||||
# text structure tokens (<think>, <answer>, etc.) so the model can
|
||||
# follow its natural generation pattern. The yaml stop_token_ids
|
||||
# for i2t/t2t now includes </think> (128024) so the AR-only output
|
||||
# terminates after the analysis section, matching HF's
|
||||
# `bot_task="think"` behavior. Without that stop, the model
|
||||
# continues into a recaption section even in comprehension mode
|
||||
# (the stage-transition processor only fires in generation mode,
|
||||
# but the instruct-tuned model writes recaption on its own from
|
||||
# internal habit).
|
||||
# follow its natural generation pattern. Runtime sampling params
|
||||
# decide stop tokens from the active bot_task, matching the official
|
||||
# HunyuanImage3 generation path without hard-coded YAML token ids.
|
||||
self._blocked_token_ids: set[int] = set()
|
||||
if self._is_comprehension:
|
||||
self._blocked_token_ids.update(
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""HunyuanImage3 pipeline topology."""
|
||||
|
||||
from vllm_omni.config.stage_config import (
|
||||
PipelineConfig,
|
||||
StageExecutionType,
|
||||
StagePipelineConfig,
|
||||
)
|
||||
|
||||
_HUNYUAN_IMAGE3_HF_ARCHS = (
|
||||
"HunyuanImage3ForConditionalGeneration",
|
||||
"HunyuanImage3ForCausalMM",
|
||||
)
|
||||
_HUNYUAN_IMAGE3_MODEL_ARCH = "HunyuanImage3ForCausalMM"
|
||||
_HUNYUAN_IMAGE3_INPUT_PROCESSOR = "vllm_omni.model_executor.stage_input_processors.hunyuan_image3"
|
||||
|
||||
|
||||
HUNYUAN_IMAGE3_PIPELINE = PipelineConfig(
|
||||
model_type="hunyuan_image3",
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
hf_architectures=_HUNYUAN_IMAGE3_HF_ARCHS,
|
||||
stages=(
|
||||
StagePipelineConfig(
|
||||
stage_id=0,
|
||||
model_stage="AR",
|
||||
execution_type=StageExecutionType.LLM_AR,
|
||||
input_sources=(),
|
||||
final_output=False,
|
||||
owns_tokenizer=False,
|
||||
requires_multimodal_data=True,
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
engine_output_type="latent",
|
||||
),
|
||||
StagePipelineConfig(
|
||||
stage_id=1,
|
||||
model_stage="dit",
|
||||
execution_type=StageExecutionType.DIFFUSION,
|
||||
input_sources=(0,),
|
||||
final_output=True,
|
||||
final_output_type="image",
|
||||
requires_multimodal_data=True,
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
custom_process_input_func=f"{_HUNYUAN_IMAGE3_INPUT_PROCESSOR}.ar2diffusion",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
HUNYUAN_IMAGE3_AR_PIPELINE = PipelineConfig(
|
||||
model_type="hunyuan_image3_ar",
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
hf_architectures=(),
|
||||
stages=(
|
||||
StagePipelineConfig(
|
||||
stage_id=0,
|
||||
model_stage="AR",
|
||||
execution_type=StageExecutionType.LLM_AR,
|
||||
input_sources=(),
|
||||
final_output=True,
|
||||
final_output_type="text",
|
||||
owns_tokenizer=False,
|
||||
requires_multimodal_data=True,
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
engine_output_type="latent",
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
HUNYUAN_IMAGE3_DIT_PIPELINE = PipelineConfig(
|
||||
model_type="hunyuan_image3_dit",
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
hf_architectures=(),
|
||||
stages=(
|
||||
StagePipelineConfig(
|
||||
stage_id=0,
|
||||
model_stage="dit",
|
||||
execution_type=StageExecutionType.DIFFUSION,
|
||||
input_sources=(),
|
||||
final_output=True,
|
||||
final_output_type="image",
|
||||
requires_multimodal_data=True,
|
||||
model_arch=_HUNYUAN_IMAGE3_MODEL_ARCH,
|
||||
),
|
||||
),
|
||||
)
|
||||
Reference in new issue
Block a user