mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 17:45:08 +08:00
Adding basic support for a user-interpretable resource label (#761)
* adding support for the user-interpretable label(UIR) * more plumbing for num_uirs further upstream; set to infty when specified on cmd line * pass default num_uirs for actors; update GlobalStateAPI * support num_uirs in ray.init() * local scheduler resource accounting: support num_uirs; prep for vectorized resource accounting * global scheduler test updated * Fix bug introduced by rebase. * Rename UIR -> CustomResource and add test. * Small changes and use constexpr instead of macros. * Linting and some renaming. * Reorder some code. * Remove cpus_in_use and fix bug. * Add another test and make a small change. * Rephrase documentation about feature stability.
This commit is contained in:
committed by
Philipp Moritz
parent
03f2325780
commit
fc885bd918
+4
-1
@@ -105,6 +105,7 @@ def fetch_and_register_actor(actor_class_key, worker):
|
||||
FunctionProperties(num_return_vals=1,
|
||||
num_cpus=1,
|
||||
num_gpus=0,
|
||||
num_custom_resource=0,
|
||||
max_calls=0))
|
||||
worker.num_task_executions[driver_id][function_id] = 0
|
||||
|
||||
@@ -174,6 +175,7 @@ def export_actor(actor_id, class_id, actor_method_names, num_cpus, num_gpus,
|
||||
FunctionProperties(num_return_vals=1,
|
||||
num_cpus=1,
|
||||
num_gpus=0,
|
||||
num_custom_resource=0,
|
||||
max_calls=0))
|
||||
|
||||
# Select a local scheduler for the actor.
|
||||
@@ -259,7 +261,8 @@ def reconstruct_actor_state(actor_id, worker):
|
||||
hex_to_object_id(task_spec_info["ActorID"]),
|
||||
task_spec_info["ActorCounter"],
|
||||
[task_spec_info["RequiredResources"]["CPUs"],
|
||||
task_spec_info["RequiredResources"]["GPUs"]])
|
||||
task_spec_info["RequiredResources"]["GPUs"],
|
||||
task_spec_info["RequiredResources"]["CustomResource"]])
|
||||
|
||||
# Verify that the return object IDs are the same as they were the
|
||||
# first time.
|
||||
|
||||
Reference in New Issue
Block a user