ailia SDK on Apple Silicon

David Cochard
axinc-ai
Published in
2 min readMay 17, 2021

This article is an introduction to using ailia SDK, a cross-platform, high-speed AI inference framework, with Apple Silicon.

About Apple Silicon

AppleSilicon is the name of the System on a Chip (SoC) developed by Apple. Combining ARM-based CPU and a GPU, the first generation of Apple Silicon M1 chip has a GeForce GTX1060-class GPU, which enables fast GPU-based AI inference using the ailia SDK. YOLOv3 full runs nearly five times faster than the Intel-architecture MacBookPro.

Source:https://www.apple.com/jp/mac/m1/

Runnin Python on Apple Silicon

macOS Big Sur comes preinstalled with Python 3.8, which is a universal binary. The site-packages that contain the libraries are common, and the universal binary can be used from either x86_64 or arm64. However, if one of the libraries you depend on is x86_64, you will need to run it on x86_64.

ailia SDK is a universal binary for x86_64 and arm64. However, since the OpenCV arm64 binary is not currently available, it currently needs to be run in Rosetta2 x86_64 emulation. Even though it is an emulation, ailia SDK works with Metal shaders, which provides significant speedup.

To run Python 3.8 in x86_64 mode, copy Terminal in the Applications/Utilities folder, right-click, go to Info, and check Open with Rosetta.

Then you can run Python in x86_64 mode and install opencv-python with pip3.

pip3 install opencv-python

Installing ailia SDK on Apple Silicon

You can install the ailia SDK in either x86_64 mode or arm mode by using the following command in either terminal.

cd ailia_sdk/python
python3 bootstrap.py
pip3 install ./

Running ailia models on Apple Silicon

Clone the ailia MODELS repository on github.

Execute the following from a terminal in x86_64 mode.

python3 launch.py

ax Inc. has developed ailia SDK, which enables cross-platform, GPU-based rapid inference.

ax Inc. provides a wide range of services from consulting and model creation, to the development of AI-based applications and SDKs. Feel free to contact us for any inquiry.

--

--