Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyTorch OpenCL backend #2709

Open
Efenstor opened this issue Mar 25, 2024 · 3 comments
Open

PyTorch OpenCL backend #2709

Efenstor opened this issue Mar 25, 2024 · 3 comments

Comments

@Efenstor
Copy link

Efenstor commented Mar 25, 2024

Motivation
It would be amazing to be able to run PyTorch nodes on AMD GPU via OpenCL.

Description
I think theoretically now it should be possible because now we have RustICL OpenCL implementation (already included with all the major Linux distros) and Pytorch OpenCL on dlprimitives (also take a look on dlprimitives themselves).

Alternatives
There is a ROCm backend but it is a much worse alternative because it requires proprietary drivers (which are also hard to install).

@joeyballentine
Copy link
Member

Looks like that library doesn't have any prebuilt packages and is still experimental, so for now we will not be adding this. Feel free to experiment with it and report back on how well it works though

@Efenstor
Copy link
Author

I tried to build it but stuck: it requires Kineto but Kineto cannot be built without CUDA. Probably older versions of Torch would do without it but anyway I better wait when the project becomes more user-friendly, e.g. at least has prebuilt packages. Too bad the whole AI landscape is so dependent on NVidia and only a few nerds seems to do care. If not for NCNN then I couldn't even try it at all, at least not so easily. But unfortunately NCNN is slow and a bit rudimentary in many aspects.

@Efenstor
Copy link
Author

Efenstor commented Mar 26, 2024

Just as an additional note: it seems that still it's PyTorch for ROCm is the most reasonable choice after all, as there seems to be a lot of work going on behind the scenes to include it into all the major distros in the nearest year or two. For example, it was mentioned here that Debian Trixie (TBA in 2025) is to have it in the main repos. I don't know how they are going to pull that without the need for the proprietary drivers (amdgpu-pro) but as far as I remember there was a way to build only the OpenCL part of it for the active kernel without DKMS, may be the same trick can be pulled for HIP as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants