Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple batching implementation of WHIR #11

Open
wants to merge 65 commits into
base: feat/ceno-binding
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
23a4a58
Update batch function names
yczhangsjtu Jan 8, 2025
c29e4fe
Add InvalidPcsParam to Error
yczhangsjtu Jan 8, 2025
531ce8f
Add batch committer
yczhangsjtu Jan 8, 2025
940ee33
Add batch prover
yczhangsjtu Jan 8, 2025
ab61e90
Modify batch prover
yczhangsjtu Jan 8, 2025
a7f03f1
Add batch verifier
yczhangsjtu Jan 8, 2025
7c315b5
Use witnesses in binding
yczhangsjtu Jan 8, 2025
b2edda4
Add batch commit
yczhangsjtu Jan 8, 2025
3f2d3de
Add batch open
yczhangsjtu Jan 8, 2025
0bb33fc
Add batch verifier
yczhangsjtu Jan 8, 2025
3bd6f97
Fix iopattern mismatch for batch
yczhangsjtu Jan 13, 2025
1d98892
Fix bug
yczhangsjtu Jan 13, 2025
c45846c
Fix batch size required to be power of 2
yczhangsjtu Jan 16, 2025
0258886
Change folding factor to 4
yczhangsjtu Jan 17, 2025
9d97076
Switch to Keccak
yczhangsjtu Jan 17, 2025
b1fb734
Tmp store
yczhangsjtu Jan 17, 2025
5023abb
Tmp store
yczhangsjtu Jan 17, 2025
c092b63
Tmp store
yczhangsjtu Jan 17, 2025
92afb75
Tmp store
yczhangsjtu Jan 17, 2025
883b4dd
Optimize
yczhangsjtu Jan 17, 2025
ba9c6d1
Negate the expression of for loop
autquis Jan 18, 2025
e21c172
Merge pull request #28 from autquis/patch-1
WizardOfMenlo Jan 19, 2025
e6fd45d
Temp store
yczhangsjtu Jan 21, 2025
a6a7cea
Temp store
yczhangsjtu Jan 21, 2025
7c27ada
Change folding factor to 4
yczhangsjtu Jan 23, 2025
a4cccc8
Revert "Switch to Keccak"
yczhangsjtu Jan 23, 2025
9bc5c34
Small optimization
yczhangsjtu Feb 10, 2025
0721c87
Temp store
yczhangsjtu Feb 11, 2025
4ef2d9e
Temp store
yczhangsjtu Feb 11, 2025
430b4e5
Temp store
yczhangsjtu Feb 11, 2025
0cf9b47
Temp store
yczhangsjtu Feb 11, 2025
c273a37
Temp store
yczhangsjtu Feb 11, 2025
21b1a65
Temp store
yczhangsjtu Feb 11, 2025
292079c
Temp store
yczhangsjtu Feb 11, 2025
f2ad1c3
Temp store
yczhangsjtu Feb 11, 2025
6311916
Temp store
yczhangsjtu Feb 11, 2025
01b2046
Temp store
yczhangsjtu Feb 11, 2025
7cff328
Temp store
yczhangsjtu Feb 11, 2025
a519430
Temp store
yczhangsjtu Feb 11, 2025
970dc08
Temp store
yczhangsjtu Feb 11, 2025
4cbf538
Support variate folding factor (to debug)
yczhangsjtu Feb 13, 2025
8d2472d
Add hotfixes for short polynomials
Feb 13, 2025
2e06889
Fixed batched opening
Feb 13, 2025
51fc11a
Test passes & Add comments
yczhangsjtu Feb 14, 2025
651e6e4
Rename get_folding_factor_of_round to at_round
yczhangsjtu Feb 14, 2025
b7a9613
Code format
yczhangsjtu Feb 14, 2025
45bd504
Revert a small bit
yczhangsjtu Feb 14, 2025
f19fd79
Make parameter empty
yczhangsjtu Feb 14, 2025
b43f3ad
Set default first round folding factor to 4
yczhangsjtu Feb 14, 2025
95a5df9
Fixed bug on single-round verifier, removed compute_folds_batched
Feb 15, 2025
02a7e1b
Fix typo
yczhangsjtu Feb 17, 2025
201c06e
Add hotfixes for short polynomials (#13)
yczhangsjtu Feb 17, 2025
c8a6557
Merge branch 'feat/ceno-binding-batch' into kunming/simple-batch-fix
yczhangsjtu Feb 17, 2025
ca53a50
Format
yczhangsjtu Feb 17, 2025
e10676a
Kunming/simple batch fix (#14)
yczhangsjtu Feb 17, 2025
8eccd55
Merge remote-tracking branch 'origin/feat/variable-folding-factors' i…
yczhangsjtu Feb 17, 2025
392608a
Fix
yczhangsjtu Feb 17, 2025
7315742
Apply variable folding factor to batched version
yczhangsjtu Feb 18, 2025
04f3a2c
Fix a bug
yczhangsjtu Feb 18, 2025
01d7167
Use different folding factor for batch and non-batch settings
yczhangsjtu Feb 18, 2025
65ecef8
Small optimization
yczhangsjtu Feb 19, 2025
cc75d91
Try optimizing batch verifier
yczhangsjtu Feb 19, 2025
c405d1c
Try optimizing batch verifier
yczhangsjtu Feb 19, 2025
8dc299d
Clean up
yczhangsjtu Feb 19, 2025
cc05cba
Clean up
yczhangsjtu Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ nimue = { git = "https://github.com/arkworks-rs/nimue", features = ["ark"] }
nimue-pow = { git = "https://github.com/arkworks-rs/nimue" }
lazy_static = "1.4"
rayon = { version = "1.10.0", optional = true }
transpose = "0.2.3"

goldilocks = { git = "https://github.com/scroll-tech/ceno-Goldilocks" }
thiserror = "1"
derive_more = { version = "1.0.0", features = ["debug"] }
itertools = "0.14.0"

[profile.release]
debug = true
Expand All @@ -44,3 +46,4 @@ parallel = [
]
rayon = ["dep:rayon"]
ceno = []
print-trace = ["ark-std/print-trace"]
11 changes: 9 additions & 2 deletions src/bin/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use whir::{
},
parameters::*,
poly_utils::coeffs::CoefficientList,
whir::{iopattern::WhirIOPattern, Statement},
whir::Statement,
};

use serde::Serialize;
Expand Down Expand Up @@ -49,6 +49,9 @@ struct Args {
#[arg(long = "reps", default_value = "1000")]
verifier_repetitions: usize,

#[arg(short = 'i', long = "initfold", default_value = "4")]
first_round_folding_factor: usize,

#[arg(short = 'k', long = "fold", default_value = "4")]
folding_factor: usize,

Expand Down Expand Up @@ -223,6 +226,7 @@ fn run_whir<F, MerkleConfig>(
let starting_rate = args.rate;
let reps = args.verifier_repetitions;
let folding_factor = args.folding_factor;
let first_round_folding_factor = args.first_round_folding_factor;
let soundness_type = args.soundness_type;
let fold_optimisation = args.fold_optimisation;

Expand All @@ -236,7 +240,10 @@ fn run_whir<F, MerkleConfig>(
initial_statement: true,
security_level,
pow_bits,
folding_factor,
folding_factor: FoldingFactor::ConstantFromSecondRound(
first_round_folding_factor,
folding_factor,
),
leaf_hash_params,
two_to_one_params,
soundness_type,
Expand Down
15 changes: 13 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ struct Args {
#[arg(long = "reps", default_value = "1000")]
verifier_repetitions: usize,

#[arg(short = 'i', long = "initfold", default_value = "4")]
first_round_folding_factor: usize,

#[arg(short = 'k', long = "fold", default_value = "4")]
folding_factor: usize,

Expand Down Expand Up @@ -219,6 +222,7 @@ fn run_whir_as_ldt<F, MerkleConfig>(
let num_variables = args.num_variables;
let starting_rate = args.rate;
let reps = args.verifier_repetitions;
let first_round_folding_factor = args.first_round_folding_factor;
let folding_factor = args.folding_factor;
let fold_optimisation = args.fold_optimisation;
let soundness_type = args.soundness_type;
Expand All @@ -235,7 +239,10 @@ fn run_whir_as_ldt<F, MerkleConfig>(
initial_statement: false,
security_level,
pow_bits,
folding_factor,
folding_factor: FoldingFactor::ConstantFromSecondRound(
first_round_folding_factor,
folding_factor,
),
leaf_hash_params,
two_to_one_params,
soundness_type,
Expand Down Expand Up @@ -326,6 +333,7 @@ fn run_whir_pcs<F, MerkleConfig>(
let num_variables = args.num_variables;
let starting_rate = args.rate;
let reps = args.verifier_repetitions;
let first_round_folding_factor = args.first_round_folding_factor;
let folding_factor = args.folding_factor;
let fold_optimisation = args.fold_optimisation;
let soundness_type = args.soundness_type;
Expand All @@ -343,7 +351,10 @@ fn run_whir_pcs<F, MerkleConfig>(
initial_statement: true,
security_level,
pow_bits,
folding_factor,
folding_factor: FoldingFactor::ConstantFromSecondRound(
first_round_folding_factor,
folding_factor,
),
leaf_hash_params,
two_to_one_params,
soundness_type,
Expand Down
Loading