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

Partially Revert Optimize trace relocation #906 #1492

Merged
merged 16 commits into from
Nov 24, 2023

Conversation

fmoletta
Copy link
Contributor

When running the starknet os, the pc can take values outside of the program segment, which conflicts with our trace optimization, that takes advantage of the trace pc always being on segment 0.
Partially reverts changes made by #906

Copy link

github-actions bot commented Nov 23, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.567 ± 0.019 2.547 2.608 1.00
head big_factorial 2.624 ± 0.013 2.603 2.645 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.161 ± 0.012 2.146 2.183 1.00
head big_fibonacci 2.225 ± 0.015 2.200 2.256 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 6.014 ± 0.029 5.979 6.078 1.00
head blake2s_integration_benchmark 6.196 ± 0.039 6.129 6.254 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.254 ± 0.011 2.236 2.267 1.00
head compare_arrays_200000 2.346 ± 0.015 2.325 2.379 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.572 ± 0.009 1.563 1.591 1.00
head dict_integration_benchmark 1.614 ± 0.009 1.602 1.632 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.049 ± 0.007 1.041 1.063 1.00
head field_arithmetic_get_square_benchmark 1.088 ± 0.004 1.084 1.097 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 5.948 ± 0.031 5.908 5.995 1.00
head integration_builtins 6.146 ± 0.027 6.109 6.189 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 6.098 ± 0.030 6.055 6.150 1.00
head keccak_integration_benchmark 6.309 ± 0.092 6.245 6.556 1.03 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.284 ± 0.016 2.265 2.322 1.00
head linear_search 2.369 ± 0.009 2.353 2.387 1.04 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.565 ± 0.012 1.544 1.584 1.00
head math_cmp_and_pow_integration_benchmark 1.588 ± 0.010 1.573 1.602 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.474 ± 0.011 1.457 1.490 1.00
head math_integration_benchmark 1.511 ± 0.009 1.502 1.526 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.297 ± 0.007 1.291 1.309 1.00
head memory_integration_benchmark 1.326 ± 0.010 1.317 1.345 1.02 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.435 ± 0.007 1.426 1.452 1.00
head operations_with_data_structures_benchmarks 1.470 ± 0.006 1.460 1.483 1.02 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 581.6 ± 3.0 577.0 587.5 1.00
head pedersen 597.7 ± 2.7 592.8 601.4 1.03 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.177 ± 0.012 1.165 1.207 1.00
head poseidon_integration_benchmark 1.179 ± 0.007 1.171 1.195 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 2.011 ± 0.021 1.991 2.061 1.00
head secp_integration_benchmark 2.035 ± 0.013 2.022 2.063 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 1.153 ± 0.003 1.144 1.156 1.00
head set_integration_benchmark 1.162 ± 0.004 1.156 1.167 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 3.830 ± 0.020 3.805 3.858 1.00
head uint256_integration_benchmark 3.969 ± 0.028 3.936 4.031 1.04 ± 0.01

Copy link

codecov bot commented Nov 23, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (4089b46) 96.81% compared to head (8ca276f) 96.82%.

Files Patch % Lines
vm/src/vm/trace/mod.rs 84.61% 2 Missing ⚠️
vm/src/vm/runners/cairo_runner.rs 98.93% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1492   +/-   ##
=======================================
  Coverage   96.81%   96.82%           
=======================================
  Files          96       96           
  Lines       39525    39567   +42     
=======================================
+ Hits        38267    38311   +44     
+ Misses       1258     1256    -2     

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

@fmoletta fmoletta changed the title [WIP] Partially Revert Optimize trace relocation #906 Partially Revert Optimize trace relocation #906 Nov 24, 2023
@fmoletta fmoletta marked this pull request as ready for review November 24, 2023 13:07
Copy link
Contributor

@Oppen Oppen left a comment

Choose a reason for hiding this comment

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

LGTM but we need the following additions to the changelog:
– List the breaking changes;
– Optional, but IMO useful, mention the actual feature we're working to achieve, which is running code from arbitrary segments.

vm/src/air_public_input.rs Show resolved Hide resolved
vm/src/cairo_run.rs Show resolved Hide resolved
@pefontana pefontana added this pull request to the merge queue Nov 24, 2023
Merged via the queue into main with commit 7c1cfd9 Nov 24, 2023
50 checks passed
@pefontana pefontana deleted the revert-trace-optimization branch November 24, 2023 22:05
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