Skip to content

Commit

Permalink
[Release v0.4.0] FFT memory reduction and proving key size reduction (#…
Browse files Browse the repository at this point in the history
…17)

* Resolve Prover optimization: memory reduction privacy-scaling-explorations#77 (#6)

* Resolve taikoxyz/zkevm-circuits#77

* Please Clippy

* fix: recursive FFT for lengths not `2^k, 2^extended_k`

Also fixed some issue when multicore feature is not on.

* fix: evaluation (cherry-pick
https://github.com/scroll-tech/halo2-gpu/blob/a3019b047ad7d7119103f4d9df3fd33ce1429f95/halo2_proofs/src/plonk/evaluation.rs)

* fix: `g_to_lagrange` uses inverse fft

* Bump version since this is a breaking change to pk

* chore: update halo2curves version

---------

Co-authored-by: einar-taiko <[email protected]>
  • Loading branch information
jonathanpwang and einar-taiko authored Nov 18, 2023
1 parent 42573f6 commit e841084
Show file tree
Hide file tree
Showing 23 changed files with 1,860 additions and 1,735 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
with:
override: false
- name: Run examples
run: cargo run --example serialization
run: |
cargo run --example serialization
cargo run --example shuffle
cargo run --example shuffle_api
fmt:
name: Rustfmt
Expand Down
9 changes: 4 additions & 5 deletions halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "halo2-axiom"
version = "0.3.1"
version = "0.4.0"
authors = [
"Sean Bowe <[email protected]>",
"Ying Tong Lai <[email protected]>",
Expand Down Expand Up @@ -55,12 +55,13 @@ name = "fft"
harness = false

[dependencies]
itertools = "0.11"
backtrace = { version = "0.3", optional = true }
crossbeam = "0.8"
ff = "0.13"
group = "0.13"
pairing = "0.23"
halo2curves = { package = "halo2curves-axiom", version = "0.4.1", default-features = false, features = ["bits", "bn256-table", "derive_serde"] }
halo2curves = { package = "halo2curves-axiom", version = "0.4.2", default-features = false, features = ["bits", "bn256-table", "derive_serde"] }
rand = "0.8"
rand_core = { version = "0.6", default-features = false}
tracing = "0.1"
Expand All @@ -84,6 +85,7 @@ gumdrop = "0.8"
proptest = "1"
rand_core = { version = "0.6", features = ["getrandom"] }
rand_chacha = "0.3.1"
ark-std = { version = "0.3.0", features = ["print-trace"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand Down Expand Up @@ -114,6 +116,3 @@ name = "serialization"

[[example]]
name = "shuffle"

[[example]]
name = "shuffle_api"
18 changes: 13 additions & 5 deletions halo2_proofs/benches/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@ extern crate criterion;

use crate::arithmetic::best_fft;
use group::ff::Field;
use halo2_axiom::*;
use halo2curves::pasta::Fp;
use halo2_axiom::{poly::EvaluationDomain, *};
use halo2curves::bn256::Fr as Scalar;

use criterion::{BenchmarkId, Criterion};
use rand_core::OsRng;

fn criterion_benchmark(c: &mut Criterion) {
let j = 5;
let mut group = c.benchmark_group("fft");
for k in 3..19 {
let domain = EvaluationDomain::new(j, k);
let omega = domain.get_omega();
let l = 1 << k;
let data = domain.get_fft_data(l);

group.bench_function(BenchmarkId::new("k", k), |b| {
let mut a = (0..(1 << k)).map(|_| Fp::random(OsRng)).collect::<Vec<_>>();
let omega = Fp::random(OsRng); // would be weird if this mattered
let mut a = (0..(1 << k))
.map(|_| Scalar::random(OsRng))
.collect::<Vec<_>>();

b.iter(|| {
best_fft(&mut a, omega, k as u32);
best_fft(&mut a, omega, k, data, false);
});
});
}
Expand Down
208 changes: 0 additions & 208 deletions halo2_proofs/examples/shuffle_api.rs

This file was deleted.

Loading

0 comments on commit e841084

Please sign in to comment.