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

Fix MemorySegmentManager::add_zero_segment #1818

Merged
merged 10 commits into from
Aug 8, 2024
Merged

Fix MemorySegmentManager::add_zero_segment #1818

merged 10 commits into from
Aug 8, 2024

Conversation

pefontana
Copy link
Member

@pefontana pefontana commented Aug 7, 2024

Fix MemorySegmentManager::add_zero_segment

  • Fix MemorySegmentManager::add_zero_segment function when resizing a segment
  • Signature change: MemorySegmentManager::get_memory_holes now receives builtin_segment_indexes: HashSet<usize>

Description

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 Aug 7, 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.684 s ±  0.074 s    [User: 25.924 s, System: 0.759 s]
  Range (min … max):   26.632 s … 26.737 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.787 s ±  0.073 s    [User: 26.021 s, System: 0.764 s]
  Range (min … max):   26.735 s … 26.838 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 ± σ):     14.855 s ±  0.070 s    [User: 26.313 s, System: 0.788 s]
  Range (min … max):   14.806 s … 14.905 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.733 s ±  0.002 s    [User: 26.253 s, System: 0.800 s]
  Range (min … max):   14.732 s … 14.734 s    2 runs
 
Summary
  'hyper_threading_pr threads: 2' ran
    1.01 ± 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 ± σ):     10.618 s ±  0.211 s    [User: 38.196 s, System: 0.993 s]
  Range (min … max):   10.469 s … 10.768 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.650 s ±  0.183 s    [User: 38.431 s, System: 1.006 s]
  Range (min … max):   10.520 s … 10.780 s    2 runs
 
Summary
  'hyper_threading_main threads: 4' ran
    1.00 ± 0.03 times faster than 'hyper_threading_pr 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.640 s ±  0.110 s    [User: 38.476 s, System: 0.981 s]
  Range (min … max):   10.562 s … 10.717 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.680 s ±  0.045 s    [User: 38.584 s, System: 0.936 s]
  Range (min … max):   10.649 s … 10.712 s    2 runs
 
Summary
  'hyper_threading_main threads: 6' ran
    1.00 ± 0.01 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.496 s ±  0.097 s    [User: 38.452 s, System: 1.014 s]
  Range (min … max):   10.427 s … 10.564 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.448 s ±  0.037 s    [User: 39.280 s, System: 0.946 s]
  Range (min … max):   10.423 s … 10.474 s    2 runs
 
Summary
  'hyper_threading_pr threads: 8' ran
    1.00 ± 0.01 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 ± σ):     10.489 s ±  0.342 s    [User: 38.997 s, System: 1.033 s]
  Range (min … max):   10.247 s … 10.730 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.524 s ±  0.039 s    [User: 39.340 s, System: 1.053 s]
  Range (min … max):   10.496 s … 10.551 s    2 runs
 
Summary
  'hyper_threading_main threads: 16' ran
    1.00 ± 0.03 times faster than 'hyper_threading_pr threads: 16'


Copy link

github-actions bot commented Aug 7, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.134 ± 0.040 2.088 2.193 1.00 ± 0.02
head big_factorial 2.126 ± 0.029 2.082 2.190 1.00
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.077 ± 0.060 2.026 2.235 1.00 ± 0.05
head big_fibonacci 2.072 ± 0.091 2.022 2.323 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.764 ± 0.111 7.642 7.946 1.00
head blake2s_integration_benchmark 7.870 ± 0.216 7.617 8.223 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.186 ± 0.026 2.159 2.224 1.00
head compare_arrays_200000 2.212 ± 0.050 2.155 2.316 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.426 ± 0.013 1.408 1.448 1.00
head dict_integration_benchmark 1.428 ± 0.007 1.419 1.439 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.264 ± 0.058 1.218 1.422 1.03 ± 0.05
head field_arithmetic_get_square_benchmark 1.228 ± 0.009 1.213 1.240 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.911 ± 0.157 7.702 8.150 1.01 ± 0.03
head integration_builtins 7.827 ± 0.122 7.686 8.013 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.126 ± 0.142 7.933 8.348 1.01 ± 0.02
head keccak_integration_benchmark 8.075 ± 0.090 7.896 8.207 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.199 ± 0.039 2.158 2.295 1.01 ± 0.02
head linear_search 2.177 ± 0.031 2.133 2.249 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.519 ± 0.009 1.510 1.535 1.00
head math_cmp_and_pow_integration_benchmark 1.536 ± 0.033 1.509 1.616 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.442 ± 0.005 1.436 1.450 1.00
head math_integration_benchmark 1.486 ± 0.039 1.453 1.564 1.03 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.215 ± 0.022 1.195 1.267 1.01 ± 0.02
head memory_integration_benchmark 1.206 ± 0.018 1.191 1.248 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.563 ± 0.014 1.549 1.589 1.00
head operations_with_data_structures_benchmarks 1.571 ± 0.010 1.556 1.589 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 530.5 ± 4.3 526.1 541.7 1.00
head pedersen 534.2 ± 19.1 524.3 588.0 1.01 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 767.3 ± 9.8 758.8 792.7 1.01 ± 0.02
head poseidon_integration_benchmark 763.5 ± 7.1 755.6 779.9 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.873 ± 0.038 1.841 1.943 1.00 ± 0.03
head secp_integration_benchmark 1.865 ± 0.028 1.837 1.912 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 640.8 ± 4.7 635.8 650.2 1.00
head set_integration_benchmark 653.5 ± 14.1 642.6 692.0 1.02 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.370 ± 0.117 4.248 4.598 1.01 ± 0.03
head uint256_integration_benchmark 4.341 ± 0.050 4.251 4.404 1.00

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.90%. Comparing base (4e04de7) to head (4a677a2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1818      +/-   ##
==========================================
+ Coverage   94.87%   94.90%   +0.02%     
==========================================
  Files         102      102              
  Lines       40248    40288      +40     
==========================================
+ Hits        38185    38234      +49     
+ Misses       2063     2054       -9     

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

@pefontana pefontana marked this pull request as ready for review August 8, 2024 18:57
@pefontana pefontana added this pull request to the merge queue Aug 8, 2024
Merged via the queue into main with commit e6b8586 Aug 8, 2024
72 checks passed
@pefontana pefontana deleted the fix-memory-holes branch August 8, 2024 20:30
@pefontana pefontana changed the title Fix memory holes Fix MemorySegmentManager::add_zero_segment Aug 9, 2024
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