nemo_deploy.deploy_ray#
Module Contents#
Classes#
A class for managing Ray deployment and serving of models. |
Data#
API#
- nemo_deploy.deploy_ray.LOGGER = 'getLogger(...)'#
- class nemo_deploy.deploy_ray.DeployRay(
- address: str = 'auto',
- num_cpus: int = 1,
- num_gpus: int = 1,
- include_dashboard: bool = False,
- ignore_reinit_error: bool = True,
- runtime_env: dict = None,
A class for managing Ray deployment and serving of models.
This class provides functionality to initialize Ray, start Ray Serve, deploy models, and manage the lifecycle of the Ray cluster.
.. attribute:: address
The address of the Ray cluster to connect to.
- Type:
str
.. attribute:: num_cpus
Number of CPUs to allocate for the Ray cluster.
- Type:
int
.. attribute:: num_gpus
Number of GPUs to allocate for the Ray cluster.
- Type:
int
.. attribute:: include_dashboard
Whether to include the Ray dashboard.
- Type:
bool
.. attribute:: ignore_reinit_error
Whether to ignore errors when reinitializing Ray.
- Type:
bool
.. attribute:: runtime_env
Runtime environment configuration for Ray.
- Type:
dict
Initialization
Initialize the DeployRay instance and set up the Ray cluster.
- Parameters:
address (str, optional) β Address of the Ray cluster. Defaults to βautoβ.
num_cpus (int, optional) β Number of CPUs to allocate. Defaults to 1.
num_gpus (int, optional) β Number of GPUs to allocate. Defaults to 1.
include_dashboard (bool, optional) β Whether to include the dashboard. Defaults to False.
ignore_reinit_error (bool, optional) β Whether to ignore reinit errors. Defaults to True.
runtime_env (dict, optional) β Runtime environment configuration. Defaults to None.
- Raises:
Exception β If Ray is not installed.
- start(host: str = '0.0.0.0', port: int = None)[source]#
Start Ray Serve with the specified host and port.
- Parameters:
host (str, optional) β Host address to bind to. Defaults to β0.0.0.0β.
port (int, optional) β Port number to use. If None, an available port will be found.