Giter Site home page Giter Site logo

Add TPU support about stylegan2-pytorch HOT 8 OPEN

lucidrains avatar lucidrains commented on May 23, 2024 4
Add TPU support

from stylegan2-pytorch.

Comments (8)

lucidrains avatar lucidrains commented on May 23, 2024

add a pull request!

from stylegan2-pytorch.

NickAcPT avatar NickAcPT commented on May 23, 2024

Ermmmmm.
Running TensorFlow under a TPU is easy.
One of the problems is that the python script checks for CUDA, which is not used under a TPU environment.

https://github.com/pytorch/xla

from stylegan2-pytorch.

dave7895 avatar dave7895 commented on May 23, 2024

How much do you think would the speed up be @NickAcPT? I think it would be complicated to reshape the entire code and I think a big if-clause would be a possible but not very good solution. What are your ideas so far?

from stylegan2-pytorch.

NickAcPT avatar NickAcPT commented on May 23, 2024

How much do you think would the speed up be @NickAcPT? I think it would be complicated to reshape the entire code and I think a big if-clause would be a possible but not very good solution. What are your ideas so far?

Well, I don't know exactly. I'm all new to this, but according to what I've read, it should be faster than a GPU since it's specialized hardware for ML.
Well, if this can't be added, no problem. A GPU still works fine.

from stylegan2-pytorch.

dave7895 avatar dave7895 commented on May 23, 2024

I am pretty new to this, as well. I think that you could check at the beginning if there is a GPU available and set a variable accordingly. The problem would be that most functions in the code are ending with .cuda(). So you would have to implement either an if-switch at every place in the code where this happens, but I think this could impact performance. And the massive extent of this would be the reason he wants you to create a pull request.

from stylegan2-pytorch.

lucidrains avatar lucidrains commented on May 23, 2024

the best route to go would be to integrate pytorch-lightning (although I am uncertain of support for two optimizers) as it has TPU support now https://pytorch-lightning.readthedocs.io/en/latest/tpu.html

from stylegan2-pytorch.

Samyak2 avatar Samyak2 commented on May 23, 2024

Porting this to PyTorch lightning would be great. It has support for multiple optimizers (reference) and training on TPU is very simple (reference).

from stylegan2-pytorch.

jtremback avatar jtremback commented on May 23, 2024

@lucidrains in the readme, there is the offhand comment that the smallest AWS p2 instance is "slower than Colab". How did you find this out?

EDIT: NVM, just realized you have to select "GPU" in settings!

from stylegan2-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.