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

Adjust circuit usage #1070

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Adjust circuit usage #1070

merged 3 commits into from
Jan 30, 2025

Conversation

edg-l
Copy link
Member

@edg-l edg-l commented Jan 29, 2025

Made it so its like https://github.com/starkware-libs/cairo/blob/v2.10.0-rc.1/crates/cairo-lang-sierra-to-casm/src/invocations/circuit.rs

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 29, 2025

✅ Code is now correctly formatted.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.80%. Comparing base (bcc2a38) to head (9349cb1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1070   +/-   ##
=======================================
  Coverage   80.80%   80.80%           
=======================================
  Files         108      108           
  Lines       29557    29558    +1     
=======================================
+ Hits        23884    23885    +1     
  Misses       5673     5673           

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

Copy link

Benchmark results Main vs HEAD.

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 4.046 ± 0.110 3.866 4.202 1.01 ± 0.03
base dict_insert.cairo (AOT) 4.025 ± 0.077 3.927 4.188 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_insert.cairo (JIT) 3.922 ± 0.041 3.861 3.988 1.02 ± 0.01
head dict_insert.cairo (AOT) 3.843 ± 0.035 3.785 3.903 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 3.859 ± 0.033 3.801 3.899 1.01 ± 0.02
base dict_snapshot.cairo (AOT) 3.816 ± 0.051 3.734 3.894 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head dict_snapshot.cairo (JIT) 3.829 ± 0.071 3.758 3.980 1.02 ± 0.03
head dict_snapshot.cairo (AOT) 3.737 ± 0.067 3.631 3.838 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.193 ± 0.038 4.114 4.225 1.00 ± 0.01
base factorial_2M.cairo (AOT) 4.179 ± 0.032 4.143 4.235 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head factorial_2M.cairo (JIT) 4.181 ± 0.070 4.109 4.316 1.00
head factorial_2M.cairo (AOT) 4.202 ± 0.077 4.109 4.345 1.01 ± 0.02

Base

Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.689 ± 0.046 3.645 3.763 1.02 ± 0.02
base fib_2M.cairo (AOT) 3.625 ± 0.030 3.604 3.698 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head fib_2M.cairo (JIT) 3.782 ± 0.173 3.633 4.112 1.00
head fib_2M.cairo (AOT) 3.950 ± 0.038 3.895 4.007 1.04 ± 0.05

Base

Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.886 ± 0.026 3.856 3.938 1.03 ± 0.01
base linear_search.cairo (AOT) 3.761 ± 0.044 3.654 3.805 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head linear_search.cairo (JIT) 4.191 ± 0.067 4.070 4.296 1.04 ± 0.03
head linear_search.cairo (AOT) 4.030 ± 0.102 3.879 4.181 1.00

Base

Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 3.912 ± 0.031 3.855 3.957 1.04 ± 0.01
base logistic_map.cairo (AOT) 3.764 ± 0.032 3.707 3.811 1.00

Head

Command Mean [s] Min [s] Max [s] Relative
head logistic_map.cairo (JIT) 4.086 ± 0.113 3.940 4.260 1.05 ± 0.04
head logistic_map.cairo (AOT) 3.907 ± 0.083 3.789 4.030 1.00

Copy link

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 20.731 ± 0.136 20.567 21.009 5.49 ± 0.10
cairo-native (embedded AOT) 3.776 ± 0.064 3.706 3.895 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.858 ± 0.038 3.807 3.931 1.02 ± 0.02

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.802 ± 0.030 5.760 5.847 1.60 ± 0.02
cairo-native (embedded AOT) 3.627 ± 0.037 3.571 3.691 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.746 ± 0.037 3.701 3.810 1.03 ± 0.01

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.369 ± 0.050 14.282 14.431 3.55 ± 0.03
cairo-native (embedded AOT) 4.093 ± 0.042 4.055 4.172 1.01 ± 0.01
cairo-native (embedded JIT using LLVM's ORC Engine) 4.051 ± 0.027 4.015 4.094 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 14.259 ± 0.091 14.148 14.386 3.99 ± 0.04
cairo-native (embedded AOT) 3.573 ± 0.024 3.533 3.616 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.584 ± 0.028 3.551 3.635 1.00 ± 0.01

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.838 ± 0.086 5.753 5.978 1.58 ± 0.03
cairo-native (embedded AOT) 3.683 ± 0.025 3.644 3.718 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.765 ± 0.023 3.743 3.816 1.02 ± 0.01

Benchmark for program logistic_map

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 5.715 ± 0.028 5.681 5.761 1.53 ± 0.02
cairo-native (embedded AOT) 3.746 ± 0.037 3.711 3.824 1.00
cairo-native (embedded JIT using LLVM's ORC Engine) 3.883 ± 0.038 3.838 3.951 1.04 ± 0.01

@edg-l edg-l added this pull request to the merge queue Jan 30, 2025
Merged via the queue into main with commit f8a4653 Jan 30, 2025
28 checks passed
@edg-l edg-l deleted the adjust_circuit_usage branch January 30, 2025 16:57
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.

5 participants