lambdaclass / cairo-vm

cairo-vm is a Rust implementation of the Cairo VM. Cairo (CPU Algebraic Intermediate Representation) is a programming language for writing provable programs, where one party can prove to another that a certain computation was executed correctly without the need for this party to re-execute the same program.
https://lambdaclass.github.io/cairo-vm
Apache License 2.0
485 stars 132 forks source link

cairo1-run CLI: Set `finalize_builtins` to true when using `--air_public_input` flag #1752

Closed fmoletta closed 1 month ago

fmoletta commented 1 month ago

This change is consistent with the doc in Cairo1RunConfig.

github-actions[bot] commented 1 month ago
**Hyper Thereading Benchmark results**

hyperfine -r 2 -n "hyper_threading_main threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_main' -n "hyper_threading_pr threads: 1" 'RAYON_NUM_THREADS=1 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 1
  Time (mean ± σ):     27.290 s ±  0.070 s    [User: 26.504 s, System: 0.784 s]
  Range (min … max):   27.241 s … 27.340 s    2 runs

Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     27.193 s ±  0.088 s    [User: 26.420 s, System: 0.772 s]
  Range (min … max):   27.131 s … 27.256 s    2 runs

Summary
  'hyper_threading_pr threads: 1' ran
    1.00 ± 0.00 times faster than 'hyper_threading_main threads: 1'

hyperfine -r 2 -n "hyper_threading_main threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_main' -n "hyper_threading_pr threads: 2" 'RAYON_NUM_THREADS=2 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 2
  Time (mean ± σ):     14.608 s ±  0.042 s    [User: 26.987 s, System: 0.778 s]
  Range (min … max):   14.579 s … 14.638 s    2 runs

Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.544 s ±  0.037 s    [User: 26.909 s, System: 0.762 s]
  Range (min … max):   14.518 s … 14.570 s    2 runs

Summary
  'hyper_threading_pr threads: 2' ran
    1.00 ± 0.00 times faster than 'hyper_threading_main threads: 2'

hyperfine -r 2 -n "hyper_threading_main threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_main' -n "hyper_threading_pr threads: 4" 'RAYON_NUM_THREADS=4 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 4
  Time (mean ± σ):     10.986 s ±  0.273 s    [User: 38.813 s, System: 0.943 s]
  Range (min … max):   10.793 s … 11.179 s    2 runs

Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.881 s ±  0.212 s    [User: 38.441 s, System: 0.942 s]
  Range (min … max):   10.731 s … 11.032 s    2 runs

Summary
  'hyper_threading_pr threads: 4' ran
    1.01 ± 0.03 times faster than 'hyper_threading_main threads: 4'

hyperfine -r 2 -n "hyper_threading_main threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_main' -n "hyper_threading_pr threads: 6" 'RAYON_NUM_THREADS=6 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 6
  Time (mean ± σ):     10.644 s ±  0.242 s    [User: 39.016 s, System: 0.991 s]
  Range (min … max):   10.473 s … 10.815 s    2 runs

Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.756 s ±  0.068 s    [User: 38.982 s, System: 0.999 s]
  Range (min … max):   10.708 s … 10.805 s    2 runs

Summary
  'hyper_threading_main threads: 6' ran
    1.01 ± 0.02 times faster than 'hyper_threading_pr threads: 6'

hyperfine -r 2 -n "hyper_threading_main threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_main' -n "hyper_threading_pr threads: 8" 'RAYON_NUM_THREADS=8 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 8
  Time (mean ± σ):     10.578 s ±  0.025 s    [User: 39.347 s, System: 1.005 s]
  Range (min … max):   10.560 s … 10.595 s    2 runs

Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.758 s ±  0.045 s    [User: 39.253 s, System: 0.956 s]
  Range (min … max):   10.726 s … 10.789 s    2 runs

Summary
  'hyper_threading_main threads: 8' ran
    1.02 ± 0.00 times faster than 'hyper_threading_pr threads: 8'

hyperfine -r 2 -n "hyper_threading_main threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_main' -n "hyper_threading_pr threads: 16" 'RAYON_NUM_THREADS=16 ./hyper_threading_pr'
Benchmark 1: hyper_threading_main threads: 16
  Time (mean ± σ):     10.454 s ±  0.014 s    [User: 39.916 s, System: 1.053 s]
  Range (min … max):   10.444 s … 10.464 s    2 runs

Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.731 s ±  0.040 s    [User: 39.403 s, System: 1.070 s]
  Range (min … max):   10.702 s … 10.759 s    2 runs

Summary
  'hyper_threading_main threads: 16' ran
    1.03 ± 0.00 times faster than 'hyper_threading_pr threads: 16'
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.76%. Comparing base (258dd84) to head (3614442).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1752 +/- ## ======================================= Coverage 94.76% 94.76% ======================================= Files 101 101 Lines 38804 38804 ======================================= Hits 36773 36773 Misses 2031 2031 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 1 month ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.069 ± 0.032 2.038 2.130 1.01 ± 0.02
head big_factorial 2.049 ± 0.009 2.041 2.069 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.987 ± 0.018 1.966 2.018 1.00
head big_fibonacci 2.013 ± 0.019 1.984 2.056 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.635 ± 0.057 7.497 7.709 1.00
head blake2s_integration_benchmark 7.660 ± 0.172 7.492 8.098 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.104 ± 0.018 2.085 2.138 1.00
head compare_arrays_200000 2.134 ± 0.026 2.100 2.194 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.415 ± 0.017 1.405 1.461 1.00
head dict_integration_benchmark 1.415 ± 0.016 1.405 1.461 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.304 ± 0.029 1.280 1.362 1.01 ± 0.02
head field_arithmetic_get_square_benchmark 1.297 ± 0.010 1.279 1.317 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.707 ± 0.271 7.492 8.343 1.01 ± 0.04
head integration_builtins 7.627 ± 0.059 7.513 7.684 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.871 ± 0.149 7.717 8.241 1.00 ± 0.02
head keccak_integration_benchmark 7.839 ± 0.110 7.728 8.045 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.101 ± 0.027 2.073 2.148 1.00
head linear_search 2.111 ± 0.061 2.065 2.275 1.00 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.695 ± 0.034 1.670 1.788 1.01 ± 0.02
head math_cmp_and_pow_integration_benchmark 1.685 ± 0.007 1.679 1.699 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.590 ± 0.005 1.584 1.603 1.00
head math_integration_benchmark 1.592 ± 0.007 1.585 1.605 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.189 ± 0.011 1.183 1.218 1.00
head memory_integration_benchmark 1.200 ± 0.021 1.186 1.253 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.807 ± 0.011 1.791 1.828 1.00
head operations_with_data_structures_benchmarks 1.811 ± 0.018 1.790 1.850 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 513.3 ± 2.5 510.7 516.6 1.00
head pedersen 514.7 ± 4.7 510.5 527.5 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 952.1 ± 4.5 948.8 961.8 1.00 ± 0.01
head poseidon_integration_benchmark 947.8 ± 3.2 942.2 952.8 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.849 ± 0.005 1.840 1.856 1.00
head secp_integration_benchmark 1.855 ± 0.010 1.844 1.877 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 640.3 ± 6.8 634.3 654.7 1.00
head set_integration_benchmark 645.8 ± 17.7 635.6 693.1 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.230 ± 0.107 4.122 4.494 1.00
head uint256_integration_benchmark 4.240 ± 0.063 4.170 4.362 1.00 ± 0.03