Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

[WIP]Optimization Bench #302

Conversation

ashWhiteHat
Copy link
Contributor

@ashWhiteHat ashWhiteHat commented Jan 24, 2022

Abstract

This branch checks only bench_evm_circuit_prover and how the optimization improves performance.

Performance

Degree: 19

Step Default Assembly Rebase Assembly And Rebase Reduction Rate
Setup 318.167s 258.626s 317.871s 258.844s 18.64 %
Prove 5817.462s 5745.782s 1680.817s 1627.667s 72.02%
Verify 114.946ms 119.416ms 111.262ms 109.344ms 4.87%
Total 6156.35s 6022.38s 2129.42s 1904.50s 69.06%
Resource Default Assembly Rebase Assembly And Rebase Reduction Rate
CPU 66.8% 33.1% 100.0% 100.0% +49.70%
Memory 508.6Gb 442.8Gb 464.9Gb 464.1Gb 8.59%

Improvement

  • Improve fft

Done

  • Introduce flame graph (patch @lispc and Ho code)
  • Introduce pprof (patch @lispc and Ho code)
  • Introduce assembly
  • Rebase zcash halo2 latest branch (actually not latest)

Note

I would like to get pprof file.

@ashWhiteHat ashWhiteHat added the benchmarks: ALL Triggers a long running prover benchmark label Jan 24, 2022
@ashWhiteHat ashWhiteHat force-pushed the feature/prover-optimization-by-asm-and-rebase branch 4 times, most recently from 1e46eac to 3053aa8 Compare January 24, 2022 08:25
@ashWhiteHat ashWhiteHat marked this pull request as draft January 24, 2022 08:30
@ashWhiteHat ashWhiteHat force-pushed the feature/prover-optimization-by-asm-and-rebase branch from 3053aa8 to ffc1077 Compare January 24, 2022 08:31
@ashWhiteHat ashWhiteHat marked this pull request as ready for review January 24, 2022 08:31
@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed benchmarks: ALL Triggers a long running prover benchmark labels Jan 24, 2022
@github-actions github-actions bot added crate-bus-mapping Issues related to the bus-mapping workspace member crate-keccak Issues related to the keccak workspace member labels Jan 24, 2022
@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed crate-bus-mapping Issues related to the bus-mapping workspace member crate-keccak Issues related to the keccak workspace member benchmarks: ALL Triggers a long running prover benchmark labels Jan 24, 2022
@barryWhiteHat
Copy link
Contributor

Hmm seems like the acceleration from intel assembly seems to be so low. @AronisAt79 what CPU does the test server have ? Does virtualization block us from using cpu instruction based optimizations ?

@AronisAt79
Copy link
Contributor

@barryWhiteHat i cant think of why virtualization might block optimizations. Here are the cpu details. We can repeat the specific test on other available architectures for similar instance size, if this would help.

Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 96
On-line CPU(s) list: 0-95
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
Stepping: 7
CPU MHz: 2499.996
BogoMIPS: 4999.99
Hypervisor vendor: KVM
Virtualization type: full
L1d cache: 1.5 MiB
L1i cache: 1.5 MiB
L2 cache: 48 MiB
L3 cache: 71.5 MiB
NUMA node0 CPU(s): 0-23,48-71
NUMA node1 CPU(s): 24-47,72-95

@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed benchmarks: ALL Triggers a long running prover benchmark labels Jan 25, 2022
@ashWhiteHat
Copy link
Contributor Author

ashWhiteHat commented Jan 25, 2022

No worry.
I optimized and benched it again.
It reduces about 20% arithmetic time.
privacy-scaling-explorations/pairing#5 (comment)

I think if it's applied, the halo2 will be faster as well.

@github-actions github-actions bot added crate-bus-mapping Issues related to the bus-mapping workspace member crate-keccak Issues related to the keccak workspace member labels Jan 25, 2022
@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed crate-keccak Issues related to the keccak workspace member benchmarks: ALL Triggers a long running prover benchmark labels Feb 8, 2022
@github-actions github-actions bot added crate-keccak Issues related to the keccak workspace member T-opcode Type: opcode-related and focused PR/Issue crate-zkevm-circuits Issues related to the zkevm-circuits workspace member labels Feb 8, 2022
@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed crate-zkevm-circuits Issues related to the zkevm-circuits workspace member T-opcode Type: opcode-related and focused PR/Issue crate-keccak Issues related to the keccak workspace member benchmarks: ALL Triggers a long running prover benchmark labels Feb 8, 2022
@ashWhiteHat ashWhiteHat force-pushed the feature/prover-optimization-by-asm-and-rebase branch from 51ef3c4 to 4cf8ba3 Compare February 8, 2022 10:34
@github-actions github-actions bot added crate-keccak Issues related to the keccak workspace member T-opcode Type: opcode-related and focused PR/Issue crate-zkevm-circuits Issues related to the zkevm-circuits workspace member labels Feb 8, 2022
@ashWhiteHat ashWhiteHat added benchmarks: ALL Triggers a long running prover benchmark and removed crate-zkevm-circuits Issues related to the zkevm-circuits workspace member T-opcode Type: opcode-related and focused PR/Issue crate-keccak Issues related to the keccak workspace member benchmarks: ALL Triggers a long running prover benchmark labels Feb 8, 2022
@AronisAt79 AronisAt79 added benchmarks: ALL Triggers a long running prover benchmark and removed benchmarks: ALL Triggers a long running prover benchmark labels Feb 17, 2022
@ashWhiteHat ashWhiteHat changed the base branch from main to feat/halo2-update February 22, 2022 03:00
@ChihChengLiang ChihChengLiang deleted the feature/prover-optimization-by-asm-and-rebase branch May 17, 2023 08:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
benchmarks: ALL Triggers a long running prover benchmark
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants