-
Notifications
You must be signed in to change notification settings - Fork 327
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
[Ray] Implements get_total_n_cpu for Ray execution context #3059
[Ray] Implements get_total_n_cpu for Ray execution context #3059
Conversation
mars/services/task/execution/ray/tests/test_ray_execution_backend.py
Outdated
Show resolved
Hide resolved
@implements(Context.get_total_n_cpu) | ||
def get_total_n_cpu(self) -> int: | ||
# TODO(fyrestone): Support auto scaling. | ||
return self._config.get_n_cpu() * self._config.get_n_worker() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What happed if
n_cpu
andn_worker
not configured into ray config? - Seems no case cover this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why mars
doesn't need to implement get_total_n_cpu
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- What happed if
n_cpu
andn_worker
not configured into ray config?- Seems no case cover this
The n_cpu
and n_worker
will be set when starting local cluster: https://github.com/mars-project/mars/blob/master/mars/deploy/oscar/local.py#L162. If these fields are not set, there should be a bug.
Mars backend has implemented the get_total_n_cpu
API: https://github.com/mars-project/mars/blob/master/mars/services/context.py#L113
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…3059) (#3104) Co-authored-by: Liu Bao <[email protected]>
What do these changes do?
get_total_n_cpu
for Ray execution context.Related issue number
#2893
Check code requirements