-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support Apple Silicon #8
Comments
Hey @dannote! Yeah, GH Actions may take a while to support M1 and even the cloud support is not perfect either (I found one provider, but they require provisioning instances for at least 24h), that's why I didn't push it at this point. Thanks for looking into this, feel free to post updates here :) We shouldn't need the |
Unfortunately, that's due to legal reasons since Big Sur. Apple has added this requirement in the 3A (ii) section of macOS EULA. |
Good news! I managed to build it. Firstly, I upgraded to macOS Monterey 12 Beta 7. I found that TensorFlow is pinned to Bazel 3.7.2, but I came up with this simple workaround: brew install bazelisk
XLA_TARGET=macos XLA_BUILD=true USE_BAZEL_VERSION=4.2.1 mix compile That's it! No local JDK is required.
Is there anything you would like to test? |
Great to hear! @seanmor5 is there anything holding us back from bumping to tensorflow 2.6 that you're already aware of, or is it worth testing? |
Worth testing, it's probably for the better anyway as I think it bumps CUDA support to 11.4. I can deal with fixing breaks in EXLA |
Awesome, make a PR and test then! |
@dannote was there any error that |
@jonatanklosko Yes, I forgot to mention, there was a bunch of errors without this flag:
|
It's interesting because |
Aren't those escape sequences coming from the |
Yes, they are
|
I feel like I will able to build it from |
Nope, I got this error at
|
@jonatanklosko Yes, trying it now |
Resolved in #9. |
Since XLA moved to its own Hex package, I suggest continuing the previous discussion (elixir-nx/nx#217) here.
As Apple claims, TensorFlow supports M1 since v2.5 via PluggableDevice.
Caveats
Building XLA for Apple Silicon
I haven't succeeded in building XLA yet. Here is the farthest I've been able to get so far.
I've added a new build target and bumped TensorFlow to 2.6.0:
Installed the latest OpenJDK and numpy:
Installed the latest stable Bazel for
aarch64
:Tried to build XLA with the new target:
But here it crashes with
java.lang.reflect.InaccessibleObjectException
. It looks like Bazel doesn't take JSR 376 into account and so doesn't support OpenJDK 17 yet.It's even worse with OpenJDK 11 on Monterey: I got
SIGSEGV
somewhere injava.base
.I haven't tried to build XLA on Big Sur yet. On Monterey, I will have to wait for OpenJDK 11 to be fixed or Bazel to be ported to OpenJDK 17.
I'll track my progress here if you don't mind.
The text was updated successfully, but these errors were encountered: