New Tool Radar

Local AI

How to Run faster-whisper on CUDA with compute_type float16

Speed up faster-whisper transcription by running it on an NVIDIA GPU with float16.

Schematic illustration with three step boxes: Check the GPU; Load the model on CUDA; Transcribe and time it.

faster-whisper can run on a GPU, and the compute_type setting picks the number format: float16 is the usual choice on NVIDIA cards, while int8 is the CPU choice. Running on CUDA with float16 is several times faster than CPU for long files. This guide loads the model on CUDA and times a transcription.

Before you start

  • Python with faster-whisper installed, plus a CUDA build of ctranslate2.
  • An NVIDIA GPU with drivers installed, checked with nvidia-smi.
  • An audio file of a few minutes to transcribe.

Check the GPU is visible

Confirm the card is present:

nvidia-smi

If the command fails, the GPU is not set up, and the CPU path is the fallback for this session.

Load the model on CUDA

Create the model with the CUDA device and float16:

from faster_whisper import WhisperModel
model = WhisperModel("base", device="cuda", compute_type="float16")

If the model fails to load, check that the CUDA build of ctranslate2 is installed; the plain CPU build cannot use the GPU.

Transcribe and time it

Transcribe the file and note how long it takes:

segments, info = model.transcribe("meeting.wav")
for s in segments:
    print(s.text)

Compare with the same file on CPU with compute_type int8. The CUDA run should finish in a fraction of the time.

Worked example

Worked example: a 10-minute meeting recording. On CPU with int8 it may take about 2 minutes to transcribe; on CUDA with float16 the same file should finish in well under a minute. The transcript text should be the same in both runs, apart from small decoding differences.

Expected result

UNTESTED in this guide: no transcription was run while writing it. The expected result is that the model loads on CUDA with float16 and the 10-minute file finishes noticeably faster than on CPU.

Limitations

float16 needs a GPU with enough memory for the model; a small card may run out of memory on the large model. If CUDA is not found at all, check the ctranslate2 build before changing the code.

Sources

See all