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

chore: experiment config slots to comply with constraint max slots #10054

Merged
merged 3 commits into from
Oct 15, 2024

Conversation

amandavialva01
Copy link
Contributor

@amandavialva01 amandavialva01 commented Oct 15, 2024

Ticket

CM-569

Description

Experiment config slots to comply with constraint max slots.

Test Plan

CI Passes.

Checklist

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

Copy link

netlify bot commented Oct 15, 2024

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 3dce288
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/670ee9f75c51d800085e1f33

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 54.41%. Comparing base (2ef2f12) to head (3dce288).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
master/internal/configpolicy/utils.go 33.33% 2 Missing ⚠️
master/internal/configpolicy/task_config_policy.go 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10054      +/-   ##
==========================================
- Coverage   54.42%   54.41%   -0.01%     
==========================================
  Files        1262     1262              
  Lines      158880   158888       +8     
  Branches     3631     3631              
==========================================
- Hits        86463    86461       -2     
- Misses      72283    72293      +10     
  Partials      134      134              
Flag Coverage Δ
backend 45.48% <84.21%> (-0.02%) ⬇️
harness 72.74% <ø> (ø)
web 53.95% <ø> (ø)

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

Files with missing lines Coverage Δ
master/internal/configpolicy/task_config_policy.go 87.16% <93.75%> (+0.01%) ⬆️
master/internal/configpolicy/utils.go 23.33% <33.33%> (+7.77%) ⬆️

... and 6 files with indirect coverage changes

@amandavialva01 amandavialva01 changed the title fix: experiment config slots to comply with constraint max slots chore: experiment config slots to comply with constraint max slots Oct 15, 2024
@@ -94,7 +94,7 @@ func ValidateExperimentConfig(
if cp.InvariantConfig.RawResources != nil {
checkAgainstGlobalPriority(priorityEnabledErr, cp.InvariantConfig.RawResources.RawPriority)
if err := checkConstraintConflicts(cp.Constraints, cp.InvariantConfig.RawResources.RawMaxSlots,
cp.InvariantConfig.RawResources.RawSlotsPerTrial, cp.InvariantConfig.RawResources.RawPriority); err != nil {
cp.InvariantConfig.RawResources.RawSlots, cp.InvariantConfig.RawResources.RawPriority); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this change. Experiments use slots per trial, not slots, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

You cannot set slots in the experiment config; you'll get an error. We should check that SlotsPerTrial is within MaxSlots ?

Does that make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

If that's the case, @amandavialva01 can you also update the logic here to use slots per trial?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ooh my mistake! Changed this. I think the actual discrepancy was coming from the < / > issue that Kristine mentioned

Copy link
Contributor

Choose a reason for hiding this comment

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

Synced with Bradley - for NTSC we'll compare "slots" to "constraints.resources.max_slots" and for experiments we'll compare "slotsPerTrial" to "constraints.resources.max_slots".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense! Yea I just saw the comment in the ResourcesConfig struct, somehow glossed over that before lol

@amandavialva01 amandavialva01 force-pushed the amanda/fixConfigComplyWithConstraints branch 2 times, most recently from cf10e8e to 475fc41 Compare October 15, 2024 16:33
@amandavialva01 amandavialva01 force-pushed the amanda/fixConfigComplyWithConstraints branch from 475fc41 to 655f635 Compare October 15, 2024 19:56
@@ -309,3 +310,45 @@ func TestUnmarshalJSONNTSC(t *testing.T) {
})
}
}

func TestCheckConstraintsConflicts(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice tests!

Copy link
Contributor

@kkunapuli kkunapuli left a comment

Choose a reason for hiding this comment

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

LGTM!

@amandavialva01 amandavialva01 enabled auto-merge (squash) October 15, 2024 21:06
@amandavialva01 amandavialva01 merged commit 3fc9fed into main Oct 15, 2024
82 of 94 checks passed
@amandavialva01 amandavialva01 deleted the amanda/fixConfigComplyWithConstraints branch October 15, 2024 22:51
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.

3 participants