-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
8 changed files
with
124 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |