Skip to content

Support Apple Silicon via CoreML - #9

Merged
sbatchelder merged 2 commits into
mainfrom
support-apple-silicon
Jul 10, 2026
Merged

Support Apple Silicon via CoreML#9
sbatchelder merged 2 commits into
mainfrom
support-apple-silicon

Conversation

@joefutrelle

@joefutrelle joefutrelle commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This pull request enhances device selection logic for inference and adds comprehensive tests for provider selection. The main improvements are support for Apple's CoreML as a provider, improved handling of the --cpuonly flag, and a new test suite to verify provider selection behavior.

Device/provider selection improvements:

  • Updated the --cpuonly argument help text to clarify that it disables both CUDA and CoreML providers, not just CUDA.
  • Improved the get_providers function in cli.py to:
    • Prefer CUDA if available, otherwise select CoreML with configurable options, and finally fall back to CPU.
    • Respect the --cpuonly flag to always force CPU, regardless of other providers.

Test coverage:

  • Added TestGetProviders test class in tests/test_infer_functions.py to cover all combinations of provider availability and environment overrides, ensuring correct provider selection logic.
  • Imported get_providers into the test file for direct testing.

Please note that there is E5RT-related logspam that this PR doesn't suppress--the issue it identifies does not affect performance or output.

@joefutrelle joefutrelle self-assigned this Jul 10, 2026
@joefutrelle joefutrelle added the enhancement New feature or request label Jul 10, 2026
@sbatchelder
sbatchelder merged commit 75aeb0b into main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants