Skip to content

feat(device): add Apple Silicon MPS device support - #11

Merged
felipebridge merged 1 commit into
felipebridge:mainfrom
oscarbol09:feat/apple-silicon-mps-and-pytest-path
Sep 21, 2026
Merged

felipebridge merged 1 commit into
felipebridge:mainfrom
oscarbol09:feat/apple-silicon-mps-and-pytest-path

Conversation

@oscarbol09

@oscarbol09 oscarbol09 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this change

  • Adds Apple Silicon (mps) device acceleration support to DeviceType and resolve_device(), allowing macOS users on M-series chips to benefit from GPU-accelerated YOLO inference.
  • Adds comprehensive unit test suite in tests/test_device.py and configuration parsing test in tests/test_config.py.

Related issue
N/A

How was this tested

  • ruff check src tests dashboard scripts (Passed with 0 errors)
  • Unit tests in tests/test_device.py and tests/test_config.py covering CPU, CUDA, MPS, auto fallback, and missing torch scenarios

Checklist

  • Tests added/updated for the change
  • Docs updated if behavior changed

@felipebridge

Copy link
Copy Markdown
Owner

Gracias por el PR. Reviso el diff completo (no solo la descripción) y esto es lo que pienso:

Apruebo:

DeviceType.MPS en config/settings.py
La rama mps en resolve_device() (utils/device.py)
tests/test_device.py y el test nuevo en tests/test_config.py

Es un cambio mínimo, correcto, y bien testeado (los mocks de torch cubren cuda/mps/ninguno/sin-torch).

Por favor saquen del PR:

El cambio en scripts/check_environment.py que reemplaza except ConfigError por except Exception — eso silencia errores que no son de config, no tiene que ver con MPS y no está mencionado en la descripción. Si quieren mantener el mensaje de "Acceleration: MPS available", ok, pero sin tocar el manejo de excepciones.
El sys.path.insert(...) manual en _check_config() — el proyecto usa pip install -e ".[dev]" como flujo documentado, esto es un workaround no relacionado.
pythonpath = ["src"] en pyproject.toml — abran un PR aparte para esto y expliquen el trade-off (con esto, un pip install -e . roto en CI dejaría de detectarse porque pytest igual va a encontrar el paquete por path).
Las líneas en blanco de más en settings.py (quedaron 3 entre MPS = "mps" y class VideoConfig, debería ser 2) y al final de pyproject.toml.

Con el PR reducido a solo DeviceType/resolve_device/tests lo mergeo sin problema.

@oscarbol09
oscarbol09 force-pushed the feat/apple-silicon-mps-and-pytest-path branch from 8dda0e1 to 8fe5dcf Compare September 21, 2026 17:23
@oscarbol09 oscarbol09 changed the title feat(device): add Apple Silicon MPS device support and configure pytest pythonpath feat(device): add Apple Silicon MPS device support Sep 21, 2026
@oscarbol09

Copy link
Copy Markdown
Contributor Author

Listo, totalmente de acuerdo con el alcance y el punto sobre CI.

Se revirtieron los cambios en pyproject.toml y scripts/check_environment.py, y se corrigieron las líneas en blanco en settings.py. La rama quedó actualizada con un único commit limpio enfocado exclusivamente en DeviceType.MPS, resolve_device y sus tests asociados (tests/test_device.py y tests/test_config.py).

@felipebridge
felipebridge merged commit 5317673 into felipebridge:main Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants