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

bench: Poseidon2 with user supplied number of bytes #1649

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
few fixes
  • Loading branch information
codeblooded1729 committed Apr 30, 2024
commit 977fbf3299e71b7852e9844e4b676bc59f4a2a93
3 changes: 2 additions & 1 deletion circuits/src/poseidon2/generation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ pub fn generate_poseidon2_trace<F: RichField>(step_rows: &[Row<F>]) -> Vec<Posei
.collect::<Vec<Poseidon2State<F>>>(),
generate_poseidon2_state(&[F::ZERO; STATE_SIZE], false),
);
log::trace!("Poseison2 trace {:?}", trace);
log::trace!("Poseidon2 trace {:?}", trace);
log::info!("Poseidon2 trace length {:?}", trace.len());
trace
}

Expand Down
2 changes: 1 addition & 1 deletion examples/mozak-poseidon2/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
// using rng to generate random bytes interferes
// with benching poseidon2 ecall, which is the primary
// focus here.
let v: Vec<u8> = black_box((0..n).map(|i| 0x12).collect());
let v: Vec<u8> = black_box((0..n).map(|_i| 0x12).collect());
let mut hash = [0u8; 32];

// flat hash
Expand Down
9 changes: 5 additions & 4 deletions perftool/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@
}
}
},
"poseidon2": {
"description": "Benching Poseidon2 ECALL",
"poseidon2-elf": {
"description": "Benching Poseidon2 ecall inside ELF.",
"parameter": "input_len",
"output": "time taken (in s)",
"benches": {
"poseidon2": {
"poseidon2-elf": {
"commit": "latest",
"bench_function": "poseidon2-bench"
"bench_function": "poseidon2-elf-bench",
"elf": "examples/mozak-poseidon2"
}
}
}
Expand Down
Loading