halo2 icon indicating copy to clipboard operation
halo2 copied to clipboard

Add `ec-gpu` support

Open str4d opened this issue 3 years ago • 5 comments

We want to be able to leverage GPUs in halo2, via the ec-gpu crate. This requires two changes:

  • The curve implementation needs to support producing the GPU kernel for finite field arithmetic.
  • halo2 needs to use GPU-aware MSM and FFT algorithms.

This issue covers the second change. We will need logic here that uses the CUDA/OpenCL source code generated by the ec-gpu-gen crate to perform MSMs and FFTs. We will then need to integrate it in some way with our CPU-based implementations, ideally such that downstream consumers of the halo2 crate can control it.

str4d avatar Oct 05 '21 20:10 str4d

As with other arithmetic, any code we bring into halo2 will ideally be temporary while we figure out the necessary APIs and integration. My goal is to land the generic code into a reusable crate, either somewhere like ff or group, or (perhaps more likely, to keep the DAG regular) a new crate.

str4d avatar Oct 05 '21 20:10 str4d

just curious, any update on this one?

zeroxaa avatar Aug 09 '22 19:08 zeroxaa

The ec-gpu devs have just released a new version of the trait crate, which I believe is intended to help with the GPU side of this integration work.

str4d avatar Aug 11 '22 02:08 str4d

Is there anyone working on producing GPU kernel for halo2 curve? if not, I'd like to give a try.

zeroxaa avatar Sep 20 '22 06:09 zeroxaa

Is there GPU kernel for Halo2 curve now?

liuhao230 avatar Dec 07 '23 08:12 liuhao230