-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Problem
autobot-backend/utils/gpu_optimization/gpu_detection.py has zero test coverage. Recent refactors (#1990, #2222) introduced lru_cache-based vendor caching and a module-level GPU name stash that especially need test coverage.
Discovered During
Code review of PR #2237 (fix for #2222).
Tests Needed
_check_nvidia_gpu()returns GPU name string (not bool) or None_check_nvidia_gpu()takes only first line on multi-GPU output_detect_vendor()caches result and stashes NVIDIA GPU name_detect_vendor()returns correct vendor for AMD and Intel_detect_vendor()returns None when no GPU present_reset_detection_state()clears both lru_cache and_nvidia_gpu_name_detect_nvidia_capabilities()uses stashed name and parses two-field output_detect_nvidia_capabilities()takes first line on multi-GPU outputcheck_gpu_availability()anddetect_gpu_capabilities()use cached vendor- Cache clear + re-detection produces correct state (no stale data)
All subprocess calls should be mocked (unittest.mock.patch).
Impact
Medium — no production risk, but the caching/stashing logic is easy to break without test coverage.
Reactions are currently unavailable