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

Add cairo_pie_output flag to cairo_vm_cli #1578

Merged
merged 41 commits into from
Jan 22, 2024
Merged

Add cairo_pie_output flag to cairo_vm_cli #1578

merged 41 commits into from
Jan 22, 2024

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Jan 17, 2024

This also involves:

  • Fixing serialization of CairoPie to be fully compatible with the python version
  • Implementing CairoPie::write_zip_file
  • Adding comparison of cairo pie outputs between python and rust vm
    Bonus:
  • Moved handling of required and exclusive arguments to struct definition using clap derives

Copy link

github-actions bot commented Jan 17, 2024

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 2.261 ± 0.014 2.249 2.292 1.00
head big_factorial 2.271 ± 0.047 2.242 2.401 1.00 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 2.239 ± 0.005 2.232 2.246 1.00
head big_fibonacci 2.244 ± 0.011 2.229 2.266 1.00 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 8.189 ± 0.092 8.100 8.294 1.01 ± 0.01
head blake2s_integration_benchmark 8.146 ± 0.056 8.072 8.251 1.00
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 2.288 ± 0.018 2.273 2.319 1.00 ± 0.01
head compare_arrays_200000 2.286 ± 0.008 2.278 2.300 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 1.436 ± 0.005 1.428 1.448 1.00
head dict_integration_benchmark 1.453 ± 0.005 1.449 1.462 1.01 ± 0.00
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.293 ± 0.010 1.282 1.309 1.01 ± 0.01
head field_arithmetic_get_square_benchmark 1.285 ± 0.007 1.275 1.293 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 8.217 ± 0.079 8.140 8.331 1.00 ± 0.01
head integration_builtins 8.189 ± 0.075 8.107 8.290 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 8.436 ± 0.029 8.399 8.473 1.00 ± 0.01
head keccak_integration_benchmark 8.411 ± 0.057 8.329 8.491 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 2.321 ± 0.018 2.299 2.350 1.00 ± 0.01
head linear_search 2.314 ± 0.009 2.298 2.330 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 1.586 ± 0.007 1.580 1.604 1.00
head math_cmp_and_pow_integration_benchmark 1.598 ± 0.013 1.591 1.632 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 1.440 ± 0.006 1.432 1.451 1.00
head math_integration_benchmark 1.452 ± 0.006 1.440 1.460 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 1.272 ± 0.013 1.255 1.301 1.01 ± 0.01
head memory_integration_benchmark 1.261 ± 0.003 1.256 1.267 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 1.627 ± 0.012 1.615 1.651 1.00 ± 0.01
head operations_with_data_structures_benchmarks 1.626 ± 0.003 1.622 1.630 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 606.3 ± 2.0 603.8 609.1 1.00 ± 0.00
head pedersen 604.5 ± 1.4 602.8 606.5 1.00
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.055 ± 0.007 1.045 1.065 1.00
head poseidon_integration_benchmark 1.064 ± 0.004 1.060 1.072 1.01 ± 0.01
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 1.934 ± 0.015 1.924 1.974 1.00
head secp_integration_benchmark 1.935 ± 0.019 1.920 1.983 1.00 ± 0.01
Command Mean [ms] Min [ms] Max [ms] Relative
base set_integration_benchmark 770.1 ± 2.0 768.0 774.6 1.03 ± 0.00
head set_integration_benchmark 750.4 ± 2.7 748.3 757.6 1.00
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 4.539 ± 0.064 4.506 4.702 1.00 ± 0.02
head uint256_integration_benchmark 4.525 ± 0.032 4.492 4.591 1.00

@fmoletta fmoletta changed the title [WIP] Add cairo_pie_output flag to cairo_vm_cli Add cairo_pie_output flag to cairo_vm_cli Jan 18, 2024
@fmoletta fmoletta marked this pull request as ready for review January 18, 2024 17:08
@Oppen
Copy link
Member

Oppen commented Jan 18, 2024

Suggestion: maybe just write to a folder instead and use a tiny script for zipping?

Comment on lines +247 to +248
// 1bit | SEGMENT_BITS | OFFSET_BITS
// 1 | segment | offset
Copy link
Member

Choose a reason for hiding this comment

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

This is 64 bits, so u64 seems like a better choice than BigUint.

Copy link
Member Author

@fmoletta fmoletta Jan 18, 2024

Choose a reason for hiding this comment

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

Its 8 bits for the address (which is built as an u64 in line 243) but in this case we are handling a memory value (that is a relocatable), which takes 32 bytes

Copy link
Member

Choose a reason for hiding this comment

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

Relocatable is 8 bytes AFAIR.

Oppen
Oppen previously approved these changes Jan 22, 2024
@Oppen Oppen enabled auto-merge January 22, 2024 18:18
@Oppen Oppen added this pull request to the merge queue Jan 22, 2024
Merged via the queue into main with commit 2f715c4 Jan 22, 2024
49 of 50 checks passed
@Oppen Oppen deleted the cairo_pie_output branch January 22, 2024 21:20
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.

None yet

3 participants