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

Feat: Impl eval circuit hint #44

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

notlesh
Copy link

@notlesh notlesh commented Sep 9, 2024

Implement eval circuit hint

Description

Implements the missing eval circuit hint.

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.

whichqua and others added 3 commits August 29, 2024 12:03
Problem: we need an implementation of the hints used by the Starknet OS
in the secp syscalls. These hints rely on private primitives in
`cairo-vm` and need to be implemented here.

Solution: this PR adds an implementation of all the hints that require
`cairo-vm` primitives in the `cairo-vm` repository.
Copy link

github-actions bot commented Sep 9, 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 ± σ):     26.324 s ±  0.039 s    [User: 25.528 s, System: 0.794 s]
  Range (min … max):   26.296 s … 26.352 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.626 s ±  0.095 s    [User: 25.821 s, System: 0.803 s]
  Range (min … max):   26.559 s … 26.693 s    2 runs
 
Summary
  'hyper_threading_main threads: 1' ran
    1.01 ± 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.485 s ±  0.012 s    [User: 25.748 s, System: 0.729 s]
  Range (min … max):   14.476 s … 14.494 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     15.114 s ±  0.040 s    [User: 26.388 s, System: 0.812 s]
  Range (min … max):   15.086 s … 15.142 s    2 runs
 
Summary
  'hyper_threading_main threads: 2' ran
    1.04 ± 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.786 s ±  0.037 s    [User: 37.643 s, System: 0.937 s]
  Range (min … max):   10.760 s … 10.813 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.513 s ±  0.365 s    [User: 38.323 s, System: 0.990 s]
  Range (min … max):   10.255 s … 10.771 s    2 runs
 
Summary
  'hyper_threading_pr threads: 4' ran
    1.03 ± 0.04 times faster than 'hyper_threading_main 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.216 s ±  0.155 s    [User: 38.488 s, System: 0.998 s]
  Range (min … max):   10.106 s … 10.325 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.734 s ±  0.166 s    [User: 37.979 s, System: 0.985 s]
  Range (min … max):   10.617 s … 10.852 s    2 runs
 
Summary
  'hyper_threading_main threads: 6' ran
    1.05 ± 0.02 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.347 s ±  0.258 s    [User: 38.392 s, System: 1.025 s]
  Range (min … max):   10.164 s … 10.529 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.400 s ±  0.080 s    [User: 38.455 s, System: 0.982 s]
  Range (min … max):   10.344 s … 10.457 s    2 runs
 
Summary
  'hyper_threading_main threads: 8' ran
    1.01 ± 0.03 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.257 s ±  0.012 s    [User: 38.989 s, System: 1.093 s]
  Range (min … max):   10.248 s … 10.266 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.316 s ±  0.199 s    [User: 38.621 s, System: 1.027 s]
  Range (min … max):   10.176 s … 10.457 s    2 runs
 
Summary
  'hyper_threading_main threads: 16' ran
    1.01 ± 0.02 times faster than 'hyper_threading_pr threads: 16'


Copy link

github-actions bot commented Sep 9, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.047 ± 0.031 2.014 2.085 1.00
head big_factorial 2.085 ± 0.013 2.072 2.107 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.008 ± 0.020 1.988 2.045 1.00
head big_fibonacci 2.021 ± 0.048 1.993 2.154 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.477 ± 0.087 7.361 7.625 1.00
head blake2s_integration_benchmark 7.649 ± 0.056 7.587 7.745 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.147 ± 0.046 2.099 2.260 1.00
head compare_arrays_200000 2.173 ± 0.046 2.138 2.295 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.412 ± 0.011 1.398 1.428 1.00
head dict_integration_benchmark 1.436 ± 0.009 1.423 1.448 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.214 ± 0.018 1.195 1.257 1.00
head field_arithmetic_get_square_benchmark 1.257 ± 0.061 1.225 1.427 1.03 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.727 ± 0.399 7.477 8.844 1.00 ± 0.05
head integration_builtins 7.713 ± 0.051 7.643 7.778 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.872 ± 0.225 7.681 8.456 1.00
head keccak_integration_benchmark 7.913 ± 0.033 7.878 7.974 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.119 ± 0.022 2.091 2.148 1.00
head linear_search 2.156 ± 0.045 2.115 2.236 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.476 ± 0.008 1.468 1.497 1.00
head math_cmp_and_pow_integration_benchmark 1.506 ± 0.009 1.489 1.517 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.437 ± 0.010 1.424 1.458 1.00
head math_integration_benchmark 1.509 ± 0.112 1.437 1.723 1.05 ± 0.08
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.178 ± 0.014 1.169 1.210 1.00
head memory_integration_benchmark 1.196 ± 0.019 1.172 1.243 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.557 ± 0.064 1.525 1.736 1.00
head operations_with_data_structures_benchmarks 1.582 ± 0.037 1.557 1.653 1.02 ± 0.05
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 521.3 ± 3.5 517.1 526.5 1.00
head pedersen 522.8 ± 2.3 519.6 527.2 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 741.3 ± 9.0 732.1 755.9 1.00
head poseidon_integration_benchmark 745.8 ± 6.3 735.9 754.6 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.845 ± 0.062 1.815 2.019 1.03 ± 0.04
head secp_integration_benchmark 1.790 ± 0.009 1.776 1.806 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 640.5 ± 6.6 634.6 653.5 1.01 ± 0.02
head set_integration_benchmark 634.9 ± 7.5 629.4 655.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.195 ± 0.062 4.124 4.339 1.00
head uint256_integration_benchmark 4.312 ± 0.042 4.261 4.395 1.03 ± 0.02

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