[Feature] timestamps for TTS via a forced-aligner pooling (#4795)
Signed-off-by: wjinxu <1299461899@qq.com> Co-authored-by: xurui <xurui1@modelbest.onaliyun.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
28 files changed
+850
-627
No files matched your search
@@ -191,6 +191,8 @@ class OmniEngineArgs(EngineArgs):
|
||||
quantization_config: Any | None = None
|
||||
force_cutlass_fp8: bool | None = None
|
||||
worker_type: str | None = None
|
||||
# Dotted path of a per-stage pooling-output decoder applied worker-side.
|
||||
pooling_output_decoder: str | None = None
|
||||
task_type: str | None = None
|
||||
worker_cls: str = None # type: ignore[assignment] # Upstream default is "auto"; omni resolves
|
||||
# in __post_init__ based on worker_type (ar/generation), so None is safe here.
|
||||
@@ -380,6 +382,7 @@ class OmniEngineArgs(EngineArgs):
|
||||
model_stage=self.model_stage,
|
||||
model_arch=self.model_arch,
|
||||
worker_type=self.worker_type,
|
||||
pooling_output_decoder=self.pooling_output_decoder,
|
||||
engine_output_type=self.engine_output_type,
|
||||
hf_config_name=self.hf_config_name,
|
||||
custom_process_next_stage_input_func=self.custom_process_next_stage_input_func,
|
||||
@@ -475,6 +478,11 @@ class OrchestratorArgs:
|
||||
# === Mode Switches (orchestrator reads, DeployConfig redistributes) ===
|
||||
async_chunk: bool | None = None
|
||||
|
||||
# === Forced aligner (orchestrator injects a pooling stage; never a per-stage knob) ===
|
||||
forced_aligner: str | None = None
|
||||
forced_aligner_config: str | None = None
|
||||
forced_aligner_device: str | None = None
|
||||
|
||||
# === Observability ===
|
||||
log_stats: bool = False
|
||||
enable_orch_monitor: bool = False
|
||||
|
||||
@@ -1543,11 +1543,19 @@ class Orchestrator:
|
||||
return request
|
||||
|
||||
processor = self._get_stage_input_processor(next_stage_id)
|
||||
# A pooling stage is driven by PoolingParams; vLLM validates them against
|
||||
# the stage's supported tasks, so advertise the model's pooling tasks (or
|
||||
# the configured task) instead of generate.
|
||||
if isinstance(params, PoolingParams):
|
||||
model_cfg = next_pool.stage_vllm_config.model_config
|
||||
supported_tasks = tuple(getattr(model_cfg, "supported_tasks", ()) or ()) or (params.task,)
|
||||
else:
|
||||
supported_tasks = ("generate",)
|
||||
request = processor.process_inputs(
|
||||
request_id=req_id,
|
||||
prompt=next_input,
|
||||
params=params,
|
||||
supported_tasks=("generate",),
|
||||
supported_tasks=supported_tasks,
|
||||
arrival_time=_time.time(),
|
||||
resumable=resumable,
|
||||
)
|
||||
|
||||
@@ -20,6 +20,7 @@ from dataclasses import dataclass, fields, replace
|
||||
from typing import Any, Literal, cast
|
||||
|
||||
from vllm.logger import init_logger
|
||||
from vllm.pooling_params import PoolingParams
|
||||
from vllm.renderers import BaseRenderer
|
||||
from vllm.sampling_params import SamplingParams
|
||||
from vllm.tokenizers import cached_tokenizer_from_config
|
||||
@@ -395,8 +396,19 @@ def extract_legacy_stage_metadata(stage_config: Any) -> StageMetadata:
|
||||
final_output_type: str | None = stage_config.final_output_type
|
||||
|
||||
default_sp = _to_dict(_get_attr_or_item(stage_config, "default_sampling_params", {}))
|
||||
SPClass = SamplingParams if stage_type == "llm" else OmniDiffusionSamplingParams
|
||||
default_sampling_params: OmniSamplingParams = SPClass(**default_sp)
|
||||
# A pooling stage carries its task via default_pooling_params, set where the
|
||||
# stage is declared.
|
||||
default_pp = _to_dict(_get_attr_or_item(stage_config, "default_pooling_params", {}))
|
||||
# A pooling stage is an LLM stage run with runner="pooling" (vLLM's
|
||||
# is_pooling_model signal); pick params by that signal, not execution_type.
|
||||
is_pooling = str(engine_args.get("runner", "")).lower() == "pooling"
|
||||
default_params: OmniSamplingParams | PoolingParams
|
||||
if stage_type == "diffusion":
|
||||
default_params = OmniDiffusionSamplingParams(**default_sp)
|
||||
elif is_pooling:
|
||||
default_params = PoolingParams(**default_pp)
|
||||
else: # generative llm: ar / generation
|
||||
default_params = SamplingParams(**default_sp)
|
||||
|
||||
custom_process_input_func: Callable | None = None
|
||||
_cpif_path = _get_attr_or_item(stage_config, "custom_process_input_func")
|
||||
@@ -428,7 +440,7 @@ def extract_legacy_stage_metadata(stage_config: Any) -> StageMetadata:
|
||||
engine_input_source=engine_input_source,
|
||||
final_output=final_output,
|
||||
final_output_type=final_output_type,
|
||||
default_sampling_params=default_sampling_params,
|
||||
default_sampling_params=default_params,
|
||||
custom_process_input_func=custom_process_input_func,
|
||||
model_stage=model_stage,
|
||||
runtime_cfg=runtime_cfg,
|
||||
@@ -448,7 +460,7 @@ def extract_legacy_stage_metadata(stage_config: Any) -> StageMetadata:
|
||||
engine_input_source=engine_input_source,
|
||||
final_output=final_output,
|
||||
final_output_type=final_output_type,
|
||||
default_sampling_params=default_sampling_params,
|
||||
default_sampling_params=default_params,
|
||||
custom_process_input_func=custom_process_input_func,
|
||||
model_stage=model_stage,
|
||||
runtime_cfg=runtime_cfg,
|
||||
|
||||
Reference in new issue
Block a user