feat(cosyvoice3): add native reference-voice synthesis - #1266
Draft
ErliCai wants to merge 3 commits into
Draft
Conversation
Onboard Fun-CosyVoice3-0.5B-2512 through the standard checkpoint-to-bundle builder and native runtime. Keep the six learned TensorRT components, reference preprocessing, orchestration, and validation inside the family. Add a model-agnostic optional reference-audio capability and CLI inputs so callers can supply a voice for each request without rebuilding. Add BOOL tensor support for attention masks while preserving text-only audio APIs. Support offline batch-one FP32 synthesis. Include family-owned build, frontend, native runtime, and checkpoint-to-CLI tests. Do not claim streaming support, waveform parity, or perceptual-quality qualification. Exclude local notes, recordings, model assets, and generated evidence. Refs: NVIDIA#1263 Signed-off-by: LazzyE <caierli123@gmail.com>
Keep the onboarding PR focused on build/runtime support and required tests. Remove the standalone diagnostics and validation command-line modules, along with tests specific to those removed tools. Retain only the reference helpers used by correctness tests under the family tests directory. Do not change runtime code or numerical thresholds. The retained family suite passed 182 tests with the previously validated checkpoint-build E2E deselected. Preserve the development tools on the original feature branch. Signed-off-by: LazzyE <caierli123@gmail.com>
Keep native synthesis on the standard build and per-request reference-audio path. Remove the obsolete packager and schema-1 loader rather than retaining bundle compatibility. Exercise request-time frontends in native orchestration tests and reject obsolete bundles in checkpoint E2E. Signed-off-by: LazzyE <caierli123@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Refs #1263.
Add native TensorRT reference-voice synthesis for Fun-CosyVoice3-0.5B-2512. This advances the issue's initial component-packaging proposal: the standard build entry point now builds the complete bundle, and callers supply reference audio per request.
Exit Criteria
Implementation
IReferenceAudioGenerationinterface and CLI--reference-audio/--reference-textinputs. ExistingIAudioGenerationvirtual methods remain unchanged.Change categories
Validation
Commands and Results
Latest cleanup:
0d65f7c16cc449740e5553c7877b51b7913611f6. Paths below use$BUILD_DIRfor the local native build directory.cmake --build "$BUILD_DIR" --target trtmc trtmc_backend_trt test_cosyvoice3_runtime test_cli -j 2: passed. Native sources were synchronized to the feature worktree used by the existing build directory.ctest --test-dir "$BUILD_DIR" -R cosyvoice3 --output-on-failure: 1 passed; request-time frontend/orchestration, repeat-request state, error handling, and engine lifetime checks.ctest --test-dir "$BUILD_DIR" -R cli --output-on-failure: 1 passed.python -m pytest families/cosyvoice3/tests/test_bundle.py -k fixed_voice -q: 1 passed, 1 deselected.ruff check families/cosyvoice3, changed C++ formatting,git diff --check github/main...HEAD,python tools/legal_headers.py --check,python -m tools.model_ci validate, andpython tools/test_impact.py --validate: passed; legal headers reported zero findings.Earlier evidence, not a fresh full-suite result for this head:
edaabeca,python -m pytest families/cosyvoice3/tests -k 'not test_cosyvoice3_build_to_reference_audio' -q -ra --e2e-model=cosyvoice3with checkpoint, native, official-reference, and GPU inputs configured: 182 passed, 1 deselected.python -m pytest families/cosyvoice3/tests/test_e2e.py --e2e-model=cosyvoice3: 2 passed, including a fresh default-profile checkpoint build and native reference-audio synthesis. This establishes execution, not perceptual quality.Hardware, Environment, and Revisions
31701eb142b1cd6e47dc04ff80a3c1ecb13051b3; head:0d65f7c16cc449740e5553c7877b51b7913611f6.FunAudioLLM/Fun-CosyVoice3-0.5B-2512at29e01c4e8d000f4bcd70751be16fa94bf3d85a18.FunAudioLLM/CosyVoiceat074ca6dc9e80a2f424f1f74b48bdd7d3fea531cc; Transformers 5.2.0 and x-transformers 2.11.24 used for reference validation.Not Run / Remaining Gaps
Contributor Self-Review
Notes For Future Readers
Review the public reference-audio contract and CLI first, then family build/runtime and tests. The shared edits express reference-audio inputs and BOOL tensors; model semantics remain in the family. All introduced commits carry author-matching DCO sign-offs.
Checkpoint provenance and license: pinned model card. Reference equations follow the pinned Apache-2.0 upstream source. Model weights and audio are not redistributed in this PR.
Risk level
New multi-engine model integration and additive public/native contracts warrant maintainer review and exact-head CI. Local synthesis and component checks do not establish general audio-quality acceptance.