mirror of
https://github.com/wassname/ray.git
synced 2026-09-11 12:43:20 +08:00
[Core] Accelerator type API (#10561)
This commit is contained in:
@@ -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
|
||||
-----------------------
|
||||
|
||||
Reference in New Issue
Block a user