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

[Feature Request] Merge CUDA and ROCm codes #2838

Closed
7 tasks done
njzjz opened this issue Sep 19, 2023 · 0 comments · Fixed by #2839, #2844, #2845, #2846 or #2847
Closed
7 tasks done

[Feature Request] Merge CUDA and ROCm codes #2838

njzjz opened this issue Sep 19, 2023 · 0 comments · Fixed by #2839, #2844, #2845, #2846 or #2847
Assignees

Comments

@njzjz
Copy link
Member

njzjz commented Sep 19, 2023

Summary

Merge CUDA and ROCm codes into one file and distinguish them using macros.

Detailed Description

There are lots of duplicated codes between CUDA and ROCm. Most of them are the same. Adding a new GPU method is troublesome as we need to add twice to both CUDA and ROCm codes.
I notice that TensorFlow implements CUDA and ROCm in only one file, such as https://github.com/tensorflow/tensorflow/blob/00a17d7451a789a4df994dac7d616ce2f4438ff0/tensorflow/core/kernels/relu_op_gpu.cu.cc#L16. Some different codes between them are controlled using macros, i.e., GOOGLE_CUDA and TENSORFLOW_USE_ROCM. A universal launch function, GpuLaunchKernel, is used for CUDA and ROCm.

Below is the roadmap for DeePMD-kit:

Further Information, Files, and Links

No response

@njzjz njzjz self-assigned this Sep 19, 2023
wanghan-iapcm pushed a commit that referenced this issue Sep 19, 2023
Remove all `_cuda` or `_rocm` suffixes in function names, as proposed in
#2838. They can be merged in the following PRs.

(Replace all: `gpu_cuda` -> `gpu`; `gpu_rocm` -> `gpu`)

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment