A step-by-step guide to quantize the Supertonic TTS model for Qualcomm QCS6490 using QAIRT/QNN.
Note: To achieve the optimal performance and accuracy consider generating ctx binaries or serialised binaries specific to the architecture (v68 - mine)
I would be using QCS6490 chip architecture for walking through the steps.
Sample Output
Audio generated on QCS6490 board using quantized models (10 diffusion steps, raw and noisy):
The duration_predictor outputs a single scalar representing the total speech duration. This is post-processed into a latent_mask that tells the vector_estimator how many of the 256 fixed-size latent frames are active speech vs padding.
Workflow
1. Input Preparation
Prepare calibration inputs for model quantization.
Input_Preparation.ipynb
2. Step-by-Step Quantization
Convert ONNX models to QNN format with quantization for HTP backend.
Supertonic_TTS_StepbyStep.ipynb
3. Correlation Verification
Verify quantized model outputs against reference using cosine similarity.
Located in assets/onnx/ (git submodule from Hugging Face):
text_encoder.onnx
duration_predictor.onnx
vector_estimator.onnx
vocoder.onnx
QNN Models (Quantized)
Located in QNN_Models/:
text_encoder_htp.bin / .cpp
vector_estimator_htp.bin / .cpp
vocoder_htp.bin / .cpp
Compiled Libraries (Ready for Deployment)
Located in QNN_Model_lib/aarch64-oe-linux-gcc11.2/:
libtext_encoder_htp.so
libvector_estimator_htp.so
libvocoder_htp.so
libduration_predictor_htp.so
These .so files are compiled from the .cpp sources and are ready to be deployed (via SCP) to the board for inference.
Note: The duration_predictor is quantized and compiled but not used in the current calibration-based workflow since latent_mask is precomputed. For an end-to-end pipeline with arbitrary text input, the duration predictor must run first to dynamically generate the latent_mask.