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

Cairo-lang2.8.0 #1833

Merged
merged 15 commits into from
Sep 10, 2024
Merged

Cairo-lang2.8.0 #1833

merged 15 commits into from
Sep 10, 2024

Conversation

FrancoGiachetta
Copy link
Contributor

@FrancoGiachetta FrancoGiachetta commented Sep 3, 2024

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

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.
  • This change requires new documentation.
    • Documentation has been added/updated.
    • CHANGELOG has been updated.

Copy link

github-actions bot commented Sep 3, 2024

**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'


Copy link

github-actions bot commented Sep 3, 2024

Benchmark Results for unmodified programs 🚀

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

Copy link

codecov bot commented Sep 3, 2024

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 ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -215,7 +215,7 @@ mod tests {
assert_matches::assert_matches,
};

#[cfg(any(target_arch = "wasm32", no_std, not(feature = "std")))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it is not a valid attribute for #[cfg(...)] in rust 1.80.0

vm/src/tests/cairo_pie_test.rs Show resolved Hide resolved
vm/src/vm/runners/cairo_pie.rs Show resolved Hide resolved
Copy link
Member

@pefontana pefontana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @FrancoGiachetta !
Can you update the readme Doc
- [Rust 1.76.0 or newer](https://www.rust-lang.org/tools/install)
I think that with that we could merge it

@FrancoGiachetta
Copy link
Contributor Author

Done!

@pefontana pefontana added this pull request to the merge queue Sep 10, 2024
Merged via the queue into main with commit 1f1190b Sep 10, 2024
71 of 72 checks passed
@pefontana pefontana deleted the cairo-lang2.8.0 branch September 10, 2024 20:53
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.

3 participants