Skip to content

[MOSS-TTS] Fast pcm convert and first-frame codec in stage0 - #8640

Merged
Sy0307 merged 13 commits into
vllm-project:mainfrom
gcanlin:perf/moss-first-audio-prefix-cache
Oct 9, 2026
Merged

Sy0307 merged 13 commits into
vllm-project:mainfrom
gcanlin:perf/moss-first-audio-prefix-cache

Conversation

@gcanlin

@gcanlin gcanlin commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator
  1. Fast PCM conversion: convert float32 audio to interleaved PCM16 using in-place NumPy operations.
  2. First-frame codec in Stage0: decode and send the first frame directly from Stage0; Stage1 maintains codec history and delivers the remaining audio.
  3. First-frame MTP immediately after prefill: change prefill → wait for next scheduling step → first-frame MTP → first-frame codec → send to prefill → first-frame MTP → first-frame codec → send. Cache the codes and audio embedding for the next decode step, avoiding duplicate MTP computation while preserving output length and CUDA Graph execution.

H200, BF16, MPS, prefix cache enabled; full SeedTTS EN1088 voice cloning, output length 256. Two warm rounds per concurrency; cold round excluded. Main uses the previously measured base a46e9aae7.

Concurrency main audio-s/s PR audio-s/s Throughput change main mean TTFP (ms) PR mean TTFP (ms) TTFP change
C64 451.3 429.5 -4.8% 174.6 72.2 -58.7%
C128 514.3 527.3 +2.5% 561.6 177.8 -68.3%

File-reference benchmark (H200, 2026-10-09)

PR head ad135eedc, one H200 (GPU 6), BF16, MPS and prefix cache enabled; moss_tts_local_mrv2_optimized.yaml, with server CPU affinity 48–79. Full SeedTTS EN1088 per round, output length 256; all 3,264 requests succeeded, with no failures. The first C64 pass warms the reference caches; subsequent rows use the warmed server.

Run from this PR checkout, with the server allowing --allowed-local-media-path /root/vllm-omni-workspace:

PYTHONPATH="$PWD" \
VLLM_OMNI_BENCH_AUDIO_SAMPLE_RATE=48000 \
VLLM_OMNI_BENCH_AUDIO_CHANNELS=2 \
OMP_NUM_THREADS=1 \
taskset -c 80-95 /root/vllm-omni-workspace/.venv/bin/python benchmarks/tts/bench_tts.py \
  --host 127.0.0.1 \
  --port 8124 \
  --model OpenMOSS-Team/MOSS-TTS-Local-Transformer-v1.5 \
  --task voice_clone \
  --locale en \
  --dataset-path /root/vllm-omni-workspace/seedtts_testset \
  --num-prompts 1088 \
  --concurrency 64 64 128 \
  --output-len 256 \
  --output-dir /root/vllm-omni-workspace/moss-pr8232-perf-20261008/artifacts/pr_file_ref_gpu6_20261009 \
  -- --seed-tts-file-ref-audio
Round Concurrency Reference-cache state Audio throughput (audio-s/s) Mean TTFP (ms)
1 C64 First pass 204.2 691.8
2 C64 After full-dataset warmup 442.5 60.1
3 C128 After full-dataset warmup 549.1 128.8

Reference audio is already stored on the server. --seed-tts-file-ref-audio sends a file:// URI instead of embedding the WAV as base64 in every request, reducing HTTP request-body handling and frontend queueing. These are separate measurements using file references; the original inline-audio results above are retained.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@vllm-omni-review-bot

Copy link
Copy Markdown

This PR appears to belong to: docs/design/module/ar_runtime.md, docs/design/module/model_integration.md.

Module owners: @tzhouam @fake0fan @Gaohan123

Routing: @tzhouam via module of the changed files, semantic router, CODEOWNERS; @fake0fan via module of the changed files; @Gaohan123 via module of the changed files

@gcanlin, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer.

Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@vllm-omni-review-bot

vllm-omni-review-bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Omni ReviewBot triage note

Automated triage of commit 4d114a308458 produced:

  • Priority: high. Prompt maintainer attention is suggested.

These are automated triage suggestions only — the final decision belongs to the maintainers.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@gcanlin
gcanlin marked this pull request as draft October 8, 2026 15:41
@gcanlin gcanlin changed the title [Model] Reduce MOSS Local first-audio latency with prefix caching [Model] Fast pcm convert and quick codec decoder in stage0 Oct 8, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@gcanlin gcanlin changed the title [Model] Fast pcm convert and quick codec decoder in stage0 [MOSS-TTS] Fast pcm convert and quick codec decoder in stage0 Oct 8, 2026
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@gcanlin
gcanlin marked this pull request as ready for review October 8, 2026 18:30
@gcanlin gcanlin added the ready label to trigger buildkite CI label Oct 8, 2026
@gcanlin

gcanlin commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator Author

@Sy0307 I have reviewed the agent code. Most of them are clean now. PTAL.

@gcanlin gcanlin changed the title [MOSS-TTS] Fast pcm convert and quick codec decoder in stage0 [MOSS-TTS] Fast pcm convert and first-frame codec in stage0 Oct 8, 2026
@hsliuustc0106 hsliuustc0106 added the tts code related to tts models label Oct 9, 2026
@vllm-omni-review-bot

Copy link
Copy Markdown
Omni ReviewBot routing record

Assigned Strict on zcode (GLM-5.3-Flash) under experiment fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002.

@gcanlin gcanlin removed the ready label to trigger buildkite CI label Oct 9, 2026
Keep the shared load_codec() used by Stage0 and Stage1, and retain
vllm-project#7556's BF16 decode LUT on both CUDA and NPU.

Validation: 33 CPU tests passed; 8 skipped and 4 deselected.
Applicable pre-commit checks passed on the conflict-resolved file.
GPU/NPU audio parity and performance were not remeasured after merging.

AI assistance: Codex resolved the merge conflict and ran local checks.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@gcanlin gcanlin added the ready label to trigger buildkite CI label Oct 9, 2026

@Sy0307 Sy0307 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for the E2E-confirmed stop-condition regression. The two code findings are attached inline.

Documentation still describes removed paths — recipes/OpenMOSS/MOSS-TTS.md:184 and lines 379–387.

The recipe still describes the below-32-active-stream fast path, Stage1-specific first-chunk graphs and gating, batch limit 16, and eager MTP as the default, although this PR removes those mechanisms or changes their defaults. These instructions lead users to tune behavior that no longer exists and omit the additional decoder resources introduced in Stage0. Please update both sections to describe the Stage0 first-frame path, its actual executor/TP/PP requirements, current defaults, and resource cost.

Validation scope: the stop finding was reproduced through the real speech HTTP endpoint on H200 using unmodified source, with the stop IDs configured in the Stage0 deployment YAML. The decoder finding was verified during actual single-GPU initialization with MultiprocExecutor; TP>1 and PP>1 were not tested. The documentation finding is based on code/documentation comparison.

# preserving max_tokens and avoiding a second MTP for that frame.
rows = [row for row in self._completing_rows if input_batch.req_ids[row] in early.waiting]
if rows:
self._run_local_eager_mtp(input_batch, rows, set(rows))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With Stage0 stop_token_ids=[151656] and max_tokens>1, the first audio-slot token should terminate generation, but this path publishes audio before the stop decision is processed. H200 HTTP E2E tests returned an extra 80 ms of PCM in 15/15 requests on both ad135eed (C128) and 142a60db (capacity 16), while the pre-PR base produced no audio. Please gate publication on the canonical stop decision, or disable early publication for these constraints; audio already delivered to the client cannot be retracted.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c448cd2

# First audio is part of the MRV2 streaming slot-state path. Load it
# here so its weights and graphs count toward model memory profiling.
model_config = self.vllm_config.model_config
if (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This initialization predicate does not match the sink-binding requirements: with Stage0 MultiprocExecutor, TP=1 and PP=1, the decoder is initialized even though _bind_first_audio_sink returns False. Actual H200 initialization confirmed approximately 1.98 GiB of decoder parameter weights, excluding buffers and graph memory, plus capture of 19 first-frame graph buckets. Please use a shared capability check for decoder initialization and sink binding so configurations without a sender do not allocate these unused resources.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4d114a3

…tion

Keep requests whose first audio-slot token can terminate generation on the
canonical delivery path. Cover the effective EOS, explicit stop IDs, token
and context limits, and constraints that can change the first token.
Default requests retain the prefill MTP and Stage0 first-frame path.

Validation: 103 CPU tests passed. H200 speech HTTP checks changed 28/31
stop requests with an extra 80 ms frame to 0/31; max_tokens=1 also emits
zero PCM. The API retains its existing no-audio error response.
Matched default C64/C128 performance checks are running separately.

AI assistance: Codex implemented the guard and ran the checks.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@hsliuustc0106 hsliuustc0106 added the high priority high priority issue, needs to be done asap label Oct 9, 2026 — with ChatGPT Codex Connector
Use the same TP/PP and executor-class requirements for decoder loading
and sink binding. MultiprocExecutor no longer loads unused Stage0 codec
weights or captures first-frame graphs; UniProcExecutor subclasses retain
the existing path. Update the recipe's removed Stage1 fast-path description
with the current execution order, requirements, defaults and memory cost.

Validation: 92 CPU tests and applicable pre-commit checks passed. Actual
H200 TP=PP=1 MultiprocExecutor initialization skipped Stage0 first-frame
loading/capture. HTTP audio checks passed for streaming/non-streaming PCM,
cancellation, slot reuse and 33 seeded plus 33 unseeded concurrent requests.
TP/PP>1 capability cases were covered on CPU only.

AI assistance: Codex implemented the shared check and ran validation.

Signed-off-by: Canlin Guo <canlinguosdu@gmail.com>
@gcanlin gcanlin added ready label to trigger buildkite CI and removed ready label to trigger buildkite CI labels Oct 9, 2026

@Sy0307 Sy0307 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and have checked all issues fixed.

@Sy0307
Sy0307 merged commit 7eb48e6 into vllm-project:main Oct 9, 2026
7 of 9 checks passed
yenuo26 added a commit to yenuo26/vllm-omni that referenced this pull request Oct 10, 2026
Accept the deletion of MOSS-TTS tests removed in vllm-project#8640. Route platform marks that landed on main through hardware_test / hardware_marks so the stricter check-mark hook stays clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
khairulkabir1661 pushed a commit to khairulkabir1661/vllm-omni that referenced this pull request Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

high priority high priority issue, needs to be done asap ready label to trigger buildkite CI tts code related to tts models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants