Introduce concept of resources required for placing a task.#2837
Introduce concept of resources required for placing a task.#2837atumanov merged 12 commits intoray-project:masterfrom
Conversation
|
Test PASSed. |
|
Test FAILed. |
There was a problem hiding this comment.
can we make it just a little less verbose than Java? How about GetRequiredPlacementResources
atumanov
left a comment
There was a problem hiding this comment.
partial set of comments for now.
There was a problem hiding this comment.
do we need to wrap this line? Hard to tell, but looks like < 90chars to me if combined. Ignore if not the case.
There was a problem hiding this comment.
are you trying to generate a json-compatible string here? I wonder if we should just use the json library or add a ToJson() method that explicitly does that.
There was a problem hiding this comment.
The goal was not to make a JSON compatible string, but rather to make the printing nicer. This changes it from {GPU,1.000000}, {CPU,1.000000}, (note the extra comma and space at the end) to {GPU,1.000000}, {CPU,1.000000}.
There was a problem hiding this comment.
(can we reduce the number of decimals?)
There was a problem hiding this comment.
also there's no implode/join built-in for this?
|
Test FAILed. |
There was a problem hiding this comment.
const ref : const auto &spec to avoid a copy.
There was a problem hiding this comment.
const ref : const auto &spec (same as above)
|
Test FAILed. |
|
jenkins, retest this please |
|
Test FAILed. |
There was a problem hiding this comment.
Is it always 1 more? What about the num_cpus=0 or num_cpus=N case?
There was a problem hiding this comment.
Oh good catch, in that case it should be 0. I'll fix this.
There was a problem hiding this comment.
That was a bug!
There was a problem hiding this comment.
IMO this error message would be better if it reported the current state (i.e., resources currently used out of total resources in cluster)
There was a problem hiding this comment.
same here (more info about "no nodes have the necessary resources")
There was a problem hiding this comment.
(can we reduce the number of decimals?)
There was a problem hiding this comment.
also there's no implode/join built-in for this?
c75e887 to
e8c92bf
Compare
|
@raulchen @jovan-wong What is the correct procedure for updating I basically had to copy it over from What's the reason for committing the autogenerated files? |
|
Test FAILed. |
|
Test PASSed. |
|
Test FAILed. |
|
Test PASSed. |
|
@robertnishihara Thanks for reminding me about this. I took a look at But there is a problem that is not well resolved: How do you guys think of it? |
d991d43 to
2cf31d5
Compare
atumanov
left a comment
There was a problem hiding this comment.
Just a few minor comments. Made a full pass on C++.
| void NodeManager::SubmitTask(const Task &task, const Lineage &uncommitted_lineage, | ||
| bool forwarded) { | ||
| const TaskID task_id = task.GetTaskSpecification().TaskId(); | ||
| const TaskID &task_id = task.GetTaskSpecification().TaskId(); |
| int client_key_index = distribution(gen_); | ||
| const ClientID &dst_client_id = client_keys[client_key_index]; | ||
| decision[t.GetTaskSpecification().TaskId()] = dst_client_id; | ||
| decision[spec.TaskId()] = dst_client_id; |
There was a problem hiding this comment.
I think we can just use task_id here
| RAY_LOG(INFO) << "This task requires " | ||
| << t.GetTaskSpecification().GetRequiredResources().ToString() | ||
| << ", but no nodes have the necessary resources."; | ||
| RAY_LOG(INFO) << "The task with ID " << spec.TaskId() << " requires " |
There was a problem hiding this comment.
same, spec.TaskId() --> task_id
|
|
||
| bool ResourceSet::operator==(const ResourceSet &rhs) const { | ||
| return (this->IsSubset(rhs) && rhs.IsSubset(*this)); | ||
| return (IsSubset(rhs) && rhs.IsSubset(*this)); |
There was a problem hiding this comment.
actually, in the case where we overload binary operators, it's useful to keep this-> for code readability. You get "this" is a subset of the right hand side. Removing it makes it a little less clear what rhs is supposed to be a subset of (because this-> is implicit).
| /// Test whether this ResourceSet is precisely equal to the other ResourceSet. | ||
| bool ResourceSet::IsEqual(const ResourceSet &rhs) const { | ||
| return (this->IsSubset(rhs) && rhs.IsSubset(*this)); | ||
| return (IsSubset(rhs) && rhs.IsSubset(*this)); |
There was a problem hiding this comment.
same, I would prefer to keep this-> for readability when overloading binary operators of the form A.BinaryOperator(B).
| return false; | ||
| } | ||
| if (this->resource_capacity_.count(resource_name) == 0) { | ||
| if (resource_capacity_.count(resource_name) == 0) { |
There was a problem hiding this comment.
and here, it makes sense to drop this-> as you did.
| it++; | ||
|
|
||
| // Add the remaining elements to the string (along with a comma). | ||
| while (it != resource_capacity_.end()) { |
There was a problem hiding this comment.
why not:
for ( ; it != resource_capacity_.end() ; ++it )
But I don't have a strong opinion on this.
|
Test FAILed. |
|
Test FAILed. |
|
Test PASSed. |
This PR introduces the concept of "resources that are required for scheduling/placing a task", which are distinct from (and a superset of) "resources acquired during task execution". Typically, these two things are the same, however, in the case of actor creation tasks, we require additional resources to schedule the task on a node because it must take into account the future resource requirements of the actor methods. This fixes #2803.