DoHoonKim8 0c1e9396cc Cleanup
2024-08-17 16:44:40 +09:00
2024-08-17 16:44:40 +09:00
2024-05-31 16:53:26 +09:00
2024-08-17 16:44:40 +09:00
2024-05-02 22:51:30 +09:00
2024-08-17 16:44:40 +09:00
2024-08-17 16:44:40 +09:00

Overview

This project aims to implement Sumcheck protocol on GPU via CUDA, following the algorithm described from here. This project aims to minimize C++ code and provide easy to use Rust API for launching kernel by leveraging bindgen and cudarc.

Architecture

cuda-sumcheck-architecture

  • bindgen: generates Rust struct defined inside CUDA kernels written in C++
  • cudarc: safe abstraction for interop with GPU driver

Structure

.
├── Cargo.lock
├── Cargo.toml
├── build.rs
├── docs
│   └── design.md
└── src
    ├── cuda
    │   ├── includes
    │   │   ├── barretenberg
    │   │   ├── prime_field.h
    │   │   ├── test.cpp
    │   │   └── wrapper.h
    │   └── kernels
    │       ├── multilinear.cu
    │       ├── scalar_multiplication.cu
    │       └── sumcheck.cu
    ├── field.rs
    └── lib.rs
  • build.rs contains the build script for building the whole project

  • src/cuda/includes/barretenberg/ contains barretenberg lib (https://github.com/AztecProtocol/barretenberg/tree/master) for field implementation in C++

  • src/cuda/includes/prime_field.h declares FieldBinding struct in C representing barretenberg field struct. This wrapping is due to the lack of support for C++ language of bindgen crate

  • src/cuda/includes/wrapper.h is interface file for bindgen to generate Rust struct from C struct

  • In src/cuda/includes/kernel/, multiple kernel functions are defined

  • In field.rs, conversion between FieldBinding struct and halo2curves' field struct is implemented

  • In lib.rs, expose APIs to test CUDA kernels via GPUApiWrapper struct

Description
No description provided
Readme MIT 416 KiB
Languages
Rust 90.9%
Cuda 8.1%
Makefile 0.6%
C 0.4%