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

Simplify function for generating runtimes for benchmarking #3118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

esantorella
Copy link
Contributor

Summary:
Context: async_runtime_func_from_pi was a way of deterministically getting a quasi-random number from a trial index by using the trial index to look up a digit of pi. This was unnecessarily weird and wouldn't make sense once we start determining runtimes based on parameterizations rather than trial index in D66313060.

This PR:

  • Add a function that generates an int between 0 and 9 by hashing the parameters of the trial's first arm, using Arm.md5hash.
  • Pulls out a function for doing this based on parameters, looking ahead to D66313060.
  • Change Arm.md5hash to not mutate the parameters; update some function signatures in arm.py to indicate that they do not mutate parameters.

Reviewed By: Balandat

Differential Revision: D66460608

Summary:
Context: `async_runtime_func_from_pi` was a way of deterministically getting a quasi-random number from a trial index by using the trial index to look up a digit of pi. This was unnecessarily weird and wouldn't make sense once we start determining runtimes based on parameterizations rather than trial index in D66313060.

This PR:

* Add a function that generates an int between 0 and 9 by hashing the parameters of the trial's first arm, using `Arm.md5hash`.
* Pulls out a function for doing this based on parameters, looking ahead to D66313060.
* Change `Arm.md5hash` to not mutate the parameters; update some function signatures in `arm.py` to indicate that they do not mutate parameters.

Reviewed By: Balandat

Differential Revision: D66460608
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Nov 26, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66460608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants