-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Building TensorFlow Lite - macos_arm64 support using cmake #47437
Building TensorFlow Lite - macos_arm64 support using cmake #47437
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@terryheo could you review this PR? |
@googlebot I signed it! |
oneDNN unit test failed? |
once this PR is accepted in XNNPACK repo, we can then also proceed with a new PR so
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
LGTM
Oh, are you going to send another PR when google/XNNPACK#1327 is merged? |
thank you. mainly this PR was for updating the cmake build files for if you're ok with the PR naming I will wait and add the remaining commits of there also needs to be a change for cpuinfo. did some testing and pulled the latest master branch in , but the cpuinfo.patch is not compatible so I deactivated applying this patch in WORKSPACE for verification. this went fine for what do you think? |
I see. It might take time to wait for all the XNNPack related changes are merged. |
This PR is merged and the XNNPack PR got LGTM. @simonmaurer I have one question. Does the "--config=macos_arm64" option only works on M1 machine? |
@terryheo thanks. if you're talking about the TensorFlow repo: this accepted PR here only allows the host build for however if you're talking about the XNNPACK repo (the PR is indeed accepted, but not yet merged):
will work on a host M1 machine. on different platforms (like Linux or even macos x86-64) that does not work (yet) because of missing toolchains
|
@terryheo another note: M1 host machine compilation (without specifying the platform):
Cross compilation on a different platform (e.g. Linux x86):
the |
with this PR the pip package can be built using a native build on M1 host machine. the only dependencies that need manual installation are |
@terryheo / @gbaned also thanks for reviewing #47639. this includes the changes on the follow-up PR we discussed:
that being said, with #47639 we can now also build using bazel for Cross compilation on a M1 host or a different platform (e.g. Linux x86):
and due to the additional changes #47594 by @freedomtan (thanks!) when using a more recent version of bazel (bazel #4928295): M1 host machine compilation (without specifying the platform):
To summarize: |
with respect to this issue in the XNNPACK repository:
bazel
builds for macos_arm64 platform are not yet supported.however building with cmake works successfully.
this change allows to build the
TensorFlow Lite library
and thebenchmark_model
on a macos_arm64 host platform when using-DTFLITE_ENABLE_XNNPACK=ON
(default). see instructions.