[train] Fix ScalingConfig(accelerator_type) to request a small fraction of the accelerator label#44225
Merged
justinvyu merged 2 commits intoray-project:masterfrom Mar 22, 2024
Conversation
Signed-off-by: Justin Yu <justinvyu@anyscale.com>
matthewdeng
reviewed
Mar 21, 2024
| if self.accelerator_type: | ||
| accelerator = f"{RESOURCE_CONSTRAINT_PREFIX}{self.accelerator_type}" | ||
| resources_per_worker.setdefault(accelerator, 1) | ||
| resources_per_worker.setdefault(accelerator, 0.001) |
Contributor
There was a problem hiding this comment.
Can we make this a constant (or use an existing one if it already exists)?
Member
There was a problem hiding this comment.
ray/python/ray/_private/utils.py
Lines 389 to 392 in 2747c80
Seems core team directly use 0.001 here.
Contributor
There was a problem hiding this comment.
@jjyao cool if we extract this into a constant? Gives it some concrete meaning 🙂
stephanie-wang
pushed a commit
to stephanie-wang/ray
that referenced
this pull request
Mar 27, 2024
…tion of the accelerator label (ray-project#44225) Make Ray Train's accelerator type resource request match Ray Core by setting it to a fractional value (0.001). This is needed to fix autoscaling behavior to request the correct number of GPUs. Signed-off-by: Justin Yu <justinvyu@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
accelerator_typeis currently implemented as a custom resource with a quantity of 1 if an instance has an accelerator of that type. For example, both a machine with 1 A10G GPU and a machine with 4 A10G GPUs will have{"accelerator_type:A10G": 1.0}. This label is just an indicator of whether the machine contains the accelerator, rather than a count of the number of accelerators of that type.This PR makes our accelerator type resource request match Ray Core by setting it to a fractional value (0.001). This is needed to fix autoscaling behavior to request the correct number of GPUs.
Related issue number
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/under thecorresponding
.rstfile.