tests/omnivoice: add OmniVoice weight-type benchmark, report, and Python-to-C++ tests - #269
Merged
Merged
Conversation
Owner
|
@kawshikbuet17 Thanks for the PR! The test harness is heavier than I expected. Could you keep the benchmark report/docs and the lightweight |
Adds two CUDA sweep scripts for OmniVoice voice cloning that cover every combination of --num-inference-steps (8 to 64), generator weight type, and audio tokenizer weight type, for single requests and for --batch-text-file runs. Shared Bengali reference audio, reference text, and batch prompts live under tests/omnivoice/assets/. The measured results are in docs/reports/omnivoice_weight_type_benchmark.md, covering 375 single requests and 375 batch runs on an RTX 4090. Main findings: - omnivoice.generator_weight_type=f16 is 1.26x faster than native on average, and up to 1.31x at 64 steps. It is the fastest setting at every step count. - Runtime omnivoice.audio_tokenizer_weight_type=q8_0 produces unusable audio at every step count while being slower than both f16 and bf16, so there is no reason to select it. This is runtime quantization of SafeTensors weights, not a prebuilt Q8 GGUF package, which quantizes far more conservatively. - Wall time is 90-98% generator diffusion and scales linearly with step count, while audio tokenizer decode stays flat near 9-10 ms. Step count is therefore the largest latency lever. - Each --batch-text-file run of 10 prompts emits 10 separate session.wall_ms values, confirming that batched CLI input runs as sequential requests in one session rather than as a fused batch. Also documents omnivoice.generator_weight_type and omnivoice.audio_tokenizer_weight_type in docs/models/omnivoice.md, which did not list either option. Refs 0xShug0#158 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a lightweight way to drive OmniVoice from Python while keeping all inference in C++, reusing the shared Bengali fixtures in tests/omnivoice/assets/. test_python.py posts an OpenAI-compatible request to audiocpp_server using only the Python standard library, and run_cpp.sh is a matching audiocpp_cli baseline so the server path and the direct CLI path can be compared under identical settings. Paths in server.json resolve relative to the config file. No build files are touched. Refs 0xShug0#158 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
kawshikbuet17
force-pushed
the
omnivoice
branch
from
August 18, 2026 15:41
cc55808 to
71b3b9a
Compare
Contributor
Author
|
@0xShug0 thanks, now please check. |
Owner
|
Thanks @kawshikbuet17! Merged! |
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.
Summary
Follows up on #158, where you suggested opening a PR to add my OmniVoice test script under
tests/omnivoice/.This adds the voice-clone weight-type benchmark that produced the
q8_0audio-tokenizer finding I reported in that issue, plus two Python-to-C++ integration tests for OmniVoice.What is here
Benchmarks —
tests/omnivoice/run_clone_benchmark.shandrun_clone_batch_benchmark.shsweep every combination of--num-inference-steps(8 to 64),omnivoice.generator_weight_type, andomnivoice.audio_tokenizer_weight_type, for single requests and for--batch-text-fileruns. Shared Bengali fixtures live intests/omnivoice/assets/.Report —
docs/reports/omnivoice_weight_type_benchmark.mdholds the measurements: 375 single requests and 375 batch runs of 10 prompts on an RTX 4090.Integrations — two ways to drive OmniVoice from Python with inference staying in C++:
tests/omnivoice/python_cpp_simple/posts OpenAI-compatible requests toaudiocpp_serverusing only the Python standard library, with a matchingaudiocpp_clibaseline.tests/omnivoice/python_cpp_so/is a pybind11 extension that calls the session directly, no server and no subprocess. The model loads once and is reused acrossgenerate()calls.Docs —
docs/models/omnivoice.mddid not listomnivoice.generator_weight_typeoromnivoice.audio_tokenizer_weight_type, so both are now in the options table.Findings
omnivoice.generator_weight_type=f16averaged 1.26x faster thannative(up to 1.31x at 64 steps) and was fastest at every step count.omnivoice.audio_tokenizer_weight_type=q8_0produced unusable audio at every step count while being slower than bothf16andbf16. This is the issue Help Wanted: OmniVoice Batch Infererence #158 finding, and it is runtime quantization of SafeTensors weights — not the prebuilt Q8 GGUF package, which as you noted quantizes far more conservatively.--batch-text-filerun of 10 prompts emitted 10 separatesession.wall_msvalues across all 375 batch combinations, matching what you described in Help Wanted: OmniVoice Batch Infererence #158: batched CLI input runs as sequential requests in one session. The 1.20x-1.36x per-request gain over an isolated single request comes from session and graph reuse, not batching — the first request in each batch is consistently the slowest.Recommended pairing for this route:
Build and run
python3 tools/model_manager.py install omnivoice cmake -S . -B build -DENGINE_ENABLE_CUDA=ON cmake --build build --parallel --target audiocpp_cli audiocpp_server ./tests/omnivoice/run_clone_benchmark.sh ./tests/omnivoice/run_clone_batch_benchmark.shThe pybind11 extension is opt-in behind a new
ENGINE_BUILD_OMNIVOICE_PYTHON_BINDINGCMake option that defaults to OFF, so existing builds are unaffected:build.shpasses-DENGINE_BUILD_OMNIVOICE_PYTHON_BINDING=ONrather than editing the rootCMakeLists.txt. The built.sois gitignored.Server path:
Environment tested
models/OmniVoiceSafeTensorsttsvoice cloning, Bengali reference audio and textKnown limitations
q8_0audio-tokenizer failure is a listening judgement. The sweep WAVs were not retained, so the report does not attach a numeric similarity metric. Reproducing it means listening to the generated audio.test_so_2.pykeeps amulti_infer()path that is skipped:binding.cppdoes not exposegenerate_batch(), since there is no fused batch entry point to bind yet.dev_kawshikbranch: single inference, batch. The report tables are parsed directly from these two files.Refs #158