Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Silicon Support (ORT and CoreML) #67

Closed
wants to merge 15 commits into from
Closed

Conversation

danielholanda
Copy link
Collaborator

@danielholanda danielholanda commented Dec 7, 2023

Description

This PR adds Apple Silicon support to ORT and creates a new runtime for CoreML.

PR was tested on MacOS v12.7.1 (21G920) on a MacBook M1.

Setup

I only tested this on my local machine, so I'm curious to understand how smooth the installation process is.

I got an OSError with Lightgbm, which was solved by running conda install lightgbm. Not sure if others will encounter the same.

Testing

cd into the timm folder and run turnkey resnet18.py --device apple_silicon --runtime coreml

To do before merging this PR

  • Set CoreML as the default runtime of the apple_silicon device
  • Add disclaimer on best performance not being guaranteed (applies to all runtimes)

Future Work (Issues to be created)

  • Investigate if using Swift as the coreML runtime leads to higher performance
  • Add bash size as a runtime argument (also applies to ORT)
  • Use different inputs when benchmarking instead of the same input (also applies to ORT)
  • Add tests: Blocked by lack of available Apple Silicon hardware in the cloud

@danielholanda danielholanda self-assigned this Dec 7, 2023
@danielholanda danielholanda marked this pull request as ready for review December 7, 2023 00:42
Comment on lines -105 to +108
def local_onnx_dir(self):
return os.path.join(self.local_output_dir, self.onnx_dirname)
def local_model_dir(self):
return os.path.join(self.local_output_dir, self.model_dirname)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming convention was modified as it was too restrictive. We certainly don't want all models going to onnx/model.onnx if the output of the build process is not an onnx model.

Please note that this is not a breaking change according to our plugin contract, as the signature of BaseRT has not changed (apart from optional args added).

@danielholanda danielholanda deleted the mac_support branch December 10, 2023 03:31
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.

1 participant