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

Create only the builtins used by the program when running cairo 1 programs #1457

Merged
merged 25 commits into from
Oct 17, 2023

Conversation

fmoletta
Copy link
Member

@fmoletta fmoletta commented Oct 9, 2023

TITLE

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.

@fmoletta fmoletta changed the base branch from main to unpin-vm-for-cairo1-run-crate October 9, 2023 18:29
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Benchmark Results for unmodified programs 🚀

Command Mean [s] Min [s] Max [s] Relative
base big_factorial 4.746 ± 0.087 4.618 4.891 1.00
head big_factorial 4.801 ± 0.217 4.452 5.062 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base big_fibonacci 3.910 ± 0.085 3.726 4.024 1.01 ± 0.02
head big_fibonacci 3.888 ± 0.044 3.823 3.954 1.00
Command Mean [s] Min [s] Max [s] Relative
base blake2s_integration_benchmark 10.708 ± 0.337 9.946 11.158 1.00
head blake2s_integration_benchmark 10.762 ± 0.142 10.540 10.971 1.01 ± 0.03
Command Mean [s] Min [s] Max [s] Relative
base compare_arrays_200000 3.917 ± 0.071 3.746 3.988 1.02 ± 0.06
head compare_arrays_200000 3.838 ± 0.229 3.595 4.187 1.00
Command Mean [s] Min [s] Max [s] Relative
base dict_integration_benchmark 2.684 ± 0.042 2.597 2.752 1.00
head dict_integration_benchmark 2.718 ± 0.120 2.636 3.017 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base field_arithmetic_get_square_benchmark 1.776 ± 0.036 1.707 1.835 1.01 ± 0.04
head field_arithmetic_get_square_benchmark 1.764 ± 0.057 1.644 1.846 1.00
Command Mean [s] Min [s] Max [s] Relative
base integration_builtins 10.372 ± 0.142 10.165 10.641 1.01 ± 0.05
head integration_builtins 10.286 ± 0.476 9.615 10.868 1.00
Command Mean [s] Min [s] Max [s] Relative
base keccak_integration_benchmark 10.839 ± 0.352 10.376 11.434 1.00 ± 0.04
head keccak_integration_benchmark 10.806 ± 0.144 10.599 11.006 1.00
Command Mean [s] Min [s] Max [s] Relative
base linear_search 3.813 ± 0.159 3.610 4.128 1.00
head linear_search 3.996 ± 0.088 3.897 4.211 1.05 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base math_cmp_and_pow_integration_benchmark 2.879 ± 0.130 2.711 3.135 1.01 ± 0.05
head math_cmp_and_pow_integration_benchmark 2.857 ± 0.042 2.802 2.934 1.00
Command Mean [s] Min [s] Max [s] Relative
base math_integration_benchmark 2.555 ± 0.028 2.494 2.590 1.00
head math_integration_benchmark 2.588 ± 0.029 2.552 2.639 1.01 ± 0.02
Command Mean [s] Min [s] Max [s] Relative
base memory_integration_benchmark 2.329 ± 0.082 2.274 2.558 1.01 ± 0.04
head memory_integration_benchmark 2.306 ± 0.039 2.241 2.368 1.00
Command Mean [s] Min [s] Max [s] Relative
base operations_with_data_structures_benchmarks 2.530 ± 0.063 2.478 2.695 1.03 ± 0.03
head operations_with_data_structures_benchmarks 2.468 ± 0.048 2.375 2.537 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base pedersen 974.0 ± 30.6 943.7 1037.9 1.00
head pedersen 995.0 ± 71.9 927.5 1182.3 1.02 ± 0.08
Command Mean [s] Min [s] Max [s] Relative
base poseidon_integration_benchmark 1.822 ± 0.030 1.772 1.870 1.03 ± 0.03
head poseidon_integration_benchmark 1.767 ± 0.043 1.673 1.815 1.00
Command Mean [s] Min [s] Max [s] Relative
base secp_integration_benchmark 3.406 ± 0.053 3.346 3.501 1.00
head secp_integration_benchmark 3.433 ± 0.144 3.299 3.782 1.01 ± 0.05
Command Mean [s] Min [s] Max [s] Relative
base set_integration_benchmark 2.003 ± 0.071 1.914 2.152 1.00
head set_integration_benchmark 2.063 ± 0.047 1.965 2.134 1.03 ± 0.04
Command Mean [s] Min [s] Max [s] Relative
base uint256_integration_benchmark 6.652 ± 0.257 6.133 7.051 1.00
head uint256_integration_benchmark 6.730 ± 0.147 6.514 6.970 1.01 ± 0.04

@fmoletta fmoletta marked this pull request as ready for review October 9, 2023 20:59
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.

Amazing work @fmoletta !!!

Copy link

@toni-calvin toni-calvin left a comment

Choose a reason for hiding this comment

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

lgtm!

@Oppen Oppen merged commit 36e6de9 into unpin-vm-for-cairo1-run-crate Oct 17, 2023
43 checks passed
@Oppen Oppen deleted the set-builtins-from-args branch October 17, 2023 19:12
github-merge-queue bot pushed a commit that referenced this pull request Oct 23, 2023
* Add basic example for running Cairo 1 programs

* FileWriter

* Fix issue

* Fix cargo lock

* Fix typo

* CLI for cairo1 run

* CLI

* Test for the cli

* Clone corelib, add it to ignore

* Delete pub, set bincode to workspace

* Delete corelib

* New line

* Remove corelib, download it

* .Phony

* Add readme documentation

* change place of doc in readme

* Run with release

* Try running all files

* Fix makefile to compile everything

* add workflow

* Endlines

* test workflow

* change on in workflow

* yaml fix

* change on in workflow

* change on in workflow

* Fix typo

* Fix cairo vm dependecy

* Modify changelog

* Modify workflow

* Clone with https

* use cairo1 run makefile

* Add cairo 1 programs

* Pin cairo version to 2.2.0

* Update documentation

* Update workflow

* Add cairo 1 program

* Update dependencies

* Update test workflow

* Extract entrypoint from function name

* Extract return values from main func and distinguish panics (First darft, needs cleaning)

* Improve return values output

* Show panick data

* Parse panic data

* Remove TODO & some unwraps

* Add newline at end of file

* Use own Cairo1HintProcessor instead or importing the one on cairo_lang_runner

* Remove RunFunctionContext

* Remove more imports

* Use fixed entrypoint

* Use fixed entrypoint

* Miror find_function

* Mirror create_code_footer

* Miror create_entry_code

* Remove cairo_lang_runner imports

* unpin cairo-vm dependency

* Add layout flag to make run

* Remove dependency

* Remove comment

* fmt + clippy

* Add changelog + update lock

* Validate values in tests 7 fix return values

* Fix test

* fmt

* clippy

* Remove unwraps

* Bump cairo imports version

* Bump dep version

* fmt

* Remove unwrap

* Create only the builtins used by the program when running cairo 1 programs (#1457)

* Add features to cairo1-run

* Add cairo1-run to default members

* Add mimalloc dependency

* Try stuff

* Revert "Try stuff"

This reverts commit 5fb206c.

* Free up space in ubuntu runner

* Also partition test-no-std

* Revert "Free up space in ubuntu runner"

This reverts commit 076ac69.

---------

Co-authored-by: Mariano Nicolini <mariano.nicolini.91@gmail.com>
Co-authored-by: Milton <milton.scuderi@lambdaclass.com>
Co-authored-by: mmsc2 <88055861+mmsc2@users.noreply.github.com>
Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
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

4 participants