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

feat: add openssl-sha256 to benchmark #278

Closed
wants to merge 4 commits into from
Closed

Conversation

jonathanpwang
Copy link
Contributor

I added Sha256 from rust-crypto to Plonky3/Plonky3#413
Apparently the rust-crypto implementation even with NEON is perhaps 2x worse than the openssl one: RustCrypto/hashes#327 (comment)

Here I directly implement CryptographicHasher on the openssl sha256, let's see the benchmarks.

The openssl rust crate is just a FFI wrapper for their C library. I am hoping they use the ARMv8 SHA256 intrinsics: https://mijailovic.net/2018/06/06/sha256-armv8/

@jonathanpwang
Copy link
Contributor Author

Inspired from seeing stwo using a custom simd blake2: https://github.com/starkware-libs/stwo/blob/dev/crates/prover/src/core/backend/simd/blake2s.rs

Copy link

github-actions bot commented Aug 9, 2024

Previous Benchmark

Benchmark for Predicate

Total Cells Total Prove (ms) Main Trace Gen (ms) Perm Trace Gen (ms) Calc Quotient Values (ms) Rest of Prove (ms)
19_726_336 719.00 211.00 8.17 30.20 469.63

AIR metrics

Name Rows Cells Prep Cols Main Cols Perm Cols
PageIndexScanInputAir 32_768 10_354_688 0 [97, 147] [72]
PageIndexScanOutputAir 32_768 8_716_288 0 [97, 97] [72]
RangeCheckerGateAir 65_536 655_360 0 [2] [8]

Commit: 3dfdfb4
AWS Instance Type: r7g.8xlarge
Benchmark Workflow

New Benchmark

Benchmark for Predicate

Total Cells Total Prove (ms) Main Trace Gen (ms) Perm Trace Gen (ms) Calc Quotient Values (ms) Rest of Prove (ms)
19_726_336 700.00 213.00 8.27 31.60 447.13

AIR metrics

Name Rows Cells Prep Cols Main Cols Perm Cols
PageIndexScanInputAir 32_768 10_354_688 0 [97, 147] [72]
PageIndexScanOutputAir 32_768 8_716_288 0 [97, 97] [72]
RangeCheckerGateAir 65_536 655_360 0 [2] [8]

Commit: 171c442
AWS Instance Type: r7g.8xlarge
Benchmark Workflow

Copy link

github-actions bot commented Aug 9, 2024

Previous Benchmark

Benchmark for ReadWrite

Total Cells Total Prove (ms) Main Trace Gen (ms) Perm Trace Gen (ms) Calc Quotient Values (ms) Rest of Prove (ms)
38_764_544 1500.00 288.00 25.70 174.00 1012.30

AIR metrics

Name Rows Cells Prep Cols Main Cols Perm Cols
PageReadAir 32_768 1_343_488 0 [33] [8]
IndexedPageWriteAir 32_768 5_603_328 0 [33, 98] [40]
PageOfflineChecker 131_072 29_753_344 0 [179] [48]
RangeCheckerGateAir 65_536 655_360 0 [2] [8]
ExecutionAir 32_768 1_409_024 0 [35] [8]

Commit: 3dfdfb4
AWS Instance Type: r7g.8xlarge
Benchmark Workflow

New Benchmark

Benchmark for ReadWrite

Total Cells Total Prove (ms) Main Trace Gen (ms) Perm Trace Gen (ms) Calc Quotient Values (ms) Rest of Prove (ms)
38_764_544 1530.00 297.00 26.30 173.00 1033.70

AIR metrics

Name Rows Cells Prep Cols Main Cols Perm Cols
PageReadAir 32_768 1_343_488 0 [33] [8]
IndexedPageWriteAir 32_768 5_603_328 0 [33, 98] [40]
PageOfflineChecker 131_072 29_753_344 0 [179] [48]
RangeCheckerGateAir 65_536 655_360 0 [2] [8]
ExecutionAir 32_768 1_409_024 0 [35] [8]

Commit: 171c442
AWS Instance Type: r7g.8xlarge
Benchmark Workflow

@jonathanpwang
Copy link
Contributor Author

workflow for more comprehensive benches: https://github.com/axiom-crypto/afs-prototype/actions/runs/10311730058

results here: https://docs.google.com/spreadsheets/d/1wwhyGgFNGcapD2xk5_gixPFt8dlp722bRwwFHmaKzrE/edit?usp=sharing

Closing for now since there's no difference. I feel there is something slightly fishy about this, but I'd need to make some flamegraphs of the trace commitment to go deeper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant