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

Fix bug in _BlackboxSimulatorBackend for pause/resume scheduling (iss… #317

Merged
merged 2 commits into from
Aug 18, 2022

Conversation

mseeger
Copy link
Collaborator

@mseeger mseeger commented Aug 18, 2022

…ue #304)

*Issue #, if available: #304

Description of changes:
Fixes bug which affects pause-and-resume scheduling (ASHA promotion, sync HB) with blackbox backend. The fix requires a small extension of the TrialScheduler API: pause_trial needs to receive the result which led the scheduler to make the pause decision. I left this optional, if the result is not passed, the simulated backend will behave differently as intended (namely, resumed trials will be started from scratch). But the Tuner can easily pass this information. To me, this API extension makes sense: give the backend information about why a trial has been paused.

For API consistency, I did the same extension for stop_trial, even though this is not needed right now. Note that these changes are internal API between backend and Tuner, the user does not notice this at all.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mseeger mseeger requested a review from wistuba August 18, 2022 08:46
@mseeger mseeger requested a review from aaronkl August 18, 2022 08:52
@mseeger mseeger mentioned this pull request Aug 18, 2022
Copy link
Collaborator

@wistuba wistuba left a comment

Choose a reason for hiding this comment

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

Only one minor comment

@@ -229,7 +229,7 @@ def _all_trial_results(self, trial_ids: List[int]) -> List[TrialResult]:
res.append(trial_results)
return res

def _pause_trial(self, trial_id: int):
def _pause_trial(self, trial_id: int, result: Optional[dict]):
Copy link
Collaborator

Choose a reason for hiding this comment

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

there are multiple cases where the typing suggests optional but None was not provided as default value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are internal methods, you'd not call them directly.

@mseeger mseeger merged commit 7621c95 into main Aug 18, 2022
@mseeger mseeger deleted the bug_304 branch August 18, 2022 10:07
geoalgo pushed a commit that referenced this pull request Sep 2, 2022
#317)

* Fix bug in _BlackboxSimulatorBackend for pause/resume scheduling (issue #304)

* Small fix
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

2 participants