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 dynamic params as null by default on air public input #1716

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Apr 16, 2024

Closes #1649
dynamic_params are always set to null on the cairo_lang implementation, even if these were to be added in the future, the structure of these params is different to that of CairoLayout, so it doesn't make much sense to keep serializing this struct.
This PR removes the CairoLayout type from the dynamic_params field of AirPublicInput, replacing it with a () type that serializes as null.
This also removes the lifetime from dynamic_params, allowing us to use a representation that is not tied to a lifetime in the layout field (Such as the enum added by #1715)

@fmoletta fmoletta marked this pull request as ready for review April 16, 2024 15:11
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.81%. Comparing base (a462d8d) to head (dce5188).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1716   +/-   ##
=======================================
  Coverage   94.80%   94.81%           
=======================================
  Files         100      100           
  Lines       38214    38207    -7     
=======================================
- Hits        36228    36225    -3     
+ Misses       1986     1982    -4     

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

Copy link

github-actions bot commented Apr 16, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 1.933 ± 0.040 1.897 2.021 1.00 ± 0.03
head big_factorial 1.931 ± 0.028 1.903 1.981 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 1.858 ± 0.030 1.823 1.923 1.00
head big_fibonacci 1.874 ± 0.067 1.828 2.045 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 6.501 ± 0.146 6.365 6.816 1.00 ± 0.02
head blake2s_integration_benchmark 6.475 ± 0.061 6.351 6.559 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 1.926 ± 0.051 1.879 2.044 1.00
head compare_arrays_200000 1.945 ± 0.044 1.899 2.056 1.01 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.314 ± 0.016 1.302 1.349 1.00
head dict_integration_benchmark 1.315 ± 0.012 1.299 1.334 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.162 ± 0.013 1.149 1.188 1.01 ± 0.01
head field_arithmetic_get_square_benchmark 1.149 ± 0.007 1.140 1.159 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 6.505 ± 0.081 6.428 6.686 1.00
head integration_builtins 6.540 ± 0.094 6.447 6.693 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 6.891 ± 0.242 6.635 7.377 1.02 ± 0.04
head keccak_integration_benchmark 6.724 ± 0.081 6.636 6.887 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 1.998 ± 0.064 1.942 2.153 1.02 ± 0.03
head linear_search 1.957 ± 0.015 1.934 1.983 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.694 ± 0.018 1.666 1.717 1.00
head math_cmp_and_pow_integration_benchmark 1.695 ± 0.018 1.668 1.732 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.481 ± 0.036 1.445 1.570 1.00 ± 0.03
head math_integration_benchmark 1.480 ± 0.028 1.458 1.553 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.155 ± 0.024 1.130 1.205 1.01 ± 0.03
head memory_integration_benchmark 1.144 ± 0.021 1.121 1.193 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.783 ± 0.019 1.761 1.833 1.00
head operations_with_data_structures_benchmarks 1.791 ± 0.041 1.759 1.873 1.00 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 513.9 ± 8.6 504.0 534.9 1.01 ± 0.02
head pedersen 508.8 ± 3.0 503.6 513.9 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 970.1 ± 22.2 948.4 1026.4 1.01 ± 0.02
head poseidon_integration_benchmark 962.5 ± 4.6 955.6 968.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.758 ± 0.030 1.734 1.822 1.01 ± 0.02
head secp_integration_benchmark 1.743 ± 0.015 1.724 1.774 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 719.2 ± 5.0 709.5 725.6 1.03 ± 0.01
head set_integration_benchmark 697.0 ± 8.6 688.8 719.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.820 ± 0.083 3.716 3.947 1.00 ± 0.02
head uint256_integration_benchmark 3.801 ± 0.037 3.740 3.839 1.00

Copy link

github-actions bot commented Apr 18, 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 ± σ):     23.680 s ±  0.083 s    [User: 22.979 s, System: 0.699 s]
  Range (min … max):   23.621 s … 23.739 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     23.775 s ±  0.014 s    [User: 23.004 s, System: 0.770 s]
  Range (min … max):   23.765 s … 23.785 s    2 runs
 
Summary
  'hyper_threading_main threads: 1' ran
    1.00 ± 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 ± σ):     12.323 s ±  0.106 s    [User: 23.254 s, System: 0.701 s]
  Range (min … max):   12.248 s … 12.398 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     12.353 s ±  0.021 s    [User: 23.426 s, System: 0.755 s]
  Range (min … max):   12.338 s … 12.368 s    2 runs
 
Summary
  'hyper_threading_main threads: 2' ran
    1.00 ± 0.01 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.065 s ±  0.295 s    [User: 35.026 s, System: 0.899 s]
  Range (min … max):    9.856 s … 10.273 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):      9.806 s ±  0.121 s    [User: 34.933 s, System: 0.901 s]
  Range (min … max):    9.720 s …  9.892 s    2 runs
 
Summary
  'hyper_threading_pr threads: 4' ran
    1.03 ± 0.03 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 ± σ):      9.590 s ±  0.153 s    [User: 35.311 s, System: 0.985 s]
  Range (min … max):    9.482 s …  9.698 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):      9.732 s ±  0.134 s    [User: 34.979 s, System: 0.966 s]
  Range (min … max):    9.637 s …  9.826 s    2 runs
 
Summary
  'hyper_threading_main threads: 6' ran
    1.01 ± 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 ± σ):      9.667 s ±  0.109 s    [User: 35.332 s, System: 0.970 s]
  Range (min … max):    9.590 s …  9.744 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):      9.647 s ±  0.150 s    [User: 35.075 s, System: 1.001 s]
  Range (min … max):    9.541 s …  9.753 s    2 runs
 
Summary
  'hyper_threading_pr threads: 8' ran
    1.00 ± 0.02 times faster than 'hyper_threading_main 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 ± σ):      9.474 s ±  0.042 s    [User: 35.892 s, System: 1.077 s]
  Range (min … max):    9.444 s …  9.503 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):      9.478 s ±  0.192 s    [User: 35.488 s, System: 1.084 s]
  Range (min … max):    9.342 s …  9.614 s    2 runs
 
Summary
  'hyper_threading_main threads: 16' ran
    1.00 ± 0.02 times faster than 'hyper_threading_pr threads: 16'


@fmoletta fmoletta added this pull request to the merge queue Apr 22, 2024
Merged via the queue into main with commit 7eff520 Apr 22, 2024
71 checks passed
@fmoletta fmoletta deleted the dynamic-params-always-null branch April 22, 2024 17:59
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.

Check if we should skip dynamic layout params when generating air public inputs
3 participants