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: await_first_trial errors when Experiment is terminal #9022

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

wes-turner
Copy link
Contributor

@wes-turner wes-turner commented Mar 19, 2024

Pre-patch, when running await_first_trial on an Experiment the method would never exit if the experiment that backed it was in a terminal state and no trials started. It now checks that the underlying experiment is not terminal, and raises an exception if it becomes such (believing no trial will ever be started).

Side effect: Like wait, await_first_trial now reloads the underlying Experiment object.

MD-335

Description

Test Plan

Find or create an experiment that either fails or is canceled before any trials start. Then, in the SDK:

from determined.experimental import client
client.login(<login>)
exp = client.get_experiment(<id>)
exp.await_first_trial()

Also try awaiting a trial on experiments that actually do have trials. Or any weird cases you can think of.

Commentary (optional)

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

@cla-bot cla-bot bot added the cla-signed label Mar 19, 2024
Copy link

netlify bot commented Mar 19, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 587d6cd
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/65fa0324375d15000817cd42

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.80%. Comparing base (a603f4c) to head (587d6cd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9022      +/-   ##
==========================================
+ Coverage   47.78%   47.80%   +0.01%     
==========================================
  Files        1161     1161              
  Lines      143441   143471      +30     
  Branches     2372     2372              
==========================================
+ Hits        68547    68580      +33     
+ Misses      74741    74738       -3     
  Partials      153      153              
Flag Coverage Δ
backend 42.96% <ø> (+0.01%) ⬆️
harness 63.84% <100.00%> (+0.01%) ⬆️
web 40.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...rness/determined/common/experimental/experiment.py 71.95% <100.00%> (+0.46%) ⬆️
.../determined/common/experimental/test_experiment.py 98.94% <100.00%> (+0.16%) ⬆️

... and 4 files with indirect coverage changes

@wes-turner wes-turner changed the title fix: Experiment.await_first_trial exits when Experiment is terminal fix: await_first_trial errors when Experiment is terminal Mar 19, 2024
@wes-turner wes-turner marked this pull request as ready for review March 19, 2024 21:42
@wes-turner wes-turner requested a review from a team as a code owner March 19, 2024 21:42
Copy link
Contributor

@gt2345 gt2345 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the improvement

Copy link
Contributor

@azhou-determined azhou-determined left a comment

Choose a reason for hiding this comment

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

lgtm

@wes-turner wes-turner merged commit 5e1f2af into main Mar 19, 2024
76 of 88 checks passed
@wes-turner wes-turner deleted the wes/await-trial-can-error branch March 19, 2024 22:35
maxrussell pushed a commit that referenced this pull request Mar 21, 2024
…9022)

Pre-patch, when running await_first_trial on an Experiment the method would never exit if the experiment that backed it was in a terminal state and no trials started. It now checks that the underlying experiment is not terminal, and raises an exception if it becomes such (believing no trial will ever be started).

Side effect: Like wait, await_first_trial now reloads the underlying Experiment object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants