Skip to content

Replace cairo programs in libfuncs/ #1038

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

Closed
wants to merge 39 commits into from
Closed

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.45945% with 34 lines in your changes missing coverage. Please review.

Project coverage is 86.14%. Comparing base (3f74466) to head (ba69e19).

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.18%     
==========================================
  Files         108      108              
  Lines       29938    40430   +10492     
==========================================
+ Hits        24237    34828   +10591     
+ Misses       5701     5602      -99     

☔ 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.878 ± 0.104 3.777 4.061 1.00
base dict_insert.cairo (AOT) 4.049 ± 0.026 4.007 4.086 1.04 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_insert.cairo (JIT) 3.804 ± 0.022 3.767 3.831 1.00
head dict_insert.cairo (AOT) 3.978 ± 0.023 3.939 4.008 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 3.809 ± 0.044 3.762 3.896 1.00
base dict_snapshot.cairo (AOT) 4.003 ± 0.042 3.941 4.088 1.05 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_snapshot.cairo (JIT) 3.716 ± 0.041 3.665 3.790 1.00
head dict_snapshot.cairo (AOT) 3.836 ± 0.020 3.807 3.873 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.179 ± 0.075 4.086 4.309 1.00
base factorial_2M.cairo (AOT) 4.296 ± 0.028 4.260 4.349 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 4.035 ± 0.014 4.012 4.058 1.00
head factorial_2M.cairo (AOT) 4.265 ± 0.026 4.234 4.326 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.697 ± 0.060 3.602 3.811 1.00
base fib_2M.cairo (AOT) 3.848 ± 0.026 3.810 3.884 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 3.588 ± 0.021 3.564 3.614 1.00
head fib_2M.cairo (AOT) 3.805 ± 0.020 3.781 3.833 1.06 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.791 ± 0.028 3.764 3.858 1.00
base linear_search.cairo (AOT) 3.959 ± 0.041 3.890 4.029 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head linear_search.cairo (JIT) 3.764 ± 0.015 3.745 3.789 1.00
head linear_search.cairo (AOT) 3.886 ± 0.015 3.869 3.919 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.905 ± 0.040 3.838 3.969 1.00
base logistic_map.cairo (AOT) 4.060 ± 0.055 3.996 4.197 1.04 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.890 ± 0.023 3.850 3.925 1.00
head logistic_map.cairo (AOT) 3.955 ± 0.018 3.924 3.982 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.497 ± 0.201 21.163 21.769 98.08 ± 3.07
cairo-native (embedded AOT) 4.125 ± 0.051 4.062 4.237 18.82 ± 0.61
cairo-native (embedded JIT using LLVM's ORC Engine) 3.905 ± 0.047 3.845 4.010 17.82 ± 0.57
cairo-native (standalone AOT with -march=native) 0.219 ± 0.007 0.205 0.230 1.00

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.990 ± 0.071 5.842 6.069 3028.49 ± 96.28
cairo-native (embedded AOT) 4.034 ± 0.035 3.981 4.096 2039.57 ± 62.66
cairo-native (embedded JIT using LLVM's ORC Engine) 3.844 ± 0.053 3.764 3.925 1943.54 ± 63.24
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) 15.103 ± 0.135 14.868 15.288 11.14 ± 0.10
cairo-native (embedded AOT) 4.341 ± 0.051 4.266 4.408 3.20 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 4.099 ± 0.043 4.064 4.187 3.02 ± 0.03
cairo-native (standalone AOT with -march=native) 1.356 ± 0.003 1.354 1.363 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 15.107 ± 0.168 14.872 15.290 187.26 ± 2.28
cairo-native (embedded AOT) 3.882 ± 0.040 3.810 3.956 48.11 ± 0.55
cairo-native (embedded JIT using LLVM's ORC Engine) 3.703 ± 0.055 3.631 3.790 45.90 ± 0.72
cairo-native (standalone AOT with -march=native) 0.081 ± 0.000 0.080 0.083 1.00

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.948 ± 0.059 5.867 6.058 2919.79 ± 86.77
cairo-native (embedded AOT) 4.037 ± 0.083 3.941 4.178 1981.81 ± 68.85
cairo-native (embedded JIT using LLVM's ORC Engine) 3.841 ± 0.063 3.746 3.948 1885.74 ± 61.35
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.799 ± 0.058 5.724 5.881 23.90 ± 0.24
cairo-native (embedded AOT) 4.332 ± 0.140 4.094 4.534 17.85 ± 0.58
cairo-native (embedded JIT using LLVM's ORC Engine) 4.065 ± 0.138 3.928 4.394 16.75 ± 0.57
cairo-native (standalone AOT with -march=native) 0.243 ± 0.000 0.242 0.244 1.00

@igaray
Copy link
Collaborator

igaray commented Feb 6, 2025

Superceded by #1050

@igaray igaray closed this Feb 6, 2025
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