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
522 stars 150 forks source link

Cairo-lang2.8.0 #1833

Closed FrancoGiachetta closed 2 months ago

FrancoGiachetta commented 2 months ago

Update cairo-lang to 2.8.0

Description

This PR updates cairo-lang creates to 2.8.0. It also updates rust to version 1.80.0 since now cairo-lang uses the lazy-cell library, which was stabilized at that version. It also removes some features used before alloc and std, which seem to be deprecated in rust 1.80.0

Checklist

github-actions[bot] commented 2 months 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 ± σ):     25.279 s ±  0.054 s    [User: 24.434 s, System: 0.843 s]
  Range (min … max):   25.241 s … 25.318 s    2 runs

Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     30.010 s ±  0.062 s    [User: 29.279 s, System: 0.729 s]
  Range (min … max):   29.966 s … 30.054 s    2 runs

Summary
  'hyper_threading_main threads: 1' ran
    1.19 ± 0.00 times faster than 'hyper_threading_pr 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.088 s ±  0.016 s    [User: 25.566 s, System: 0.797 s]
  Range (min … max):   14.077 s … 14.099 s    2 runs

Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     16.655 s ±  0.009 s    [User: 29.421 s, System: 0.736 s]
  Range (min … max):   16.648 s … 16.661 s    2 runs

Summary
  'hyper_threading_main threads: 2' ran
    1.18 ± 0.00 times faster than 'hyper_threading_pr 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.408 s ±  0.115 s    [User: 38.065 s, System: 0.948 s]
  Range (min … max):   10.327 s … 10.489 s    2 runs

Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     11.959 s ±  0.176 s    [User: 40.736 s, System: 0.971 s]
  Range (min … max):   11.834 s … 12.083 s    2 runs

Summary
  'hyper_threading_main threads: 4' ran
    1.15 ± 0.02 times faster than 'hyper_threading_pr 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.659 s ±  0.043 s    [User: 37.811 s, System: 0.941 s]
  Range (min … max):   10.629 s … 10.690 s    2 runs

Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     11.059 s ±  0.305 s    [User: 41.401 s, System: 0.887 s]
  Range (min … max):   10.843 s … 11.274 s    2 runs

Summary
  'hyper_threading_main threads: 6' ran
    1.04 ± 0.03 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.421 s ±  0.160 s    [User: 38.245 s, System: 0.972 s]
  Range (min … max):   10.308 s … 10.535 s    2 runs

Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     11.337 s ±  0.105 s    [User: 41.288 s, System: 1.032 s]
  Range (min … max):   11.263 s … 11.411 s    2 runs

Summary
  'hyper_threading_main threads: 8' ran
    1.09 ± 0.02 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.259 s ±  0.127 s    [User: 38.885 s, System: 1.000 s]
  Range (min … max):   10.169 s … 10.349 s    2 runs

Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     11.327 s ±  0.091 s    [User: 41.473 s, System: 0.956 s]
  Range (min … max):   11.262 s … 11.391 s    2 runs

Summary
  'hyper_threading_main threads: 16' ran
    1.10 ± 0.02 times faster than 'hyper_threading_pr threads: 16'
github-actions[bot] commented 2 months ago

Benchmark Results for unmodified programs :rocket:

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.024 ± 0.060 1.970 2.128 1.00
head big_factorial 2.405 ± 0.030 2.378 2.471 1.19 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.943 ± 0.015 1.920 1.961 1.00
head big_fibonacci 2.331 ± 0.018 2.306 2.360 1.20 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.366 ± 0.260 7.204 8.076 1.00
head blake2s_integration_benchmark 8.725 ± 0.127 8.553 8.837 1.18 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.065 ± 0.016 2.041 2.084 1.00
head compare_arrays_200000 2.475 ± 0.045 2.442 2.592 1.20 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.379 ± 0.012 1.366 1.405 1.00
head dict_integration_benchmark 1.626 ± 0.015 1.616 1.663 1.18 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.188 ± 0.026 1.152 1.229 1.00
head field_arithmetic_get_square_benchmark 1.382 ± 0.033 1.345 1.439 1.16 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.420 ± 0.065 7.328 7.551 1.00
head integration_builtins 8.761 ± 0.180 8.519 9.010 1.18 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.756 ± 0.300 7.539 8.594 1.00
head keccak_integration_benchmark 9.052 ± 0.285 8.778 9.758 1.17 ± 0.06
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.106 ± 0.067 2.055 2.288 1.00
head linear_search 2.500 ± 0.026 2.469 2.551 1.19 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.461 ± 0.008 1.447 1.472 1.00
head math_cmp_and_pow_integration_benchmark 1.715 ± 0.046 1.696 1.845 1.17 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.415 ± 0.038 1.387 1.516 1.00
head math_integration_benchmark 1.671 ± 0.017 1.658 1.716 1.18 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.160 ± 0.010 1.150 1.179 1.00
head memory_integration_benchmark 1.388 ± 0.005 1.377 1.396 1.20 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.516 ± 0.027 1.494 1.592 1.00
head operations_with_data_structures_benchmarks 1.769 ± 0.018 1.751 1.805 1.17 ± 0.02
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 511.7 ± 2.2 509.1 514.8 1.00
head pedersen 571.0 ± 3.5 567.8 580.4 1.12 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 737.2 ± 9.7 717.5 752.8 1.07 ± 0.02
head poseidon_integration_benchmark 689.4 ± 6.7 685.2 708.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.796 ± 0.017 1.774 1.821 1.00
head secp_integration_benchmark 1.983 ± 0.007 1.973 1.994 1.10 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 623.8 ± 5.5 616.5 633.4 1.00
head set_integration_benchmark 680.9 ± 8.0 673.7 700.2 1.09 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.105 ± 0.119 4.005 4.416 1.00
head uint256_integration_benchmark 4.784 ± 0.068 4.702 4.914 1.17 ± 0.04
codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.83%. Comparing base (ed31170) to head (f77c7e6). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cairo-vm-tracer/src/tracer_data.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1833 +/- ## ========================================== - Coverage 94.89% 94.83% -0.06% ========================================== Files 102 101 -1 Lines 40305 39579 -726 ========================================== - Hits 38247 37536 -711 + Misses 2058 2043 -15 ```

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

FrancoGiachetta commented 2 months ago

Done!