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
make native bazel build work on Apple Silicon #47594
make native bazel build work on Apple Silicon #47594
Conversation
make `bazel --config opt //tensorflow/tools/pip_package:build_pip_package` work 1. include AArch64 stuff for XLA 2. don't build mkl_dnn
@freedomtan very nice.
as a test, I tried with
both resulted in same errors. reporting back once I can try again with the latest master of |
@simonmaurer As far as I can tell, neither 3.7.x nor 4.0 arm64 bazel works. That's why I went for bazel master branch. Hopefully, 4.1.0 or 4.0.x will work. |
@freedomtan so I can confirm that as of bazel #4928295 it is possible to build the pip package on a M1 host.
doing some tests with
but the resulting wheel is correctly named
resulted in errors mainly due to grpcio, h5py and numpy (the other dependant packages are available through could we rely on installing the dependant packages manually ?
|
@freedomtan did you manage to install it properly using super nice. no errors with respect to XLA ( |
@simonmaurer my environ:
As you said the package seems to be properly named as I have to install many dependencies when installing the pip wheel. And yes, I have to "manually" build grpcio (because of zlib and openssl) and h5py (because of macport's paths), which I learned how to do when I installed #45404 based package before. |
@freedomtan Can you please resolve conflicts? Thanks! |
@gbaned done. Thanks for reminding. |
@freedomtan Have you tried the latest TF master with your merge to HEAD? It complains about
Using your original branch based on 184cf2d works (but it has other issues I probably haven't figured out). Perhaps @chsigg changed cc @mihaimaruseac I just test on my M1 and it doesn't work on HEAD. |
I'm not sure which build command you expect to work and a full log with I would have expected you would like to build with It seems like some of you are building with just The best way to tell what makes the difference is to build with |
@freedomtan mind to share the Bazel build procedure for you to get bazelbuild/bazel@492829? I am trying to build from HEAD but it doesn't work. |
@byronyi for bazelbuild/bazel@492829
|
@byronyi FYI. I could build ( |
@freedomtan Mind to share the output of Mine is
|
I probably need to install full Xcode instead of the Xcode command line tools... |
Yes, please check your environment. It seems bazel could not find your toolchain.
|
Confirmed that could be built with latest Bazel and TF HEAD. NIT: Seeing multiple machine failures as clang eats all my memory and macOS doing extensive swaps when building with |
make
bazel --config opt //tensorflow/tools/pip_package:build_pip_package
workWith recent bazel arm64 binary (tested with [1]), it's possible to build pip wheel.
Previously, you need x86_64 bazel, see #45404.
[1] bazelbuild/bazel@492829