CLI and API silently fall back to CPU on Ascend NPU because only CUDA is auto-detected
Author: li-lizheCreated Sep 21, 2026Updated Sep 21, 2026
Bug description\n\nOn an Ascend NPU machine with torch_npu installed but no CUDA, WhisperX currently defaults to CPU because is the only accelerator checked.\n\n- line 19: default is \n- line 98: \n- lines 350-351: \n- lines 426-427: only when does it form \n- line 145: falls back to for any non-negative int, which crashes on NPU-only hosts.\n\nThis means an NPU user either runs on CPU (massive perf loss) or, when using the Python API with an integer device, gets a error.\n\n## Reproduction\n\nOn an Ascend 910B host (no CUDA):\n\n\n## Proposed fix\n\nUse torch-accelerator style detection: check , , , etc., and keep the first available accelerator as the default. Replace the hard-coded checks in with device-agnostic logic that respects the actual accelerator name.\n\nI can open a PR for this.\n\n## Environment\n\n- torch 2.15.0.dev20260917+cpu\n- torch_npu 2.15.0\n- Ascend 910B4, CANN 9.1\n
Source: m-bain/whisperX