Support for GPU acceleration on AMD with HIP?

Hi there. This is much above my knowledge level, so pardon me if I’m at all off the mark here.

As I understand it, Argos supports CUDA, which is limited to certain Nvidia cards.

There is a project called HIP that may open up support to AMD cards as well. Is this something that Argos could benefit from, or within the scope of the project to implement?

See below:

HIP is a C++ Runtime API and Kernel Language that allows developers to create portable applications for AMD and NVIDIA GPUs from single source code.

Key features include:

  • HIP is very thin and has little or no performance impact over coding directly in CUDA mode.
  • HIP allows coding in a single-source C++ programming language including features such as templates, C++11 lambdas, classes, namespaces, and more.
  • HIP allows developers to use the “best” development environment and tools on each target platform.
  • The HIPIFY tools automatically convert source from CUDA to HIP.
  • Developers can specialize for the platform (CUDA or AMD) to tune for performance or handle tricky cases.

They also have a hipify-python tool if this is relevant to Argos (again, above my knowledge level), see this link: https://github.com/ROCm-Developer-Tools/HIP/pull/1090

Just wondering. It would be nice to have AMD GPU support

1 Like

I’m not sure about HIP specifically but you should be able to use any hardware Pytorch supports.

I was looking over the PyTorch docs on HIP and it initially came across to me as something that would have to be configured on the software side (i.e. Argos), as it mentions there being different versions of pytorch

If you must check which version of PyTorch you are using, refer to this example

if torch.cuda.is_available() and torch.version.hip:
   # do something specific for HIP
elif torch.cuda.is_available() and torch.version.cuda:
    # do something specific for CUDA```

After looking it over a bit more I think this may be something that is configured on the end user machine… I need to do some digging around on this. Again, above my pay grade :grinning_face_with_smiling_eyes:

https://pytorch.org/docs/stable/notes/hip.html
https://rocmdocs.amd.com/en/latest/Installation_Guide/HIP-Installation.html

I checked on my machine and torch.version.hip returned ‘None’ (I can’t find any documentation on what that means though). torch.cuda.is_available() returns false on my machine but that makes sense since I haven’t installed HIP on my end yet.

If someone smarter than me wants to take a look and figure this out, it might not be a bad idea to add some info about HIP in the readme/setup docs for Argos & LibreTranslate, for AMD users.