Run PyTorch on Apple Silicon GPU

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 9

  • @christopherwashington9448
    @christopherwashington9448 Год назад

    I am sorry but where is the part committed to the GPU implementation?

  • @matteoromani1546
    @matteoromani1546 2 года назад +1

    Really cool. However, I think it is only usable in the m1 max or ultra.
    On my mac m1 pro I ran the code in 38s on the GPU and in 48s on the CPU.
    It doesn't seem like a significant increase to me.

    • @programmingdatascienceandother
      @programmingdatascienceandother  2 года назад +2

      That seems to be true at the moment. I believe that they could make some more optimizations however. I do not find much of a performance difference on my M1 Mac.

    • @christopherwashington9448
      @christopherwashington9448 Год назад

      It is pretty significant in my opinion. Think about 38 hours vs 48 hours instead!

  • @jasonhoffman6642
    @jasonhoffman6642 2 года назад

    I conda'd the nightly as soon as they announced it but when I run your script my env. tells me "PyTorch is not linked with support for mps devices." I tried the pip and it got torch audio, but still wouldn't run it. Do I have to configure a path or something?

    • @jasonhoffman6642
      @jasonhoffman6642 2 года назад

      (Answering my own question, apparently TorchVision, which I added afterwards, forces back the version of PyTorch to the pre-5/18 version. The team is looking into that.)

    • @programmingdatascienceandother
      @programmingdatascienceandother  2 года назад +1

      ​@@jasonhoffman6642 Interesting. I never got such an issue. I ran the nightly install script provided by PyTorch. Torch, Torchvision and Torchaudio seem to work fine for me.

    • @jasonhoffman6642
      @jasonhoffman6642 2 года назад

      @@programmingdatascienceandother out of curiosity, which installation method were you using? Was it in a (mini)conda environment? Also, what order was the installation in? I'm planning on wiping that environment and starting over.

    • @programmingdatascienceandother
      @programmingdatascienceandother  2 года назад

      Yes, I believe I installed PyTorch in a Miniconda environment.
      pip3 install --pre torch torchvision torchaudio --extra-index-url download.pytorch.org/whl/nightly/cpu
      You are using an Apple Silicon mac, right? This does not work on Intel Macs as of now.