Polygeist icon indicating copy to clipboard operation
Polygeist copied to clipboard

gpu backend support

Open jzhoulon opened this issue 3 years ago • 3 comments

Hi, developers, I found that there is a branch gpu_comp in polygeist, but it seems only lower the IR generated by cuda-lower, do you have plan to support IR generated by cgeist C front-end, such as is can enable gpu path for legacy C code. the main issue I found is how to automatically insert GPU<->host memcpy.

jzhoulon avatar Dec 24 '22 07:12 jzhoulon

The gpucomp branch currently supports compiling CUDA code to the CUDA backend, we have plans to add support for compiling CUDA code to different backends or to compile to CUDA binaries from C/C++ OpenMP or other parallel programming models or any other combinations of input code/backend.

What kind of legacy code are you interested in running on a GPU?

ivanradanov avatar Dec 24 '22 12:12 ivanradanov

The gpucomp branch currently supports compiling CUDA code to the CUDA backend, we have plans to add support for compiling CUDA code to different backends or to compile to CUDA binaries from C/C++ OpenMP or other parallel programming models or any other combinations of input code/backend.

What kind of legacy code are you interested in running on a GPU?

@ivanradanov It is very exciting to hear that you are planing to support compile to CUDA binaries from other programming modes. actually we want to compiler a large code base of C files(signal processing algriothm), and we want to run them of GPU. we used polygeist and mlir-opt to convert it to CUDA binaries, but we didn't find a way to insert GPU alloc and memcpy to interactive with host. one thing we though is make the alloc to be a CUDA usm alloc API(Managed Alloc), but official mlir-opt didn't support it yet. Besides, currently we find that some mlir files generated by polygeist can't be feed into mlir-opt (some memref related op are invalid to mlir-opt), so we are very interesting that polygeist itself would support these functionalities.

May I know when the polygeist would support CUDA runtime/binaries from C/C++ openmp? thanks very much.

jzhoulon avatar Dec 26 '22 03:12 jzhoulon

Otherwise, there is a derivative of Polygeist inside https://github.com/intel/llvm/tree/sycl-mlir which might be interesting to leverage to target various GPU.

keryell avatar Jan 06 '23 14:01 keryell