feat(stt): route AMD device tokens to the whisper.cpp Vulkan backend #272

Closed
nsaspy wants to merge 4 commits from rage/250-amd-stt-device-routing into master
Owner

Closes #250

Problem

On an AMD-only machine (RX 5500 XT, RADV Vulkan; no CUDA, no ROCm userspace):

  • --wake --device rocm (default provider) rewrote the AMD token to CUDA, failed, and silently continued on CPU.
  • --wake --device vulkan crashed at argument parsing with ValueError: Unsupported STT device 'vulkan' despite being an advertised choice.

The flake already records the architecture: whisper.cpp is the AMD/Radeon STT path (Vulkan) — and whisperCppVulkan is packaged — but the CLI could never reach it from the AMD tokens.

Fix

  • amd|rocm|hip|vulkan normalize to vulkan for every provider; cuda keeps NVIDIA-only semantics; cuda on whisper-cpp still fails with actionable guidance.
  • Local non-whisper-cpp providers are rerouted to the whisper.cpp Vulkan backend with a visible stderr notice, before model resolution (so GGML files resolve).
  • Remote providers (openai, groq) are never rerouted; their device token stays inert.
  • --device help, config.py comment, and the dev-shell hint updated.

Evidence (RAGE run rage/250-amd-stt-device-routing, start 9554387)

  • RED: 18 deterministic failures encoding the new contract (tokens → cuda, missing routing helper, exact user ValueError).
  • GREEN after the minimal __main__.py change; t/test_dictation.py internal compat contract untouched and green (64/64 focused).
  • Exact head cbf2aad: scripts/test-all.sh 11/11 phases, nix flake check all checks, nix build produced zarathushtra-full.
  • Research/design artifacts: rage/250-amd-stt-device-routing-{research,design}.org.
Closes #250 ## Problem On an AMD-only machine (RX 5500 XT, RADV Vulkan; no CUDA, no ROCm userspace): - `--wake --device rocm` (default provider) rewrote the AMD token to **CUDA**, failed, and silently continued on CPU. - `--wake --device vulkan` crashed at argument parsing with `ValueError: Unsupported STT device 'vulkan'` despite being an advertised choice. The flake already records the architecture: *whisper.cpp is the AMD/Radeon STT path (Vulkan)* — and `whisperCppVulkan` is packaged — but the CLI could never reach it from the AMD tokens. ## Fix - `amd|rocm|hip|vulkan` normalize to `vulkan` for **every** provider; `cuda` keeps NVIDIA-only semantics; `cuda` on whisper-cpp still fails with actionable guidance. - Local non-whisper-cpp providers are rerouted to the whisper.cpp Vulkan backend with a visible stderr notice, before model resolution (so GGML files resolve). - Remote providers (`openai`, `groq`) are never rerouted; their device token stays inert. - `--device` help, `config.py` comment, and the dev-shell hint updated. ## Evidence (RAGE run `rage/250-amd-stt-device-routing`, start `9554387`) - RED: 18 deterministic failures encoding the new contract (tokens → cuda, missing routing helper, exact user `ValueError`). - GREEN after the minimal `__main__.py` change; `t/test_dictation.py` internal compat contract untouched and green (64/64 focused). - Exact head `cbf2aad`: `scripts/test-all.sh` 11/11 phases, `nix flake check` all checks, `nix build` produced `zarathushtra-full`. - Research/design artifacts: `rage/250-amd-stt-device-routing-{research,design}.org`.
--device amd/rocm/hip/vulkan request AMD GPU acceleration. They now
normalize to vulkan for every provider instead of lying into CUDA, and
local non-whisper-cpp providers are rerouted to the whisper.cpp Vulkan
backend with a visible notice instead of silently degrading to CPU or
crashing on 'vulkan'. cuda keeps NVIDIA semantics with the existing CPU
fallback; remote providers are never rerouted.

Consumed issue: #250. RAGE start: 9554387.
docs(rage): record 250 merge evidence
Some checks failed
CI / test (pull_request) Failing after 6s
CI / android skeleton gate (pull_request) Failing after 6s
CI / shared mic / Arch Linux (pull_request) Failing after 8m57s
CI / shared mic / Ubuntu 24.04 (pull_request) Failing after 8m51s
570beec07a
nsaspy closed this pull request 2026-09-04 23:09:25 +00:00
Some checks failed
CI / test (pull_request) Failing after 6s
CI / android skeleton gate (pull_request) Failing after 6s
CI / shared mic / Arch Linux (pull_request) Failing after 8m57s
CI / shared mic / Ubuntu 24.04 (pull_request) Failing after 8m51s

Pull request closed

Sign in to join this conversation.
No description provided.