From 8c4677bdbdcb3c8a1c763c6ba5526d744134a6a0 Mon Sep 17 00:00:00 2001 From: Aaron Jomy <75925957+maximusron@users.noreply.github.com> Date: Wed, 7 Feb 2024 12:48:04 +0100 Subject: [PATCH] [gsoc24] Add Cppyy projects from compiler-research.org (#1500) * [gsoc24] Add Cppyy projects and proposals for compiler-research.org * [gsoc24] Update Cppyy and Clad projects from compiler-research.org * [gsoc24] Update mentor list --- _gsocprojects/2024/project_Cppyy.md | 20 +++++++ .../2024/proposal_Clad-GPUReverseMode.md | 2 +- .../2024/proposal_Clad-ObjectOrientedAD.md | 2 +- ...posal_Clad-constant-evaluation-contexts.md | 2 +- .../2024/proposal_Cppyy-Numba-CUDA.md | 57 +++++++++++++++++++ .../2024/proposal_Cppyy-STL-Eigen-support.md | 42 ++++++++++++++ gsoc/2023/mentors.md | 1 - gsoc/2024/mentors.md | 3 +- 8 files changed, 124 insertions(+), 5 deletions(-) create mode 100644 _gsocprojects/2024/project_Cppyy.md create mode 100644 _gsocproposals/2024/proposal_Cppyy-Numba-CUDA.md create mode 100644 _gsocproposals/2024/proposal_Cppyy-STL-Eigen-support.md diff --git a/_gsocprojects/2024/project_Cppyy.md b/_gsocprojects/2024/project_Cppyy.md new file mode 100644 index 000000000..8b1a28064 --- /dev/null +++ b/_gsocprojects/2024/project_Cppyy.md @@ -0,0 +1,20 @@ +--- +project: Cppyy +layout: default +logo: Cppyy-logo.png +description: | + [Cppyy](https://cppyy.readthedocs.io/en/latest/) is an automatic, run-time, + Python-C++ bindings generator, for calling C++ from Python and Python from + C++. Run-time generation enables detailed specialization for higher + performance, lazy loading for reduced memory use in large scale projects, + Python-side cross-inheritance and callbacks for working with C++ frameworks, + run-time template instantiation, automatic object downcasting, exception + mapping, and interactive exploration of C++ libraries. cppyy delivers + this without any language extensions, intermediate languages, or the need + for boiler-plate hand-written code. +summary: | + Cppyy is an automatic, run-time, Python-C++ bindings generator, for calling + C++ from Python and Python from C++. +--- + +{% include gsoc_project.ext %} \ No newline at end of file diff --git a/_gsocproposals/2024/proposal_Clad-GPUReverseMode.md b/_gsocproposals/2024/proposal_Clad-GPUReverseMode.md index 2118f8fb9..bba85333c 100644 --- a/_gsocproposals/2024/proposal_Clad-GPUReverseMode.md +++ b/_gsocproposals/2024/proposal_Clad-GPUReverseMode.md @@ -2,7 +2,7 @@ title: Enable reverse-mode automatic differentiation of (CUDA) GPU kernels using Clad layout: gsoc_proposal project: Clad -year: 2023 +year: 2024 difficulty: medium duration: 350 mentor_avail: June-October diff --git a/_gsocproposals/2024/proposal_Clad-ObjectOrientedAD.md b/_gsocproposals/2024/proposal_Clad-ObjectOrientedAD.md index 170bbf0bf..c6507dd21 100644 --- a/_gsocproposals/2024/proposal_Clad-ObjectOrientedAD.md +++ b/_gsocproposals/2024/proposal_Clad-ObjectOrientedAD.md @@ -2,7 +2,7 @@ title: Improve automatic differentiation of object-oriented paradigms using Clad layout: gsoc_proposal project: Clad -year: 2023 +year: 2024 difficulty: medium duration: 350 mentor_avail: June-October diff --git a/_gsocproposals/2024/proposal_Clad-constant-evaluation-contexts.md b/_gsocproposals/2024/proposal_Clad-constant-evaluation-contexts.md index 637f21e5e..4f36899aa 100644 --- a/_gsocproposals/2024/proposal_Clad-constant-evaluation-contexts.md +++ b/_gsocproposals/2024/proposal_Clad-constant-evaluation-contexts.md @@ -2,7 +2,7 @@ title: Add support for consteval and constexpr functions in Clad layout: gsoc_proposal project: Clad -year: 2023 +year: 2024 difficulty: medium duration: 350 mentor_avail: June-October diff --git a/_gsocproposals/2024/proposal_Cppyy-Numba-CUDA.md b/_gsocproposals/2024/proposal_Cppyy-Numba-CUDA.md new file mode 100644 index 000000000..b4172b075 --- /dev/null +++ b/_gsocproposals/2024/proposal_Cppyy-Numba-CUDA.md @@ -0,0 +1,57 @@ +--- +title: Enable CUDA compilation on Cppyy-Numba generated IR +layout: gsoc_proposal +project: Cppyy +year: 2024 +difficulty: medium +duration: 350 +mentor_avail: June-October +organization: + - CompRes +--- + +## Description + +Cppyy is an automatic, run-time, Python-C++ bindings generator, for calling C++ from Python and Python from C++. Initial support has been added that allows Cppyy to hook into the high-performance Python compiler, Numba which compiles looped code containing C++ objects/methods/functions defined via Cppyy into fast machine code. + +Since Numba compiles the code in loops into machine code it crosses the language barrier just once and avoids large slowdowns accumulating from repeated calls between the two languages. Numba uses its own lightweight version of the LLVM compiler toolkit (llvmlite) that generates an intermediate code representation (LLVM IR) which is also supported by the Clang compiler capable of compiling CUDA C++ code. + +This project aims to demonstrate Cppyy's capability to provide CUDA paradigms to Python users without any compromise in performance. Upon successful completion a possible proof-of-concept can be expected in the below code snippet: + +```python +import cppyy +import cppyy.numba_ext + +cppyy.cppdef(''' +__global__ void MatrixMul(float* A, float* B, float* out) { + // kernel logic for matrix multiplication +} +''') + +@numba.njit +def run_cuda_mul(A, B, out): + # Allocate memory for input and output arrays on GPU + # Define grid and block dimensions + # Launch the kernel + MatrixMul[griddim, blockdim](d_A, d_B, d_out) +``` + +## Project Milestones + +* Add support for declaration and parsing of Cppyy-defined CUDA code on the Numba extension. +* Design and develop a CUDA compilation and execution mechanism. +* Prepare proper tests and documentation. + +## Requirements + +* C++ programming and familiarity with CUDA C++ +* Python programming +* Knowledge of LLVM IR is an advantage + +## Mentors +* **[Aaron Jomy](mailto:aaron.jomy@cern.ch)** +* [Wim Lavrijsen](mailto:wlavrijsen@lbl.gov) +* [Vassil Vassilev](mailto:vvasilev@cern.ch) + +## Links +* [Repo](https://github.com/wlav/cppyy) diff --git a/_gsocproposals/2024/proposal_Cppyy-STL-Eigen-support.md b/_gsocproposals/2024/proposal_Cppyy-STL-Eigen-support.md new file mode 100644 index 000000000..ce5bfec42 --- /dev/null +++ b/_gsocproposals/2024/proposal_Cppyy-STL-Eigen-support.md @@ -0,0 +1,42 @@ +--- +title: Cppyy STL/Eigen - Automatic conversion and plugins for Python based ML-backends +layout: gsoc_proposal +project: Cppyy +year: 2024 +difficulty: medium +duration: 350 +mentor_avail: June-October +organization: + - CompRes +--- + +## Description + +Cppyy is an automatic, run-time, Python-C++ bindings generator, for calling C++ from Python and Python from C++. Cppyy uses pythonized wrappers of useful classes from libraries like STL and Eigen that allow the user to utilize them on the Python side. Current support follows container types in STL like std::vector, std::map, and std::tuple and the Matrix-based classes in Eigen/Dense. These cppyy objects can be plugged into idiomatic expressions that expect Python builtin-types. This behaviour is achieved by growing pythonistic methods like `__len__` while also retaining its C++ methods like `size`. + +Efficient and automatic conversion between C++ and Python is essential towards high-performance cross-language support. This approach eliminates overheads arising from iterative initialization such as comma insertion in Eigen. This opens up new avenues for the utilization of Cppyy’s bindings in tools that perform numerical operations for transformations, or optimization. + +The on-demand C++ infrastructure wrapped by idiomatic Python enables new techniques in ML tools like JAX/CUTLASS. This project allows the C++ infrastructure to be plugged into at service to the users seeking high-performance library primitives that are unavailable in Python. + +## Project Milestones + +* Extend STL support for std::vectors of arbitrary dimensions +* Improve the initialization approach for Eigen classes +* Develop a streamlined interconversion mechanism between Python builtin-types, numpy.ndarray, and STL/Eigen data structures +* Implement experimental plugins that perform basic computational operations in frameworks like JAX +* Work on integrating these plugins with toolkits like CUTLASS that utilise the bindings to provide a Python API + + +## Requirements + +* C++ programming +* Python programming +* Familiarity with STL types and the Eigen library is an advantage + +## Mentors +* **[Aaron Jomy](mailto:aaron.jomy@cern.ch)** +* [Wim Lavrijsen](mailto:wlavrijsen@lbl.gov) +* [Vassil Vassilev](mailto:vvasilev@cern.ch) + +## Links +* [Repo](https://github.com/wlav/cppyy) \ No newline at end of file diff --git a/gsoc/2023/mentors.md b/gsoc/2023/mentors.md index 315bde893..11f5f0e23 100644 --- a/gsoc/2023/mentors.md +++ b/gsoc/2023/mentors.md @@ -39,6 +39,5 @@ layout: plain * Sanjiban Sengupta [sanjiban.sg@gmail.com](mailto:sanjiban.sg@gmail.com) CERN * Juraj Smiesko [juraj.smiesko@cern.ch](mailto:juraj.smiesko@cern.ch) CERN * Enric Tejedor [etejedor@cern.ch](mailto:etejedor@cern.ch) CERN -* Vaibhav Thakkar [vaibhav.thakkar@cern.ch](mailto:vaibhav.thakkar@cern.ch) CompRes * Vassil Vassilev [vvasilev@cern.ch](mailto:vvasilev@cern.ch) CompRes * Valentin Volkl [valentin.volkl@cern.ch](mailto:valentin.volkl@cern.ch) CERN diff --git a/gsoc/2024/mentors.md b/gsoc/2024/mentors.md index 0642d11f2..2c584a39a 100644 --- a/gsoc/2024/mentors.md +++ b/gsoc/2024/mentors.md @@ -9,6 +9,7 @@ layout: plain * Parth Arora [partharora99160808@gmail.com](mailto:partharora99160808@gmail.com) CompRes * Jakob Blomer [jakob.blomer@cern.ch](mailto:jakob.blomer@cern.ch) CERN * Benedikt Hegner [benedikt.hegner@cern.ch](mailto:benedikt.hegner@cern.ch) CERN +* Aaron Jomy [aaron.jomy@cern.ch](mailto:aaron.jomy@cern.ch) CompRes * Wim Lavrijsen [wlavrijsen@lbl.gov](mailto:wlavrijsen@lbl.gov) CompRes * Thomas Madlener [thomas.madlener@cern.ch](mailto:thomas.madlener@desy.de) DESY * Alexander Penev [alexander.p.penev@gmail.com](mailto:alexander.p.penev@gmail.com) CompRes @@ -16,4 +17,4 @@ layout: plain * Juraj Smiesko [juraj.smiesko@cern.ch](mailto:juraj.smiesko@cern.ch) CERN * Vaibhav Thakkar [vaibhav.thakkar@cern.ch](mailto:vaibhav.thakkar@cern.ch) CompRes * Vassil Vassilev [vvasilev@cern.ch](mailto:vvasilev@cern.ch) CompRes -* Valentin Volkl [valentin.volkl@cern.ch](mailto:valentin.volkl@cern.ch) CERN +* Valentin Volkl [valentin.volkl@cern.ch](mailto:valentin.volkl@cern.ch) CERN \ No newline at end of file