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

Set Runtime as artifact dependency #985

Closed
wants to merge 48 commits into from

Conversation

gabrielbosio
Copy link
Collaborator

@gabrielbosio gabrielbosio commented Dec 23, 2024

To build Native run cargo build -Z bindeps.

This only works with Rust nightly.

Copy link

github-actions bot commented Dec 23, 2024

✅ Code is now correctly formatted.

@FrancoGiachetta
Copy link
Contributor

FrancoGiachetta commented Jan 2, 2025

Little more info about the PR:

  1. It replaces the way we link the runtime. Now there's no need to have an env var pointing to wherever the runtime library was built. And there's no need to build it separately.
  2. Adapts some workflows to avoid building the runtime 2 times.
  3. Uses cargo nightly for the ci to pass.
  4. It adds a .cargo/config.toml to make bindeps default.

Depends on lambdaclass/starknet-replay#111

Copy link

github-actions bot commented Jan 2, 2025

Benchmark results Main vs HEAD.

Command Mean [s] Min [s] Max [s] Relative
base dict_insert.cairo (JIT) 3.916 ± 0.055 3.851 4.047 1.00
base dict_insert.cairo (AOT) 4.029 ± 0.013 4.000 4.048 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_insert.cairo (JIT) 4.182 ± 0.053 4.116 4.277 1.02 ± 0.02
head dict_insert.cairo (AOT) 4.090 ± 0.074 3.989 4.221 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_snapshot.cairo (JIT) 4.069 ± 0.019 4.040 4.107 1.00
base dict_snapshot.cairo (AOT) 4.199 ± 0.018 4.177 4.226 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head dict_snapshot.cairo (JIT) 4.159 ± 0.072 4.066 4.272 1.00
head dict_snapshot.cairo (AOT) 4.226 ± 0.048 4.150 4.326 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base factorial_2M.cairo (JIT) 4.107 ± 0.022 4.090 4.166 1.00
base factorial_2M.cairo (AOT) 4.314 ± 0.036 4.247 4.368 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head factorial_2M.cairo (JIT) 4.215 ± 0.048 4.176 4.302 1.00
head factorial_2M.cairo (AOT) 4.253 ± 0.047 4.213 4.371 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base fib_2M.cairo (JIT) 3.651 ± 0.029 3.622 3.702 1.00
base fib_2M.cairo (AOT) 3.847 ± 0.019 3.819 3.868 1.05 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head fib_2M.cairo (JIT) 3.795 ± 0.067 3.691 3.889 1.02 ± 0.02
head fib_2M.cairo (AOT) 3.732 ± 0.046 3.670 3.801 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search.cairo (JIT) 3.849 ± 0.035 3.792 3.891 1.00
base linear_search.cairo (AOT) 3.955 ± 0.015 3.928 3.974 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head linear_search.cairo (JIT) 3.924 ± 0.044 3.839 3.991 1.01 ± 0.02
head linear_search.cairo (AOT) 3.877 ± 0.041 3.813 3.928 1.00
Command Mean [s] Min [s] Max [s] Relative
base logistic_map.cairo (JIT) 4.011 ± 0.047 3.919 4.060 1.00 ± 0.01
base logistic_map.cairo (AOT) 3.997 ± 0.019 3.964 4.032 1.00
Command Mean [s] Min [s] Max [s] Relative
:--- ---: ---: ---: ---:
head logistic_map.cairo (JIT) 3.958 ± 0.023 3.918 3.989 1.01 ± 0.02
head logistic_map.cairo (AOT) 3.918 ± 0.060 3.854 4.049 1.00

@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2025

Codecov Report

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

Project coverage is 80.76%. Comparing base (8d700c9) to head (f4a6aaa).

Files with missing lines Patch % Lines
src/ffi.rs 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #985      +/-   ##
==========================================
+ Coverage   80.72%   80.76%   +0.03%     
==========================================
  Files         107      107              
  Lines       29268    29242      -26     
==========================================
- Hits        23626    23616      -10     
+ Misses       5642     5626      -16     

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

Copy link

github-actions bot commented Jan 2, 2025

Benchmarking results

Benchmark for program dict_insert

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 21.506 ± 0.163 21.328 21.774 88.61 ± 3.26
cairo-native (embedded AOT) 4.065 ± 0.039 3.997 4.127 16.75 ± 0.62
cairo-native (embedded JIT using LLVM's ORC Engine) 4.050 ± 0.032 3.990 4.088 16.69 ± 0.61
cairo-native (standalone AOT with -march=native) 0.243 ± 0.009 0.225 0.255 1.00

Benchmark for program dict_snapshot

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 6.141 ± 0.076 6.028 6.233 19.04 ± 0.25
cairo-native (embedded AOT) 4.275 ± 0.035 4.218 4.330 13.26 ± 0.12
cairo-native (embedded JIT using LLVM's ORC Engine) 4.409 ± 0.043 4.355 4.486 13.67 ± 0.15
cairo-native (standalone AOT with -march=native) 0.322 ± 0.001 0.320 0.324 1.00

Benchmark for program factorial_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 15.143 ± 0.059 15.055 15.236 11.07 ± 0.07
cairo-native (embedded AOT) 4.268 ± 0.053 4.190 4.361 3.12 ± 0.04
cairo-native (embedded JIT using LLVM's ORC Engine) 4.280 ± 0.064 4.203 4.383 3.13 ± 0.05
cairo-native (standalone AOT with -march=native) 1.368 ± 0.007 1.363 1.385 1.00

Benchmark for program fib_2M

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 15.141 ± 0.118 14.996 15.403 172.95 ± 1.73
cairo-native (embedded AOT) 3.777 ± 0.031 3.719 3.834 43.15 ± 0.45
cairo-native (embedded JIT using LLVM's ORC Engine) 3.717 ± 0.027 3.663 3.760 42.45 ± 0.41
cairo-native (standalone AOT with -march=native) 0.088 ± 0.001 0.087 0.090 1.00

Benchmark for program linear_search

Open benchmarks
Command Mean [s] Min [s] Max [s] Relative
Cairo-vm (Rust, Cairo 1) 6.205 ± 0.052 6.137 6.284 3571.11 ± 184.99
cairo-native (embedded AOT) 4.093 ± 0.038 4.022 4.154 2355.58 ± 122.45
cairo-native (embedded JIT using LLVM's ORC Engine) 4.142 ± 0.043 4.068 4.193 2383.69 ± 124.33
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.832 ± 0.086 5.719 6.006 24.12 ± 0.36
cairo-native (embedded AOT) 3.990 ± 0.094 3.837 4.116 16.50 ± 0.39
cairo-native (embedded JIT using LLVM's ORC Engine) 3.989 ± 0.050 3.926 4.077 16.50 ± 0.21
cairo-native (standalone AOT with -march=native) 0.242 ± 0.000 0.242 0.242 1.00

@gabrielbosio
Copy link
Collaborator Author

#1051 already solves this.

@gabrielbosio gabrielbosio deleted the runtime_artifact_dependency branch January 31, 2025 19:21
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