How to Configure ASR Compute Type in VoiceStudio: Environment Variable Guide
Set the ASR_COMPUTE_TYPE environment variable to float16, int8, or float32 before launching VoiceStudio to force a specific numeric precision for Automatic Speech Recognition and override automatic hardware detection.
VoiceStudio determines which numeric precision to use for ASR engines at runtime through automatic hardware detection. While the application defaults to efficient half-precision mode when possible, you can manually configure the ASR compute type to ensure compatibility with older GPUs or achieve reproducible benchmarking results.
Automatic ASR Compute Type Detection
VoiceStudio attempts to use float16 (FP16) mode first for optimal performance on modern GPUs. If the GPU or underlying CTranslate2/cuDNN stack cannot execute FP16 operations, the engine automatically falls back to int8 quantization or float32 on CPU hardware.
This fallback mechanism is implemented in backend/core/failure.py, which logs a COMPUTE_TYPE_UNSUPPORTED error when the primary precision fails and triggers the downgrade sequence. The automatic detection runs at runtime without requiring configuration, but may fail on certain hardware configurations that lack support for intermediate formats.
Override ASR Compute Type with Environment Variables
To bypass automatic detection, set the ASR_COMPUTE_TYPE environment variable before starting the application. This variable is read during backend initialization by backend/services/asr_backend.py and the sidecar process defined in backend/engines/_asr_sidecar/main.py.
Accepted values include:
float16– Half-precision mode offering fastest inference on supported NVIDIA GPUs (RTX 20 series and newer).int8– 8-bit quantization providing compatibility with older GPUs lacking FP16 support.float32– Full-precision CPU mode used when no GPU is available or for maximum accuracy.
Implementation Examples
Linux and macOS (Bash):
export ASR_COMPUTE_TYPE=int8
# Restart VoiceStudio to apply the new setting
./scripts/run.sh
Windows (PowerShell):
$env:ASR_COMPUTE_TYPE = "float16"
.\VoiceStudio.exe
Python (Programmatic Configuration):
import os
os.environ["ASR_COMPUTE_TYPE"] = "float32"
from backend.services import asr_backend
When to Configure ASR Compute Type Manually
Override the default behavior in these specific scenarios:
- Legacy Hardware: Maxwell or Pascal GPUs (GTX 900/10 series) lack native FP16 support and require
int8orfloat32to prevent initialization failures. - Stability Issues: When the engine crashes after automatic fallback attempts, pin to a supported compute type to eliminate the
COMPUTE_TYPE_UNSUPPORTEDerror loop. - Reproducible Benchmarking: Fix the precision level to remove nondeterministic hardware detection and ensure consistent performance measurements across test runs.
Summary
- VoiceStudio auto-detects optimal precision via
backend/core/failure.py, falling back from float16 to int8 or float32 when hardware constraints are encountered. - Force specific modes by setting the
ASR_COMPUTE_TYPEenvironment variable tofloat16,int8, orfloat32before startup. - Both
backend/services/asr_backend.pyandbackend/engines/_asr_sidecar/main.pyread this variable during initialization. - Configuration changes require a full application restart to take effect.
Frequently Asked Questions
What are the valid values for ASR_COMPUTE_TYPE?
VoiceStudio accepts three precision modes: float16 for half-precision GPU inference, int8 for quantized inference on older GPUs, and float32 for full-precision CPU processing. These values are case-sensitive and validated at startup by the ASR service implementation.
Why does VoiceStudio show a COMPUTE_TYPE_UNSUPPORTED error?
This error appears when the automatically selected precision (typically float16) is incompatible with your GPU architecture. The engine logs this via backend/core/failure.py before attempting fallback. Set ASR_COMPUTE_TYPE=int8 to force compatible quantization and bypass the error.
Do I need to restart VoiceStudio after changing ASR_COMPUTE_TYPE?
Yes. VoiceStudio reads this environment variable only during backend initialization in backend/services/asr_backend.py and the sidecar process. Changes take effect only after fully restarting the application or the backend service.
Can I configure ASR compute type without environment variables?
Currently, VoiceStudio only supports configuration via the ASR_COMPUTE_TYPE environment variable. There is no runtime API or configuration file option; the sidecar process at backend/engines/_asr_sidecar/main.py exclusively checks this variable at startup according to the source code.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →