feat(install): auto-select OpenVINO for Intel CPU/iGPU/Arc; block openvino on macOS#117
Merged
Conversation
…nvino on macOS Broadens has_intel_gpu to match Arc/Iris/UHD brand tokens and the "8086" PCI vendor string so DG2/Alchemist lspci lines are caught. Adds has_discrete_non_intel_gpu for conservative CPU-fallback detection. _auto_accelerator now picks openvino for any Intel GPU on Windows or Linux (priority: NVIDIA > Intel GPU > Intel CPU-only > DirectML > None), and probes /proc/cpuinfo on Linux to catch Intel CPU-only boxes where OpenVINO beats the stock CPU EP. macOS is always exempted (no wheel exists). _resolve_accelerator raises a clear ValueError with an actionable message when --accelerator openvino is passed on Darwin. CI safety: plan_install already forces accelerator="cpu" when --ci is set, so _auto_accelerator is never reached from CI; unchanged. Adds 22 new tests covering Arc/Iris/UHD detection, Intel CPU-only Linux, macOS gate, Windows priority ordering, and has_intel_gpu positive/negative cases. 1288/1288 tests pass; ruff/mypy/selftest/dry-run all green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why
Four Intel hardware targets (Arc GPU, Iris/UHD iGPU, Intel CPU-only — on Windows and Linux) previously received no OpenVINO auto-selection despite it being their best ONNX Runtime EP. Additionally,
--accelerator openvinoon macOS would hard-fail at pip install time with no clear error.Changes:
has_intel_gpu— broadened from a bare"intel"substring to also matcharc,iris,uhd, and8086(PCI vendor prefix), catching Arc/DG2/Alchemist lspci lines like"Intel Corporation DG2 [Arc A770]".has_discrete_non_intel_gpu— new property for conservative CPU-only detection (NVIDIA or AMD/Radeon present → don't fall through to CPU probe)._auto_acceleratorpriority order (first match wins):None(no openvino wheel; CoreML auto)nvidiaopenvino/proc/cpuinfo) + no discrete GPU →openvinodirectmlNone_resolve_accelerator— raisesValueError("OpenVINO has no macOS wheel; use the default CoreML/CPU build …")on Darwin when--accelerator openvinois requested explicitly.CI Safety
plan_installforcesaccelerator="cpu"when--ciis set (line:requested = "cpu" if ci and accelerator == "auto" else accelerator), so_auto_acceleratoris never reached from CI. No change to that path.Test plan
tests/test_install.py(22 new) covering: Arc/Iris/UHD/8086 detection, Intel CPU-only Linux probe, macOS openvino gate (auto + explicit), Windows priority (NVIDIA > Intel GPU > DirectML), has_intel_gpu positive/negative cases, CI hardware-independencepytest tests/ -v --timeout=60— 1288/1288 passedruff check— all checks passedruff format --check— 152 files already formattedmypy autoptz/engine/runtime/ autoptz/config/— no issues (11 source files)python -m autoptz --selftest— all checks passedpython tools/install.py --dry-run— prints sane plan (base + CoreML note on Darwin)🤖 Generated with Claude Code