|
Hello, I recently came across the proteus library and read the recent SC paper on RAJA extensions built on top of it with great interest. This is very interesting and impressive work that fills an important tech gap in HPC scientific applications. I am trying to understand the compiler requirements, restrictions and assumptions for Proteus. I understand that Proteus uses the LLVM IR and links with LLVM. However, does that mean that the application has to also be compiled with LLVM or could we use GNU compilers as well? Thank you for all your help. |
Replies: 2 comments 8 replies
|
Thank you for reaching out and for your interest in Proteus. Proteus is continuously evolving, and there are capabilities that are not yet described in published papers but are already fairly mature in the repository. Below, I’ll try to clarify the current compiler and runtime dependencies with respect to LLVM. The JIT interface described in the CGO’25 and SC papers assumes compilation with Clang/LLVM, as it relies on Clang-specific attributes and custom LLVM passes. At runtime, Proteus links against LLVM libraries to perform IR-level transformations and specialization. In this model, the code regions that Proteus interacts with must be available in LLVM IR form, and thus the code must be compiled with clang/llvm. That said, Proteus does not fundamentally require whole-program compilation with Clang. In principle, it should be possible to compile selected translation units with Clang (e.g., kernels or performance-critical regions) while building and linking the remainder of the application with GNU. We have not yet systematically tested this mixed-toolchain setup and in the case of device GPU code that may be more complicated than what I estimate. Based on standard ABI and linkage considerations, we expect it to be feasible and robust. In addition to the SC|CGO published JIT interface, we have developed other frontends, namely a DSL API and a C++ frontend string-based API, both of which are partially documented here These interfaces do not require the application itself to be compiled with LLVM. So GNU can be used. In both cases, LLVM remains a compile-time and runtime dependency, and the C++ frontend API internally relies on Clang, but the user’s project does not need to adopt Clang/LLVM as its compilation toolchain. You can find example benchmarks using the C++ frontend API here Out of curiosity, would you mind sharing a bit about your intended use case (e.g., CPU vs GPU, RAJA usage, scale of integration you’re considering)? That context would help us give more concrete guidance and also helps inform our future design and documentation priorities. |
|
Thank you for your response @koparasy. We are targeting both CPU and GPU architectures (primarilly NVIDIA and AMD GPUs) and are interested in performance portable implementations. We have are own mesh-aware abstraction layer that can use either RAJA or Kokkos on the back-end. That said, we can also have certain hot-spots in the code where we would like to code closer to the metal for better performance, e.g., using raw CUDA/HIP/vector intrinsics etc. I don't think requiring an LLVM/Clang toolchain is a deal-breaker, but, it is a constraint that we just need to be aware of. I had a few additional questions:
This is really exciting work and I look forward to seeing how the project evolves. Thank you again for all your time and help. |
Thank you for reaching out and for your interest in Proteus.
Proteus is continuously evolving, and there are capabilities that are not yet described in published papers but are already fairly mature in the repository. Below, I’ll try to clarify the current compiler and runtime dependencies with respect to LLVM.
The JIT interface described in the CGO’25 and SC papers assumes compilation with Clang/LLVM, as it relies on Clang-specific attributes and custom LLVM passes. At runtime, Proteus links against LLVM libraries to perform IR-level transformations and specialization. In this model, the code regions that Proteus interacts with must be available in LLVM IR form, and thus the code must be…