[Config Refactor] Migrate Ming and Ming-TTS deploy/pipline configs (#3154)

Signed-off-by: Yuanheng Zhao <jonathan.zhaoyh@gmail.com>
Signed-off-by: yuanheng <jonathan.zhaoyh@gmail.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
Yuanheng ZhaoandHongsheng Liu authored and GitHub committed 2026-05-03 14:43:49 +12:00
1 parent 6a837849dd
commit d49356e4ca
25 files changed
+518 -398

No files matched your search

@@ -104,8 +104,8 @@ class MingFlashOmniForConditionalGeneration(
"model_arch='MingFlashOmniTalkerForConditionalGeneration' "
"directly — the talker has a self-contained LLM that "
"tokenises text itself and does not need the multimodal "
"preprocess path. See stage_configs/ming_flash_omni.yaml "
"stage 1 and stage_configs/ming_flash_omni_tts.yaml."
"preprocess path. See vllm_omni/deploy/ming_flash_omni.yaml "
"stage 1 and vllm_omni/deploy/ming_flash_omni_tts.yaml."
)
if self.model_stage == "thinker":
@@ -0,0 +1,106 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""Ming-flash-omni-2.0 pipeline topology (frozen).
Stage 0: Thinker — multimodal understanding + text generation.
Stage 1: Talker — text -> audio waveform via CFM + AudioVAE.
The thinker -> talker bridge passes the detokenized text rather than
hidden states through `ming_flash_omni.thinker2talker`; the talker has a
self-contained Qwen2 LLM that retokenizes the string itself.
"""
from vllm_omni.config.stage_config import (
PipelineConfig,
StageExecutionType,
StagePipelineConfig,
)
_PROC = "vllm_omni.model_executor.stage_input_processors.ming_flash_omni"
MING_FLASH_OMNI_PIPELINE = PipelineConfig(
model_type="ming_flash_omni",
model_arch="MingFlashOmniForConditionalGeneration",
# Upstream HF config applies model_type="bailingmm_moe_v2_lite"
# (the thinker sub-config name) rather than "ming_flash_omni".
# Declare the architectures here explicitly for routing
hf_architectures=(
"MingFlashOmniForConditionalGeneration",
"BailingMM2NativeForConditionalGeneration",
),
stages=(
StagePipelineConfig(
stage_id=0,
model_stage="thinker",
execution_type=StageExecutionType.LLM_AR,
input_sources=(),
final_output=True,
final_output_type="text",
owns_tokenizer=True,
requires_multimodal_data=True,
# Thinker reads the LLM sub-config of BailingMM2Config
hf_config_name="llm_config",
engine_output_type="text",
sampling_constraints={"detokenize": True},
),
StagePipelineConfig(
stage_id=1,
model_stage="ming_tts",
# Talker is a self-contained Qwen2 LLM + CFM + AudioVAE;
# it does not share the thinker backbone, so it gets its own arch.
model_arch="MingFlashOmniTalkerForConditionalGeneration",
execution_type=StageExecutionType.LLM_GENERATION,
input_sources=(0,),
final_output=True,
final_output_type="audio",
hf_config_name="talker_config",
engine_output_type="audio",
tokenizer_subdir="talker/llm",
custom_process_input_func=f"{_PROC}.thinker2talker",
),
),
)
# Standalone TTS variant: talker only.
MING_FLASH_OMNI_TTS_PIPELINE = PipelineConfig(
model_type="ming_flash_omni_tts",
model_arch="MingFlashOmniTalkerForConditionalGeneration",
stages=(
StagePipelineConfig(
stage_id=0,
model_stage="ming_tts",
execution_type=StageExecutionType.LLM_GENERATION,
input_sources=(),
final_output=True,
final_output_type="audio",
owns_tokenizer=True,
hf_config_name="talker_config",
engine_output_type="audio",
tokenizer_subdir="talker/llm",
),
),
)
# Thinker-only variant: multimodal understanding with text output
MING_FLASH_OMNI_THINKER_ONLY_PIPELINE = PipelineConfig(
model_type="ming_flash_omni_thinker_only",
model_arch="MingFlashOmniForConditionalGeneration",
stages=(
StagePipelineConfig(
stage_id=0,
model_stage="thinker",
execution_type=StageExecutionType.LLM_AR,
input_sources=(),
final_output=True,
final_output_type="text",
owns_tokenizer=True,
requires_multimodal_data=True,
hf_config_name="llm_config",
engine_output_type="text",
sampling_constraints={"detokenize": True},
),
),
)
@@ -963,7 +963,7 @@ class MingAudioGenerator:
)
if step > min_new_token and stop_prob > 0.5:
logger.info("Stopping at step %d with stop_prob=%.4f", step, stop_prob)
logger.debug("Stopping at step %d with stop_prob=%.4f", step, stop_prob)
break
return all_latents
@@ -1,46 +0,0 @@
# Stage config for Ming-flash-omni-2.0
# Stage 0: Thinker (Multimodal understanding + text generation)
# Stage 1a: Image Generator (Text embeddings -> PIL image)
# Stage 1b: Talker (Text embeddings -> audio waveform)
async_chunk: false
stage_args:
- stage_id: 0
stage_type: llm
runtime:
devices: "0,1,2,3"
max_batch_size: 1
engine_args:
model_stage: thinker
model_arch: MingFlashOmniForConditionalGeneration
# tokenizer_subdir: talker/llm
worker_type: ar
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
gpu_memory_utilization: 0.9
enforce_eager: false
trust_remote_code: true
engine_output_type: latent
distributed_executor_backend: "mp"
enable_prefix_caching: false
max_num_batched_tokens: 32768
tensor_parallel_size: 4 # Use 4 GPUs for MoE model
# pipeline_parallel_size: 4
hf_config_name: llm_config
compilation_config:
pass_config:
# there's a version mismatch regarding vllm and flashinfer
# disable fuse allreduce for now
fuse_allreduce_rms: false
final_output: true # Can output text directly
final_output_type: text
is_comprehension: true
default_sampling_params:
temperature: 0.4
top_p: 0.9
max_tokens: 2048
repetition_penalty: 1.05
seed: 42
detokenize: true
# Future Stage 1a: Image Generator (Optional - not yet implemented)
# Future Stage 1b: Talker/TTS (Optional - not yet implemented)
@@ -1,70 +0,0 @@
# Multi-stage config for Ming-flash-omni-2.0: Thinker + Talker
# Stage 0: Thinker (multimodal understanding → text generation)
# Stage 1: Talker (text → audio waveform via CFM + AudioVAE)
stage_args:
- stage_id: 0
stage_type: llm
runtime:
devices: "0,1,2,3"
max_batch_size: 1
engine_args:
model_stage: thinker
model_arch: MingFlashOmniForConditionalGeneration
worker_type: ar
scheduler_cls: vllm_omni.core.sched.omni_ar_scheduler.OmniARScheduler
gpu_memory_utilization: 0.74
enforce_eager: false
trust_remote_code: true
# Ming Thinker -> talker bridging reads the detokenized text via
# source_output.outputs[0].text rather than hidden states
engine_output_type: text
distributed_executor_backend: "mp"
enable_prefix_caching: false
max_num_batched_tokens: 32768
tensor_parallel_size: 4
hf_config_name: llm_config
compilation_config:
pass_config:
# there's a version mismatch regarding vllm and flashinfer
# disable fuse allreduce for now
fuse_allreduce_rms: false
final_output: true
final_output_type: text
is_comprehension: true
default_sampling_params:
temperature: 0.4
top_p: 0.9
max_tokens: 2048
repetition_penalty: 1.05
detokenize: true
ignore_eos: false
- stage_id: 1
stage_type: llm
runtime:
devices: "3"
max_batch_size: 1
engine_args:
# Use the standalone talker class
model_stage: ming_tts
model_arch: MingFlashOmniTalkerForConditionalGeneration
worker_cls: vllm_omni.worker.gpu_generation_worker.GPUGenerationWorker
scheduler_cls: vllm_omni.core.sched.omni_generation_scheduler.OmniGenerationScheduler
gpu_memory_utilization: 0.18
enforce_eager: true
trust_remote_code: true
engine_output_type: audio
enable_prefix_caching: false
max_num_batched_tokens: 1000000
tokenizer_subdir: talker/llm
# The HF repo ships BailingMM2Config (thinker-only) at root,
# OmniModelConfig treats that as "stage does not share outer mrope"
hf_config_name: talker_config
engine_input_source: [0]
custom_process_input_func: vllm_omni.model_executor.stage_input_processors.ming_flash_omni.thinker2talker
final_output: true
final_output_type: audio
default_sampling_params:
temperature: 0.0
max_tokens: 1
@@ -1,32 +0,0 @@
# Single-stage TTS config for Ming-flash-omni-2.0 Talker
# Stage 0: Talker only (text → audio waveform via CFM + AudioVAE)
# Use this config for standalone TTS deployment without thinker.
stage_args:
- stage_id: 0
stage_type: llm
is_comprehension: true
runtime:
devices: "0"
max_batch_size: 1
engine_args:
model_stage: ming_tts
model_arch: MingFlashOmniTalkerForConditionalGeneration
worker_cls: vllm_omni.worker.gpu_generation_worker.GPUGenerationWorker
scheduler_cls: vllm_omni.core.sched.omni_generation_scheduler.OmniGenerationScheduler
gpu_memory_utilization: 0.8
enforce_eager: true
trust_remote_code: true
engine_output_type: audio
enable_prefix_caching: false
max_num_batched_tokens: 100000
tokenizer_subdir: talker/llm
# NOTE: `hf_config_name` for Ming talker acts as a placeholder
# The HF repo ships BailingMM2Config (thinker-only) at root,
# OmniModelConfig treats that as "stage does not share outer mrope"
hf_config_name: talker_config
final_output: true
final_output_type: audio
default_sampling_params:
temperature: 0.0
max_tokens: 1