Skip to content

Commit

Permalink
[gsoc24] Add Cppyy projects from compiler-research.org (#1500)
Browse files Browse the repository at this point in the history
* [gsoc24] Add Cppyy projects and proposals for compiler-research.org

* [gsoc24] Update Cppyy and Clad projects from compiler-research.org

* [gsoc24] Update mentor list
  • Loading branch information
aaronj0 authored Feb 7, 2024
1 parent 5707cd7 commit 8c4677b
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 5 deletions.
20 changes: 20 additions & 0 deletions _gsocprojects/2024/project_Cppyy.md
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 1 addition & 1 deletion _gsocproposals/2024/proposal_Clad-GPUReverseMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion _gsocproposals/2024/proposal_Clad-ObjectOrientedAD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
57 changes: 57 additions & 0 deletions _gsocproposals/2024/proposal_Cppyy-Numba-CUDA.md
Original file line number Diff line number Diff line change
@@ -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:[email protected])**
* [Wim Lavrijsen](mailto:[email protected])
* [Vassil Vassilev](mailto:[email protected])

## Links
* [Repo](https://github.com/wlav/cppyy)
42 changes: 42 additions & 0 deletions _gsocproposals/2024/proposal_Cppyy-STL-Eigen-support.md
Original file line number Diff line number Diff line change
@@ -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:[email protected])**
* [Wim Lavrijsen](mailto:[email protected])
* [Vassil Vassilev](mailto:[email protected])

## Links
* [Repo](https://github.com/wlav/cppyy)
1 change: 0 additions & 1 deletion gsoc/2023/mentors.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,5 @@ layout: plain
* Sanjiban Sengupta [[email protected]](mailto:[email protected]) CERN
* Juraj Smiesko [[email protected]](mailto:[email protected]) CERN
* Enric Tejedor [[email protected]](mailto:[email protected]) CERN
* Vaibhav Thakkar [[email protected]](mailto:[email protected]) CompRes
* Vassil Vassilev [[email protected]](mailto:[email protected]) CompRes
* Valentin Volkl [[email protected]](mailto:[email protected]) CERN
3 changes: 2 additions & 1 deletion gsoc/2024/mentors.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ layout: plain
* Parth Arora [[email protected]](mailto:[email protected]) CompRes
* Jakob Blomer [[email protected]](mailto:[email protected]) CERN
* Benedikt Hegner [[email protected]](mailto:[email protected]) CERN
* Aaron Jomy [[email protected]](mailto:[email protected]) CompRes
* Wim Lavrijsen [[email protected]](mailto:[email protected]) CompRes
* Thomas Madlener [[email protected]](mailto:[email protected]) DESY
* Alexander Penev [[email protected]](mailto:[email protected]) CompRes
* Piyush Raikwar [[email protected]](mailto:[email protected]) CERN
* Juraj Smiesko [[email protected]](mailto:[email protected]) CERN
* Vaibhav Thakkar [[email protected]](mailto:[email protected]) CompRes
* Vassil Vassilev [[email protected]](mailto:[email protected]) CompRes
* Valentin Volkl [[email protected]](mailto:[email protected]) CERN
* Valentin Volkl [[email protected]](mailto:[email protected]) CERN

0 comments on commit 8c4677b

Please sign in to comment.