mirror of
https://github.com/wassname/ray.git
synced 2026-08-06 13:31:10 +08:00
Enable by default new scheduler (#12735)
This commit is contained in:
@@ -113,7 +113,7 @@ RAY_CONFIG(bool, lineage_pinning_enabled, false)
|
||||
/// only to work with direct calls. Once direct calls are becoming
|
||||
/// the default, this scheduler will also become the default.
|
||||
RAY_CONFIG(bool, new_scheduler_enabled,
|
||||
getenv("RAY_ENABLE_NEW_SCHEDULER") != nullptr &&
|
||||
getenv("RAY_ENABLE_NEW_SCHEDULER") == nullptr ||
|
||||
getenv("RAY_ENABLE_NEW_SCHEDULER") == std::string("1"))
|
||||
|
||||
// The max allowed size in bytes of a return object from direct actor calls.
|
||||
|
||||
@@ -2951,6 +2951,9 @@ void NodeManager::HandlePinObjectIDs(const rpc::PinObjectIDsRequest &request,
|
||||
void NodeManager::HandleGetNodeStats(const rpc::GetNodeStatsRequest &node_stats_request,
|
||||
rpc::GetNodeStatsReply *reply,
|
||||
rpc::SendReplyCallback send_reply_callback) {
|
||||
if (new_scheduler_enabled_) {
|
||||
cluster_task_manager_->FillPendingActorInfo(reply);
|
||||
}
|
||||
for (const auto &task : local_queues_.GetTasks(TaskState::INFEASIBLE)) {
|
||||
if (task.GetTaskSpecification().IsActorCreationTask()) {
|
||||
auto infeasible_task = reply->add_infeasible_tasks();
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
namespace ray {
|
||||
namespace raylet {
|
||||
|
||||
// The max number of pending actors to report in node stats.
|
||||
const int kMaxPendingActorsToReport = 20;
|
||||
|
||||
ClusterTaskManager::ClusterTaskManager(
|
||||
const NodeID &self_node_id,
|
||||
std::shared_ptr<ClusterResourceScheduler> cluster_resource_scheduler,
|
||||
@@ -330,6 +333,39 @@ bool ClusterTaskManager::CancelTask(const TaskID &task_id) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void ClusterTaskManager::FillPendingActorInfo(rpc::GetNodeStatsReply *reply) const {
|
||||
// Report infeasible actors.
|
||||
int num_reported = 0;
|
||||
for (const auto &shapes_it : infeasible_tasks_) {
|
||||
auto &work_queue = shapes_it.second;
|
||||
for (const auto &work_it : work_queue) {
|
||||
Task task = std::get<0>(work_it);
|
||||
if (task.GetTaskSpecification().IsActorCreationTask()) {
|
||||
if (num_reported++ > kMaxPendingActorsToReport) {
|
||||
break; // Protect the raylet from reporting too much data.
|
||||
}
|
||||
auto infeasible_task = reply->add_infeasible_tasks();
|
||||
infeasible_task->CopyFrom(task.GetTaskSpecification().GetMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Report actors blocked on resources.
|
||||
num_reported = 0;
|
||||
for (const auto &shapes_it : boost::join(tasks_to_dispatch_, tasks_to_schedule_)) {
|
||||
auto &work_queue = shapes_it.second;
|
||||
for (const auto &work_it : work_queue) {
|
||||
Task task = std::get<0>(work_it);
|
||||
if (task.GetTaskSpecification().IsActorCreationTask()) {
|
||||
if (num_reported++ > kMaxPendingActorsToReport) {
|
||||
break; // Protect the raylet from reporting too much data.
|
||||
}
|
||||
auto ready_task = reply->add_infeasible_tasks();
|
||||
ready_task->CopyFrom(task.GetTaskSpecification().GetMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClusterTaskManager::FillResourceUsage(
|
||||
bool light_report_resource_usage_enabled,
|
||||
std::shared_ptr<rpc::ResourcesData> data) const {
|
||||
|
||||
@@ -105,6 +105,11 @@ class ClusterTaskManager {
|
||||
/// false if the task is already running.
|
||||
bool CancelTask(const TaskID &task_id);
|
||||
|
||||
/// Populate the list of pending or infeasible actor tasks for node stats.
|
||||
///
|
||||
/// \param Output parameter.
|
||||
void FillPendingActorInfo(rpc::GetNodeStatsReply *reply) const;
|
||||
|
||||
/// Populate the relevant parts of the heartbeat table. This is intended for
|
||||
/// sending raylet <-> gcs heartbeats. In particular, this should fill in
|
||||
/// resource_load and resource_load_by_shape.
|
||||
|
||||
Reference in New Issue
Block a user