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
Feature request: AMD GPU support with oneDNN AMD support #1072
Comments
Hello, Currently we only use oneDNN for specific operators such as matrix multiplications and convolutions, but a full MT models contains many other operators (softmax, layer norm, gather, concat, etc.). Even though some of them are available in oneDNN, it would require quite some work to specialize all operations for AMD GPUs. At this time I don't plan to work on this feature, but it would indeed be a nice one to have! |
I wanted to try faster whisper on a Intel A770 dGPU 16GB. A complete use of oneDNN could also enable that hardware support. |
Migrating a transcription component to faster-whisper, and using an AMD GPU, I'd also appreciate faster-whisper with ROCm support even more. |
@towel did you manage to get |
any way to run with an amd gpu? |
Any update on this? |
I still don't plan to work on this at this time, and as far as I know no one else is working on this. I expect it would be quite some work to have a complete ROCm support. |
I had a go at converting the existing cuda stuff to rocm a few months ago but could never get it to build, not surprising as I have zero C++ or cmakelists skills. curand, cublas, cudnn, cuda, cub appear to map to hip with minor adjustments, but I could never get the cmakelists to include thrust (the version supplied by rocm) and it always halted compiling due to producing too many errors. |
I started trying to port CTranslate2 to ROCm last weekend and decided to share my (non-working) results here. The code is available in the Basically, hipify was able to convert most of the code automatically. I added a new CMake config option to enable compiling with ROCm, and so far calling the HIP compiler works, however it breaks the other options and requires a CMake version new enough to have HIP language support. Current issues are some CUDA library dependencies I did not look at yet, and the use of bfloat16 data type. While latest ROCm has a (according to this GH issue -> ROCm/ROCm#2534) drop-in replacement for the CUDA bf16, it currently has some issues in missing operators. Therefore, I'm trying to completely disable bf16 for now, but without luck so far. This work has right now just the goal of making it work, and not integrating HIP/ROCm into the (CMake) infrastructure. In case someone wants to have a look at the code and help porting, feel free to look at my fork. Unfortunately, I don't expect to have much time in the near future for this project. |
This is awesome dude. Wish I had programming experience to help with this, but alas I don't. I've been looking for ways to enable gpu acceleration for amd gpus using ctranslate2...Let me know if I can help in any way, whether it be by testing or what have you. |
Have you gotten it to work at all yet? |
“I started trying to port CTranslate2 to ROCm last weekend and decided to share my (non-working) results here” I believe that should answer your question. |
Thanks for sharing, much interested in the ripple effects this port may have for others projects. There's now ROCM 6.0 available which I believe addresses specifically what you're referencing. FYI: https://repo.radeon.com/amdgpu/6.0/ubuntu/dists/jammy/ I've tried all kinds of dumb uninformed stuff trying to get libretranslate to work with rocm to no avail. It depens on too recent cuda to be tricked by rocm. Latest pytorch+rocm5.7 also did not work out well. https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/3rd-party/pytorch-install.html |
So, would it make sense to create an experimental version of ctranslate2 using a more recnet oneDNN which does have AMD GPU support ? from https://github.com/oneapi-src/oneDNN https://github.com/oneapi-src/oneDNN?tab=readme-ov-file#system-requirements https://github.com/oneapi-src/oneDNN/blob/main/src/gpu/amd/README.md |
As said in the Feb 2023 comment "Even though some of them are available in oneDNN, it would require quite some work to specialize all operations for AMD GPUs." Since no one is making those changes, it won't move on. |
Do I understand correctly that support for Intel discrete GPUs would be covered by this issue as well? |
I am not a developer but I work at AMD and handle developer relationships. We would like to assist with the effort to enable CTranslate2 for AMD dGPUs and iGPU. We will have engineers investigate, but we may also be able to provide hardware to the lead contributors of this effort. Please contact me via michael dot katz at amd dot com if this would help. |
Hi, CTranslate2 uses oneDNN. oneDNN latest versions has support for AMD GPU. It require Intel oneAPI DPC++. The same approach can potentially enable NVIDIA GPU support too.
It would help running the MT models on AMD GPUs. With Rocm, this would be a full opensource way to run MT models in GPUs.
Thanks
The text was updated successfully, but these errors were encountered: