Skip to content

Stav/use btmap #2023

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

Merged
merged 1 commit into from
Mar 27, 2025
Merged

Stav/use btmap #2023

merged 1 commit into from
Mar 27, 2025

Conversation

Stavbe
Copy link
Collaborator

@Stavbe Stavbe commented Mar 24, 2025

Use Btreemap instead of hashmap

Description

For deterministic iteration order in the adapter side.

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.

This change is Reviewable

@Stavbe Stavbe changed the base branch from main to stav/fix_get_builtins_segment_in_prover_info March 24, 2025 15:38
Copy link

github-actions bot commented Mar 24, 2025

**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.294 s ±  0.053 s    [User: 25.491 s, System: 0.802 s]
  Range (min … max):   26.257 s … 26.332 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 1
  Time (mean ± σ):     26.243 s ±  0.082 s    [User: 25.432 s, System: 0.809 s]
  Range (min … max):   26.185 s … 26.301 s    2 runs
 
Summary
  hyper_threading_pr threads: 1 ran
    1.00 ± 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 ± σ):     14.803 s ±  0.166 s    [User: 25.758 s, System: 0.822 s]
  Range (min … max):   14.685 s … 14.920 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 2
  Time (mean ± σ):     14.582 s ±  0.046 s    [User: 25.564 s, System: 0.809 s]
  Range (min … max):   14.550 s … 14.615 s    2 runs
 
Summary
  hyper_threading_pr threads: 2 ran
    1.02 ± 0.01 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.507 s ±  0.159 s    [User: 38.566 s, System: 0.961 s]
  Range (min … max):   10.395 s … 10.619 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 4
  Time (mean ± σ):     10.630 s ±  0.366 s    [User: 37.628 s, System: 0.960 s]
  Range (min … max):   10.371 s … 10.889 s    2 runs
 
Summary
  hyper_threading_main threads: 4 ran
    1.01 ± 0.04 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.589 s ±  0.272 s    [User: 38.366 s, System: 0.993 s]
  Range (min … max):   10.397 s … 10.781 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 6
  Time (mean ± σ):     10.652 s ±  0.216 s    [User: 37.880 s, System: 1.008 s]
  Range (min … max):   10.499 s … 10.805 s    2 runs
 
Summary
  hyper_threading_main threads: 6 ran
    1.01 ± 0.03 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.402 s ±  0.077 s    [User: 38.508 s, System: 1.016 s]
  Range (min … max):   10.348 s … 10.457 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 8
  Time (mean ± σ):     10.246 s ±  0.184 s    [User: 38.396 s, System: 1.018 s]
  Range (min … max):   10.116 s … 10.377 s    2 runs
 
Summary
  hyper_threading_pr threads: 8 ran
    1.02 ± 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 ± σ):     10.308 s ±  0.084 s    [User: 38.816 s, System: 1.117 s]
  Range (min … max):   10.248 s … 10.368 s    2 runs
 
Benchmark 2: hyper_threading_pr threads: 16
  Time (mean ± σ):     10.299 s ±  0.146 s    [User: 38.853 s, System: 1.072 s]
  Range (min … max):   10.196 s … 10.402 s    2 runs
 
Summary
  hyper_threading_pr threads: 16 ran
    1.00 ± 0.02 times faster than hyper_threading_main threads: 16


@Stavbe Stavbe marked this pull request as ready for review March 24, 2025 15:49
@Stavbe Stavbe self-assigned this Mar 24, 2025
Copy link

github-actions bot commented Mar 24, 2025

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.126 ± 0.018 2.102 2.165 1.00
head big_factorial 2.136 ± 0.017 2.119 2.177 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.055 ± 0.011 2.042 2.075 1.00
head big_fibonacci 2.058 ± 0.011 2.042 2.076 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 7.546 ± 0.028 7.489 7.591 1.00
head blake2s_integration_benchmark 7.597 ± 0.015 7.566 7.609 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.170 ± 0.010 2.157 2.190 1.00
head compare_arrays_200000 2.183 ± 0.011 2.175 2.211 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.429 ± 0.004 1.424 1.434 1.00
head dict_integration_benchmark 1.433 ± 0.006 1.428 1.447 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.200 ± 0.004 1.196 1.207 1.00
head field_arithmetic_get_square_benchmark 1.218 ± 0.005 1.210 1.225 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 7.593 ± 0.032 7.552 7.663 1.00
head integration_builtins 7.686 ± 0.043 7.606 7.777 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 7.876 ± 0.125 7.781 8.162 1.00
head keccak_integration_benchmark 7.933 ± 0.100 7.883 8.215 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.144 ± 0.021 2.120 2.181 1.00
head linear_search 2.144 ± 0.010 2.132 2.160 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.509 ± 0.004 1.500 1.513 1.00 ± 0.00
head math_cmp_and_pow_integration_benchmark 1.508 ± 0.005 1.501 1.515 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.452 ± 0.007 1.442 1.460 1.00
head math_integration_benchmark 1.458 ± 0.006 1.449 1.471 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.219 ± 0.012 1.211 1.251 1.01 ± 0.01
head memory_integration_benchmark 1.212 ± 0.011 1.205 1.243 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.558 ± 0.004 1.552 1.565 1.00
head operations_with_data_structures_benchmarks 1.577 ± 0.008 1.567 1.587 1.01 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 533.4 ± 1.0 531.6 534.7 1.00
head pedersen 536.0 ± 2.8 532.2 541.1 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base poseidon_integration_benchmark 630.7 ± 3.3 622.2 634.3 1.00 ± 0.01
head poseidon_integration_benchmark 629.9 ± 5.5 622.1 637.7 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.851 ± 0.004 1.844 1.858 1.00
head secp_integration_benchmark 1.859 ± 0.005 1.852 1.867 1.00 ± 0.00
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 662.5 ± 5.2 654.0 670.5 1.05 ± 0.01
head set_integration_benchmark 628.0 ± 1.9 624.7 631.2 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.155 ± 0.026 4.123 4.202 1.00
head uint256_integration_benchmark 4.240 ± 0.040 4.201 4.334 1.02 ± 0.01

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.54%. Comparing base (63fa1b7) to head (0f78168).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2023   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         102      102           
  Lines       42755    42755           
=======================================
  Hits        41276    41276           
  Misses       1479     1479           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Stavbe Stavbe force-pushed the stav/fix_get_builtins_segment_in_prover_info branch from fb8fa9b to 21bbb35 Compare March 25, 2025 09:31
Copy link
Collaborator

@DavidLevitGurevich DavidLevitGurevich left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @FrancoGiachetta, @JulianGCalderon, and @yuvalsw)

Copy link
Collaborator

@yuvalsw yuvalsw left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @FrancoGiachetta and @JulianGCalderon)

@Stavbe Stavbe force-pushed the stav/fix_get_builtins_segment_in_prover_info branch 2 times, most recently from 845e3e0 to b2a9287 Compare March 25, 2025 17:20
CHANGELOG.md Outdated
Comment on lines 10 to 11
* fix: Updated the logic for collecting builtin segment data for prover input info, removing dependency on the existence of stop pointers. [#2022](https://github.com/lambdaclass/cairo-vm/pull/2022)

Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is repeated. Please remove it.

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.

@Stavbe Stavbe force-pushed the stav/fix_get_builtins_segment_in_prover_info branch 2 times, most recently from 130c1dc to 9ce2f47 Compare March 26, 2025 09:50
Copy link
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @DavidLevitGurevich and @JulianGCalderon)

CHANGELOG.md Outdated
Comment on lines 10 to 11
* fix: Updated the logic for collecting builtin segment data for prover input info, removing dependency on the existence of stop pointers. [#2022](https://github.com/lambdaclass/cairo-vm/pull/2022)

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.

Copy link
Contributor

@JulianGCalderon JulianGCalderon left a comment

Choose a reason for hiding this comment

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

LGTM

@Stavbe Stavbe changed the base branch from stav/fix_get_builtins_segment_in_prover_info to main March 26, 2025 14:47
@Stavbe Stavbe force-pushed the stav/use_btmap branch 2 times, most recently from 15a1f92 to d413702 Compare March 26, 2025 16:59
Copy link
Collaborator Author

@Stavbe Stavbe left a comment

Choose a reason for hiding this comment

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

Hi @JulianGCalderon, you are blocking&approve

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @DavidLevitGurevich and @JulianGCalderon)

@JulianGCalderon
Copy link
Contributor

Hi @JulianGCalderon, you are blocking&approve

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @DavidLevitGurevich and @JulianGCalderon)

I think that issue is related to reviewable. It shouldn't be a problem as from Github's point of view, I approved the PR.

@JulianGCalderon
Copy link
Contributor

@Stavbe there are some Ci jobs failing. Could you fix them please?

@Stavbe Stavbe enabled auto-merge March 27, 2025 08:48
@Stavbe Stavbe added this pull request to the merge queue Mar 27, 2025
Merged via the queue into main with commit 60e6f24 Mar 27, 2025
93 checks passed
@Stavbe Stavbe deleted the stav/use_btmap branch March 27, 2025 09:51
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.

5 participants