deepfakes/faceswap-model

Use OpenCL for compatibility with AMD GPUs

Yutsa opened this issue · 7 comments

Yutsa commented

I know the project is using tensorflow which uses CUDA, so for now it is exlusive to NVIDIA GPUs.

Is there a way to use another framework that would use OpenCL to make it work on AMD GPUs and maybe Intel integrated GPUs ?

Or is it completely unimaginable ?

Yutsa commented

I saw https://github.com/benoitsteiner/tensorflow-opencl which is a fork of tensorflow for openCL, would it be possible to use it do you think ?

Seeing as it is an unofficial fork and have yet to see any substantial coverage/testing for it, I would vote against including it. It also lacks a PyPi listing, which would mean we'd have to probably include it as a submodule or as a git package in the requirements.

However, have you looked at how Keras handles the machine learning backends? Maybe there's an OpenCL backend for Keras?

Yutsa commented

Oh yeah I wasn't suggesting adding it to this project but just wanted to know if that could work. I don't know exactly what we are using.

If there is an openCL backend for Keras we could use an AMD GPU ?

I think I saw someone use Theano as a backend and I think Theano has support for OpenCL.

I don't know how the performance compares to Nvidia CUDA with Tensorflow. I have a GTX1080 myself, so perhaps we should do some benchmarking with different backends soon.

Yutsa commented

So from what I understood we use Keras which uses Tensorflow as a backend but we could in theory use any other backend ?

I'd love to be able to use my AMD GPU with this project but support is really lacking.

Yes, that is my understanding also. It could be an idea to make these components pluggable. So you could choose which backend to use.