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

Replace cairo programs in libfuncs/ #1038

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

FrancoGiachetta
Copy link
Contributor

@FrancoGiachetta FrancoGiachetta commented Jan 9, 2025

Related to: #1035

Checklist

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

Copy link

github-actions bot commented Jan 9, 2025

✅ Code is now correctly formatted.

@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

Codecov Report

Attention: Patch coverage is 98.48146% with 34 lines in your changes missing coverage. Please review.

Project coverage is 86.14%. Comparing base (45a4eaa) to head (c17c32f).

Files with missing lines Patch % Lines
src/libfuncs/ec.rs 93.71% 10 Missing ⚠️
src/libfuncs/felt252.rs 62.50% 6 Missing ⚠️
src/libfuncs/starknet.rs 96.00% 6 Missing ⚠️
src/libfuncs/uint256.rs 87.50% 4 Missing ⚠️
src/libfuncs/enum.rs 88.00% 3 Missing ⚠️
src/libfuncs/cast.rs 85.71% 2 Missing ⚠️
src/libfuncs/bytes31.rs 91.66% 1 Missing ⚠️
src/libfuncs/int_range.rs 83.33% 1 Missing ⚠️
src/libfuncs/uint512.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1038      +/-   ##
==========================================
+ Coverage   80.95%   86.14%   +5.19%     
==========================================
  Files         108      108              
  Lines       29938    40458   +10520     
==========================================
+ Hits        24237    34854   +10617     
+ Misses       5701     5604      -97     

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

Copy link

github-actions bot commented Jan 9, 2025

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 3.893 ± 0.026 3.865 3.940 1.00
base dict_insert.cairo (AOT) 4.050 ± 0.026 4.012 4.094 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_insert.cairo (JIT) 3.894 ± 0.023 3.856 3.925 1.00
head dict_insert.cairo (AOT) 4.053 ± 0.018 4.035 4.096 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 3.745 ± 0.022 3.715 3.782 1.00
base dict_snapshot.cairo (AOT) 3.889 ± 0.029 3.859 3.951 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_snapshot.cairo (JIT) 3.763 ± 0.028 3.726 3.817 1.00
head dict_snapshot.cairo (AOT) 3.912 ± 0.021 3.869 3.942 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.095 ± 0.037 4.057 4.194 1.00
base factorial_2M.cairo (AOT) 4.317 ± 0.033 4.278 4.364 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 4.140 ± 0.022 4.103 4.165 1.00
head factorial_2M.cairo (AOT) 4.340 ± 0.042 4.280 4.433 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.623 ± 0.014 3.602 3.643 1.00
base fib_2M.cairo (AOT) 3.836 ± 0.028 3.801 3.886 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 3.664 ± 0.037 3.596 3.720 1.00
head fib_2M.cairo (AOT) 3.897 ± 0.020 3.865 3.927 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.797 ± 0.027 3.724 3.816 1.00
base linear_search.cairo (AOT) 3.952 ± 0.021 3.928 3.983 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head linear_search.cairo (JIT) 3.860 ± 0.038 3.808 3.940 1.00
head linear_search.cairo (AOT) 3.998 ± 0.041 3.923 4.066 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.900 ± 0.015 3.881 3.924 1.00
base logistic_map.cairo (AOT) 4.006 ± 0.021 3.969 4.043 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.953 ± 0.024 3.927 3.992 1.00
head logistic_map.cairo (AOT) 4.023 ± 0.023 3.990 4.070 1.02 ± 0.01

Copy link

github-actions bot commented Jan 9, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 21.321 ± 0.157 21.138 21.677 107.52 ± 2.00
cairo-native (embedded AOT) 3.984 ± 0.049 3.934 4.061 20.09 ± 0.42
cairo-native (embedded JIT using LLVM's ORC Engine) 3.832 ± 0.045 3.763 3.905 19.32 ± 0.40
cairo-native (standalone AOT with -march=native) 0.198 ± 0.003 0.191 0.204 1.00

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.763 ± 0.038 5.693 5.838 2989.95 ± 75.81
cairo-native (embedded AOT) 3.822 ± 0.037 3.780 3.900 1983.14 ± 52.19
cairo-native (embedded JIT using LLVM's ORC Engine) 3.678 ± 0.027 3.646 3.725 1908.14 ± 48.79
cairo-native (standalone AOT with -march=native) 0.002 ± 0.000 0.002 0.003 1.00

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.945 ± 0.084 14.856 15.113 11.02 ± 0.06
cairo-native (embedded AOT) 4.257 ± 0.019 4.228 4.287 3.14 ± 0.01
cairo-native (embedded JIT using LLVM's ORC Engine) 4.059 ± 0.018 4.031 4.098 2.99 ± 0.01
cairo-native (standalone AOT with -march=native) 1.356 ± 0.001 1.354 1.357 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 15.007 ± 0.063 14.937 15.117 187.66 ± 0.89
cairo-native (embedded AOT) 3.777 ± 0.032 3.738 3.849 47.23 ± 0.41
cairo-native (embedded JIT using LLVM's ORC Engine) 3.594 ± 0.055 3.523 3.670 44.94 ± 0.69
cairo-native (standalone AOT with -march=native) 0.080 ± 0.000 0.080 0.080 1.00

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.740 ± 0.044 5.678 5.794 2827.71 ± 98.10
cairo-native (embedded AOT) 3.826 ± 0.028 3.787 3.886 1885.06 ± 65.24
cairo-native (embedded JIT using LLVM's ORC Engine) 3.732 ± 0.030 3.696 3.806 1838.41 ± 63.97
cairo-native (standalone AOT with -march=native) 0.002 ± 0.000 0.002 0.003 1.00

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.657 ± 0.056 5.596 5.775 23.38 ± 0.23
cairo-native (embedded AOT) 3.907 ± 0.018 3.878 3.934 16.15 ± 0.08
cairo-native (embedded JIT using LLVM's ORC Engine) 3.844 ± 0.018 3.826 3.888 15.89 ± 0.08
cairo-native (standalone AOT with -march=native) 0.242 ± 0.000 0.242 0.242 1.00

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.

2 participants