Skip to content

fix: use int8 compute type for WhisperX on non-CUDA devices#20

Open
Rajkumar2002-Rk wants to merge 1 commit intofacebookresearch:mainfrom
Rajkumar2002-Rk:fix/cpu-compute-type
Open

fix: use int8 compute type for WhisperX on non-CUDA devices#20
Rajkumar2002-Rk wants to merge 1 commit intofacebookresearch:mainfrom
Rajkumar2002-Rk:fix/cpu-compute-type

Conversation

@Rajkumar2002-Rk
Copy link
Copy Markdown

Summary

compute_type in ExtractWordsFromAudio._get_transcript_from_audio is hardcoded to float16 (line 108 of eventstransforms.py). This causes a ValueError on any non-CUDA device because CTranslate2 requires dedicated hardware (e.g. NVIDIA Tensor Cores) for efficient float16 computation.

This affects all users running on:

  • Apple Silicon Macs (M1/M2/M3/M4)
  • CPU-only Linux machines
  • Any environment without an NVIDIA GPU

Fix

Fall back to int8 quantization when device != cuda:

Before: compute_type = "float16"
After: compute_type = "float16" if device == "cuda" else "int8"

The CUDA path is unchanged — users with NVIDIA GPUs still get float16 as before. The int8 fallback is supported by CTranslate2 on all platforms and produces negligible transcription accuracy loss (<1% WER degradation).

Testing

Tested on Apple Silicon Mac (M2 Pro, macOS 26.3.1, Python 3.11.7) with the Sintel trailer demo from the README. Full pipeline ran successfully: video → audio extraction → WhisperX transcription → TRIBE v2 brain prediction.

Related

The config.yaml shipped with the HuggingFace checkpoint also hardcodes device: cuda for the text, audio, and video feature extractors. This is a separate issue that could be addressed in a follow-up PR.

compute_type was hardcoded to float16, which fails on CPU because
CTranslate2 requires dedicated hardware (e.g. NVIDIA Tensor Cores)
for efficient float16 computation. This causes a ValueError on any
non-CUDA device, including Apple Silicon Macs and CPU-only Linux.

Fall back to int8 quantization on non-CUDA devices. int8 is supported
by CTranslate2 on all platforms and produces negligible transcription
accuracy loss (<1% WER degradation) for downstream use.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant