feat(auto): выбран ONNX по умолчанию без CUDA

- Зачем:
  - пользователям без NVIDIA нужен самый быстрый и читаемый CPU-профиль без дополнительных параметров.
- Что:
  - auto-политика изменена на CUDA при наличии nvidia-smi, иначе ONNX GigaAM RNN-T int8.
  - сохранён приоритет явных значений CLI и конфигурации для OpenVINO и FasterWhisper CPU.
  - обновлены тесты, README, PRD, ADR, GPU-документация и вывод benchmark.
- Проверка:
  - uv run pytest -q: 232 passed, 1 skipped.
  - uv lock --check и git diff --cached --check.
This commit is contained in:
Dmitriy Dementiev
2026-08-12 10:45:05 +03:00
parent 12e17020bf
commit 136e93765c
13 changed files with 177 additions and 115 deletions
+10 -9
View File
@@ -61,27 +61,28 @@ def test_detect_device_explicit_passthrough():
"""Явные device strings проходят без изменений."""
assert detect_device("cpu") == "cpu"
assert detect_device("cuda") == "cuda"
assert detect_device("onnx") == "onnx"
assert detect_device("openvino-gpu") == "openvino-gpu"
assert detect_device("openvino-cpu") == "openvino-cpu"
def test_detect_device_auto_openvino_gpu():
"""auto + нет nvidia-smi + есть OpenVINO GPU → openvino-gpu."""
def test_detect_device_auto_onnx_even_with_openvino_gpu():
"""auto + нет nvidia-smi → onnx, даже если доступен OpenVINO GPU."""
with (
patch("local_transcriber.utils.shutil.which", return_value=None),
patch("local_transcriber.utils._is_openvino_gpu_available", return_value=True),
):
assert detect_device("auto") == "openvino-gpu"
assert detect_device("auto") == "onnx"
def test_detect_device_auto_openvino_cpu():
"""auto + нет nvidia-smi + есть OpenVINO, нет GPU → openvino-cpu."""
def test_detect_device_auto_onnx_even_with_openvino_cpu():
"""auto + нет nvidia-smi → onnx, даже если доступен OpenVINO CPU."""
with (
patch("local_transcriber.utils.shutil.which", return_value=None),
patch("local_transcriber.utils._is_openvino_gpu_available", return_value=False),
patch("local_transcriber.utils._is_openvino_available", return_value=True),
):
assert detect_device("auto") == "openvino-cpu"
assert detect_device("auto") == "onnx"
def test_detect_device_cuda_over_openvino():
@@ -93,14 +94,14 @@ def test_detect_device_cuda_over_openvino():
assert detect_device("auto") == "cuda"
def test_detect_device_auto_cpu_fallback():
"""Ни nvidia-smi, ни openvino → cpu."""
def test_detect_device_auto_onnx_without_accelerators():
"""Без CUDA auto выбирает ONNX CPU."""
with (
patch("local_transcriber.utils.shutil.which", return_value=None),
patch("local_transcriber.utils._is_openvino_gpu_available", return_value=False),
patch("local_transcriber.utils._is_openvino_available", return_value=False),
):
assert detect_device("auto") == "cpu"
assert detect_device("auto") == "onnx"
def test_detect_device_openvino_resolves_to_gpu():