hiramegl

hiramegl

Is it possible to enable the GPU on an Apple M3 Max?

I’ve been using livebook for a while and been playing a bit with some of the numerics libraries. Recently I bought a mac apple silicon with Apple M3 Max GPU. I wonder if is possible to enable the GPU for machine learning. I have managed to train a model but when I check the GPU and CPU history only the CPU seems to be used. Maybe is not possible but better to be sure.

Thanks for the great work with Livebook!

Most Liked

jonatanklosko

jonatanklosko

Creator of Livebook

@hiramegl yeah, EXLA does not support Metal at the moment. The underlying project (XLA) does not have official support for Metal, there is a separate plugin from Apple, but it is closed-source and already outdated, so we wait for an official support. As for Torchx, the mps backend is somewhat experimental, so depending on what computation you run, some operations may not be supported, but worth a shot.

msmithstubbs

msmithstubbs

I tried this a while back and found It’s possible using Torchx and setting the device to mps.

However some APIs are not supported yet and resulted in errors.

For example, taking the sample at nx/exla/examples/regression.exs at main · elixir-nx/nx · GitHub at changing the default backend:

Nx.default_backend({Torchx.Backend, device: :mps})

give this error when running it:

** (ArgumentError) cannot perform operation across devices mps and cpu
    (torchx 0.6.4) lib/torchx.ex:467: anonymous fn/2 in Torchx.prepare_tensors_list!/2

I’d be interested to hear if anyone has managed to get it to work.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
wernerlaude
In AR this is so simple @articles = current_user.articles How to do in Ecto? def index(conn, _params) do current_user = conn.assig...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

We're in Beta

About us Mission Statement