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

Sort_ecdsa_and_mod_builtins_private_inputs_by_idx #1851

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

YairVaknin-starkware
Copy link
Collaborator

TITLE

Sort_ecdsa_and_mod_builtins_private_inputs_by_idx

Description

Making sure to sort the resulted list of those builtins in the air_private_input_file by index, so it is aligned with the python vm's outputs.

Description of the pull request changes and motivation.

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.

Copy link

github-actions bot commented Oct 14, 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 ± σ):     29.913 s ±  0.052 s    [User: 29.157 s, System: 0.754 s]
  Range (min … max):   29.876 s … 29.949 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     29.119 s ±  0.065 s    [User: 28.374 s, System: 0.743 s]
  Range (min … max):   29.073 s … 29.165 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.03 ± 0.00 times faster than hyper_threading_main 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 ± σ):     16.687 s ±  0.011 s    [User: 29.177 s, System: 0.815 s]
  Range (min … max):   16.679 s … 16.695 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     16.256 s ±  0.043 s    [User: 28.445 s, System: 0.793 s]
  Range (min … max):   16.225 s … 16.286 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.03 ± 0.00 times faster than hyper_threading_main 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 ± σ):     11.917 s ±  0.496 s    [User: 41.422 s, System: 0.965 s]
  Range (min … max):   11.566 s … 12.268 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     11.425 s ±  0.284 s    [User: 40.617 s, System: 0.994 s]
  Range (min … max):   11.224 s … 11.625 s    2 runs
 
Summary
  hyper_threading_pr threads: 4 ran
    1.04 ± 0.05 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 ± σ):     12.071 s ±  0.044 s    [User: 42.044 s, System: 1.022 s]
  Range (min … max):   12.040 s … 12.102 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     11.470 s ±  0.228 s    [User: 41.115 s, System: 1.015 s]
  Range (min … max):   11.309 s … 11.632 s    2 runs
 
Summary
  hyper_threading_pr threads: 6 ran
    1.05 ± 0.02 times faster than hyper_threading_main 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 ± σ):     11.608 s ±  0.094 s    [User: 42.595 s, System: 1.080 s]
  Range (min … max):   11.542 s … 11.674 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     11.270 s ±  0.175 s    [User: 41.381 s, System: 1.042 s]
  Range (min … max):   11.146 s … 11.393 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.03 ± 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 ± σ):     11.620 s ±  0.058 s    [User: 43.390 s, System: 1.110 s]
  Range (min … max):   11.579 s … 11.661 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     11.385 s ±  0.105 s    [User: 41.692 s, System: 1.100 s]
  Range (min … max):   11.311 s … 11.459 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.02 ± 0.01 times faster than hyper_threading_main threads: 16


Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.32%. Comparing base (3fb0344) to head (09fa5d8).

Files with missing lines Patch % Lines
vm/src/vm/runners/builtin_runner/signature.rs 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1851      +/-   ##
==========================================
- Coverage   96.32%   96.32%   -0.01%     
==========================================
  Files         102      102              
  Lines       40381    40387       +6     
==========================================
+ Hits        38899    38903       +4     
- Misses       1482     1484       +2     

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

Copy link

github-actions bot commented Oct 14, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.406 ± 0.017 2.390 2.446 1.01 ± 0.03
head big_factorial 2.374 ± 0.076 2.315 2.558 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.346 ± 0.025 2.325 2.406 1.01 ± 0.04
head big_fibonacci 2.316 ± 0.084 2.252 2.517 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.847 ± 0.283 8.442 9.384 1.09 ± 0.04
head blake2s_integration_benchmark 8.101 ± 0.117 7.980 8.245 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.484 ± 0.026 2.450 2.543 1.04 ± 0.02
head compare_arrays_200000 2.393 ± 0.027 2.357 2.427 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.644 ± 0.008 1.633 1.655 1.01 ± 0.01
head dict_integration_benchmark 1.627 ± 0.019 1.611 1.674 1.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.395 ± 0.042 1.354 1.493 1.04 ± 0.05
head field_arithmetic_get_square_benchmark 1.338 ± 0.051 1.300 1.466 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.743 ± 0.166 8.531 9.014 1.06 ± 0.02
head integration_builtins 8.265 ± 0.109 8.080 8.386 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.942 ± 0.143 8.722 9.185 1.05 ± 0.02
head keccak_integration_benchmark 8.508 ± 0.136 8.273 8.753 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.496 ± 0.051 2.458 2.630 1.03 ± 0.03
head linear_search 2.422 ± 0.036 2.375 2.501 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.719 ± 0.015 1.706 1.759 1.02 ± 0.01
head math_cmp_and_pow_integration_benchmark 1.688 ± 0.014 1.669 1.712 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.671 ± 0.006 1.660 1.681 1.01 ± 0.01
head math_integration_benchmark 1.647 ± 0.015 1.628 1.667 1.00
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.434 ± 0.055 1.398 1.569 1.05 ± 0.04
head memory_integration_benchmark 1.369 ± 0.013 1.350 1.383 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.771 ± 0.006 1.766 1.783 1.01 ± 0.01
head operations_with_data_structures_benchmarks 1.762 ± 0.022 1.741 1.804 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 574.6 ± 4.2 570.4 584.5 1.01 ± 0.01
head pedersen 567.5 ± 3.7 562.4 571.7 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 674.5 ± 5.4 667.8 687.1 1.01 ± 0.01
head poseidon_integration_benchmark 665.6 ± 4.6 660.0 676.0 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.030 ± 0.054 1.972 2.147 1.06 ± 0.03
head secp_integration_benchmark 1.922 ± 0.023 1.897 1.970 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 704.0 ± 8.2 697.6 724.9 1.04 ± 0.01
head set_integration_benchmark 677.3 ± 5.7 668.3 686.4 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.894 ± 0.126 4.762 5.210 1.05 ± 0.03
head uint256_integration_benchmark 4.642 ± 0.050 4.559 4.708 1.00

Copy link
Member

@pefontana pefontana Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YairVaknin-starkware Can you restore these format changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@YairVaknin-starkware YairVaknin-starkware force-pushed the yairv/sort_ecdsa_and_mod_builtins_private_inputs_by_idx branch from 405878d to 09fa5d8 Compare October 14, 2024 20:03
Copy link
Member

@pefontana pefontana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great @YairVaknin-starkware !
Is there a possibility to add a test? I don't know what these changes are for
If we could add an integration test, if not a unit test, it would be good

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.

2 participants