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

macOS arm64 support #3

Closed
1 task done
danomatika opened this issue Feb 11, 2021 · 5 comments
Closed
1 task done

macOS arm64 support #3

danomatika opened this issue Feb 11, 2021 · 5 comments
Labels
feature New feature or request

Comments

@danomatika
Copy link
Member

danomatika commented Feb 11, 2021

Add support for optimized libtensorflow builds for:

  • macOS arm64 (M1)
  • iOS (TensorFlow Light) possibly leave for later

References:

@danomatika danomatika added the feature New feature or request label Feb 11, 2021
@danomatika danomatika changed the title Use macOS & iOS optimized tensorflow builds Use optimized macOS & iOS tensorflow builds Feb 11, 2021
@danomatika
Copy link
Member Author

danomatika commented Jun 4, 2021

I tried out both 2.4.1 and 2.5.0 x86_64 libtensorflow builds in OF 0.11.2 on an M1 MBP 13 (arm64) and the examples build, but crash when running in Rosetta2. Building will only succeed if arm64 is added to the Excluded Architectures in Target's Build Settings.

@danomatika
Copy link
Member Author

The update/macos-arm64 branch adds support for download non-official arm64 macOS builds from https://github.com/vodianyk/libtensorflow-cpu-darwin-arm64. Just run the script on an arm64 system to get arm64 libs, although not all TF versions are there, currently 2.5.0, 2.7.0, and 2.8.0.

I have a new macOS M1 Pro system to test this on soon.

@danomatika
Copy link
Member Author

From doing some research, it looks like there are no plans for libtensorflow to support GPU usage or the Neural Engine on the Apple Silicon CPUs. I will settle for native CPU only builds on arm64.

As for iOS and TF Lite, I think we can leave that for later as a separate issue since there is some difference between TF2 and TF Lite models, as far as I can tell.

@danomatika danomatika changed the title Use optimized macOS & iOS tensorflow builds macOS arm64 support Jan 25, 2022
@danomatika
Copy link
Member Author

Good news: the arm64 builds work fine on the macOS 12.2 M1 Pro system. I only needed to download the new libs, then change Build Settings->Excluded Architectures to x86_64 in each project. Clean & rebuild, done.

@danomatika
Copy link
Member Author

The update/macos-arm64 branch is now merged with the develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant