From 091b256674afa1bae476553c35ab1d22d155608a Mon Sep 17 00:00:00 2001 From: ztyan <191593482+vivivi-111@users.noreply.github.com> Date: Mon, 5 Oct 2026 20:20:25 +0800 Subject: [PATCH] [Model][Perf] IndexTTS2: drop per-step hidden D2H in latent mode (#8478) Signed-off-by: ztyan <191593482+vivivi-111@users.noreply.github.com> --- .../models/indextts2/test_talker_v2_5.py | 6 +++--- .../models/indextts2/indextts2_talker.py | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/model_executor/models/indextts2/test_talker_v2_5.py b/tests/model_executor/models/indextts2/test_talker_v2_5.py index c916354e3..67efc787a 100644 --- a/tests/model_executor/models/indextts2/test_talker_v2_5.py +++ b/tests/model_executor/models/indextts2/test_talker_v2_5.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project +# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project from types import SimpleNamespace @@ -215,8 +215,8 @@ def test_mel_head_preserves_official_checkpoint_bias_and_hidden_payload_policy( assert seen["bias"] is True assert talker.mel_head.bias is not None - assert talker.omni_pooler_payload_include_hidden is use_gpt_latent - assert talker.omni_payload_at_request_end is (model_type == "indextts2_5") + assert talker.omni_pooler_payload_include_hidden is False + assert talker.omni_payload_at_request_end is True def test_v2_load_weights_loads_exact_mel_head_bias_parameter(monkeypatch): diff --git a/vllm_omni/model_executor/models/indextts2/indextts2_talker.py b/vllm_omni/model_executor/models/indextts2/indextts2_talker.py index f9eae0c6f..a70fd9df4 100644 --- a/vllm_omni/model_executor/models/indextts2/indextts2_talker.py +++ b/vllm_omni/model_executor/models/indextts2/indextts2_talker.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project +# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project """IndexTTS2 Stage 0: GPT-2 AR Talker with vLLM-native PagedAttention. Predicts mel codes autoregressively and collects hidden_states as latent @@ -158,17 +158,18 @@ class IndexTTS2TalkerForConditionalGeneration(nn.Module): self.has_postprocess = True self.requires_raw_input_tokens = True self.enable_update_additional_information = True - # Stage 1 consumes the hidden-state stream only in the legacy - # ``use_gpt_latent`` mode. IndexTTS 2.5 transports mel codes plus - # reference conditioning, so asking the generic runner to include - # hidden states would add a synchronous [num_tokens, model_dim] D2H - # copy on every decode step without adding anything to the payload. - self.omni_pooler_payload_include_hidden = self.use_gpt_latent + # S2Mel never reads the generic pooler ``hidden`` key: latent mode + # ships the aligned GPT latent as ``hidden_states.latent`` from + # make_omni_output, and no-latent mode needs no hidden state at all. + # Including it would add a synchronous [num_tokens, model_dim] D2H + # copy plus a CPU-side concat on every decode step, which also + # serializes async scheduling. + self.omni_pooler_payload_include_hidden = False # S2Mel consumes the complete sequence only at request end. In latent # mode the runner retains aligned code/latent deltas on GPU; no-latent # mode reuses the CPU output-token history and retains only conditioning # metadata here. - self.omni_payload_at_request_end = self.config.model_type == "indextts2_5" + self.omni_payload_at_request_end = True self.omni_request_end_token_ids = () self._speaker_cache = get_speaker_cache() self.gpu_resident_buffer_keys: set[tuple[str, str]] = {