[Core] Accelerator type API (#10561)

This commit is contained in:
Alex Wu
2020-09-06 20:58:40 -07:00
committed by GitHub
parent a699f6a4d8
commit d6a9f0e2e4
10 changed files with 133 additions and 30 deletions
+15
View File
@@ -220,6 +220,21 @@ load balancing, gang scheduling, and priority-based scheduling.
:noindex:
Accelerator Types
------------------
Ray supports resource specific accelerator types. The `accelerator_type` field can be used to force to a task to run on a node with a specific type of accelerator. Under the hood, the accelerator type option is implemented as a custom resource demand of ``"accelerator_type:<type>": 0.001``. This forces the task to be placed on a node with that particular accelerator type available. This also lets the multi-node-type autoscaler know that there is demand for that type of resource, potentially triggering the launch of new nodes providing that accelerator.
.. code-block:: python
from ray.accelerators import NVIDIA_TESLA_V100
@ray.remote(num_gpus=1, accelerator_type=NVIDIA_TESLA_V100)
def train(data):
return "This function was run on a node with a Tesla V100 GPU"
See `ray.util.accelerators` to see available accelerator types. Current automatically detected accelerator types include Nvidia GPUs.
Nested Remote Functions
-----------------------