Add AMD GPU support: faster_whisper CPU fallback + whisper.cpp backend#522
Closed
Kaihui-AMD wants to merge 2 commits into
Closed
Add AMD GPU support: faster_whisper CPU fallback + whisper.cpp backend#522Kaihui-AMD wants to merge 2 commits into
Kaihui-AMD wants to merge 2 commits into
Conversation
Signed-off-by: Kaihui-AMD <Kaihui.Tang@amd.com>
3fabeaa to
b5b859f
Compare
Collaborator
|
Closing for #523 |
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
Makes WhisperLive work on AMD GPUs (#520):
faster_whispercrashing on AMD/ROCm — fall back to CPU instead of crashing.whisper_cppbackend — real GPU transcription on AMD (Vulkan/ROCm), Intel, Apple.Verified on a Radeon AI PRO R9700 (RDNA4,
gfx1201) and a Ryzen AI Max+ 395 / Radeon 8060S("Strix Halo",
gfx1151— the #520 chip). CUDA / TensorRT / OpenVINO paths unaffected.1. faster_whisper: don't crash on AMD
CTranslate2's PyPI wheels are CUDA-only, but on ROCm
torch.cuda.is_available()isTrue, sothe server picked
device="cuda"and crashed (RuntimeError: CUDA failed ...). Guard on theCTranslate2 device count instead:
Applied to all three
WhisperModelsites (the websocket backend + both REST endpoints inserver.py). CUDA users are unaffected; diarization/translation use torch and already work onROCm.
2. New
whisper_cppbackend (GPU on AMD)ServeClientWhisperCppruns whisper.cpp viapywhispercpp — ggml's Vulkan/ROCm/Metal backends
give real GPU transcription where CTranslate2 can't. Vulkan is the portable path (one build →
AMD/Intel/NVIDIA). It plugs into the existing server (same protocol/clients) and falls back to
faster_whisperif pywhispercpp is missing. Addsdocker/Dockerfile.vulkan(turnkey) + README.Build pywhispercpp with GPU (from git;
setup.pyforwardsGGML_*to CMake):Verification
samples/jfk.wav(11 s), exact-text match; drove the real backend classes plus a fullrun_server.py -b whisper_cppend-to-end over WebSocket.device=cudacrash → now CPU, transcribes correctly.gfx1201Vulkan0(RADV GFX1201)gfx1201— full server E2E (WebSocket)Vulkan0gfx1151(#520 chip)Vulkan0(RADV GFX1151)gfx1151ROCm0¹
ggml-base.en, single runs — verification timings, not a formal benchmark.Notes
Dockerfile.vulkanhandles it.RDNA4 needs a recent Mesa/RADV.
no_speech_probis0.0, word timestamps + whisper.cpp VAD not wired, andthe OpenAI REST endpoint still uses CTranslate2 (CPU on AMD) — only the websocket backend is GPU.