Skip to content

Commit 9f62008

Browse files
authored
readme and figures (#3)
1 parent bbf98a3 commit 9f62008

File tree

7 files changed

+41
-11
lines changed

7 files changed

+41
-11
lines changed

README.md

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,53 @@
1-
# halo2 [![Crates.io](https://img.shields.io/crates/v/halo2.svg)](https://crates.io/crates/halo2) #
1+
## Icicle Halo2 Usage Guide
22

3-
## [Documentation](https://privacy-scaling-explorations.github.io/halo2/halo2_proofs)
3+
This repository contains a ICICLE integration fork of [ezkl-halo2](https://github.com/zkonduit/halo2), designed for efficient proof generation using CUDA.
44

5-
For experimental features `privacy-scaling-explorations/halo2` fork adds, please refer to [`experimental-features.md`](./book/src/user/experimental-features.md).
5+
### Prerequisites
66

7-
## Minimum Supported Rust Version
7+
* **Environment Variable Setup**:
88

9-
Requires Rust **1.65.0** or higher.
9+
Before running the CUDA backend, set the following environment variable:
1010

11-
Minimum supported Rust version can be changed in the future, but it will be done with a
12-
minor version bump.
11+
```bash
12+
export ICICLE_BACKEND_INSTALL_DIR=halo2/icicle/backend/cuda
13+
```
1314

14-
## Controlling parallelism
15+
## Benchmarks
1516

16-
`halo2` currently uses [rayon](https://github.com/rayon-rs/rayon) for parallel computation. The `RAYON_NUM_THREADS` environment variable can be used to set the number of threads.
17+
We benched the code on this setup:
18+
- 4080 & i9–13900K
1719

18-
When compiling to WASM-targets, notice that since version `1.7`, `rayon` will fallback automatically (with no need to handle features) to require `getrandom` in order to be able to work. For more info related to WASM-compilation.
20+
We used the circuits in the MoPro’s benchmark repository to compare the proving systems.
21+
22+
- **Simple Lookup**: Defines a lookup table that doubles input values and verifies this relation using both a lookup constraint and a simple identity gate.
23+
- **Plonk**: Implements a gate that supports both multiplication and addition. It repeatedly computes a^2 + a, verifies correctness using gate constraints.
24+
- **Lookups**: Defines a lookup-heavy computation using a simple 8-bit lookup table and multiple redundant lookup constraints to inflate the degree of the constraint system.
25+
26+
<p align="center">
27+
<img src="./figures/lookups_ms_log_scale.png" alt="4090 Benchmark" width="45%">
28+
<img src="./figures/lookups.png" alt="4080 Benchmark" width="45%">
29+
</p>
30+
31+
<p align="center">
32+
<img src="./figures/simple_ms_log_scale.png" alt="4090 Benchmark" width="45%">
33+
<img src="./figures/simple.png" alt="4080 Benchmark" width="45%">
34+
</p>
35+
36+
<p align="center">
37+
<img src="./figures/plonk_ms_log_scale.png" alt="4090 Benchmark" width="45%">
38+
<img src="./figures/plonk.png" alt="4080 Benchmark" width="45%">
39+
</p>
40+
41+
## Reproducing the benchmarks
42+
43+
We have used the existing benchmark circuits under the halo2 repository. You can reporduce the benchmarks by running
44+
45+
```bash
46+
cargo run --package halo2_proofs --example lookups
47+
cargo run --package halo2_proofs --example simple-lookup
48+
cargo run --package halo2_proofs --example plonk
49+
```
1950

20-
See: [Rayon: Usage with WebAssembly](https://github.com/rayon-rs/rayon#usage-with-webassembly) for more
2151

2252
## License
2353

figures/lookups.png

16.8 KB
Loading

figures/lookups_ms_log_scale.png

22.5 KB
Loading

figures/plonk.png

18.9 KB
Loading

figures/plonk_ms_log_scale.png

22.1 KB
Loading

figures/simple.png

19.3 KB
Loading

figures/simple_ms_log_scale.png

22.8 KB
Loading

0 commit comments

Comments
 (0)