News for hackers. Stuff that matters.
Re:PyTorch 1.13 by mi_lk on Friday October 28, 2022 @05:49PM (#33378384)
is anyone able to comment on the experience of PyTorch's M1 support?
Re:PyTorch 1.13 by glial on Friday October 28, 2022 @06:16PM (#33378670)
https://pytorch.org/docs/stable/notes/mps.html

In my very limited experience it's not a ton faster than using a CPU backend though.

Re:PyTorch 1.13 by jstx1 on Friday October 28, 2022 @06:09PM (#33378601)
If you use miniforge (https://github.com/conda-forge/miniforge) you can just 'pip install torch' and it works.
Re:PyTorch 1.13 by gcarvalho on Friday October 28, 2022 @07:38PM (#33379388)
What's different about miniforge in this regard? Does miniforge come with additional package indexes pre-configured?
Re:PyTorch 1.13 by simongr3dal on Friday October 28, 2022 @09:32PM (#33380070)
Pretty much. Conda installed with miniforge uses a different channel, with a focus on having packages available for more architectures.
Re:PyTorch 1.13 by tomtom1337 on Saturday October 29, 2022 @02:06AM (#33381427)
I think you mean “conda install torch”, no? Miniforge would only impact the conda installer?
Re:PyTorch 1.13 by jstx1 on Saturday October 29, 2022 @06:03AM (#33382597)
Surprisingly, no. I just tried it:

- 'pip install torch' doesn't work inside of a plain Python env (not miniforge)

- 'conda install torch' doesn't work inside miniforge

- 'pip install torch' works inside miniforge

Re:PyTorch 1.13 by tomtom1337 on Saturday October 29, 2022 @06:06AM (#33382616)
Huh! That’s curious! I wonder what causes the different behaviour!
Re:PyTorch 1.13 by DIVx0 on Friday October 28, 2022 @06:06PM (#33378576)
I've used it for Stable Diffusion on my M1 mbp, works with no problem. I am not a AI/ML person so my experience with M1 PyTorch is limited to just using SD.
Re:PyTorch 1.13 by jackosdev on Friday October 28, 2022 @07:10PM (#33379169)
Yeah works great, Tensorflow works great as well, but if using pip need to install tensorflow-metal and tensorflow-macos. Plus I always need to downgrade protobuf to 3.20. And couldn't get the C bindings for Tensorflow to work through metal, only through CPU.

Pretty good machine learning experience on M1.

Re:PyTorch 1.13 by ryemigie on Friday October 28, 2022 @08:16PM (#33379644)
It doesn’t support a few things, and has bugs in a few of the functions but besides that it works OK. Need to make sure your batch size is high enough to fully utilise the GPU cores. I think it was maybe 2-4 times faster than the CPU in my case.
Re:PyTorch 1.13 by Birch-san on Friday October 28, 2022 @09:49PM (#33380180)
Most things require workarounds, some things aren't possible (or we haven't found workaround yet) and it's not as fast as CUDA. But stable-diffusion inference works, and so does textual inversion training. I was also able to run training of a T5 model with just a couple of tweaks.

I'd stick with PyTorch 1.12.1 for now. 1.13 has problems with backpropagation (I get NaN gradients now when I attempt CLIP-guided diffusion -- I think this applies to training too), and some einsum formulations are 50% slower (there is a patch to fix this; I expect it'll be merged soon), making big self-attention matmuls slow and consequently making stable-diffusion inference ~6% slower.