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

WIP: Introduce TrialRunner Abstraction #720

Draft
wants to merge 162 commits into
base: main
Choose a base branch
from

Conversation

bpkroth
Copy link
Contributor

@bpkroth bpkroth commented Mar 19, 2024

This is another step in adding support for parallel trial execution #380.

Here we separate out the running of an individual trial to a single class - TrialRunner.

Multiple TrialRunners are instantiated at CLI invocation with the --num-trial-runners argument. 
Each TrialRunner associated with a single copy of the root Environment, and made unique by means of a unique trial_runner_id value that's included in that Environment's global_config.

TODO:

  • tests

In future PRs we will add:

  • New Scheduler implementations to run TrialRunners in parallel.
  • Async polling of status results in each TrialRunner independently.

@@ -46,6 +46,16 @@ def __init__( # pylint: disable=too-many-arguments
self._engine = engine
self._schema = schema

def _save_new_config_data(self, new_config_data: Dict[str, Union[int, float, str]]) -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needs tests

@@ -145,6 +161,7 @@ def get_results_df(
"tunable_config_id",
"tunable_config_trial_group_id",
"status",
"trial_runner_id",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needs tests

"""ID of the TrialRunner."""
if not self._trial_runner_id:
self._trial_runner_id = self.metadata_dict.get("trial_runner_id")
return self._trial_runner_id
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needs tests

bpkroth added a commit that referenced this pull request Oct 1, 2024
Refactors tests in preparation for testing for #720.

Adds `status()` output for MockEnv as well, though with a pending FIXME
on improving the Status type in the status output that we'll address in
a future PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work in progress - do not merge yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants