Skip to content

dlgforge.distributed.ray_runtime

Ray actor construction and runtime helpers.

import_ray()

Import ray.

Returns:

Name Type Description
Any Any

Value produced by this API.

Raises:

Type Description
RuntimeError

Raised when validation or runtime requirements are not met.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.distributed.ray_runtime import import_ray
>>> import_ray(...)

create_worker_actor(role, num_cpus=1.0, num_gpus=0.0)

Create worker actor.

Parameters:

Name Type Description Default
role str

str value used by this operation.

required
num_cpus float

float value used by this operation.

1.0
num_gpus float

float value used by this operation.

0.0

Returns:

Name Type Description
Any Any

Value produced by this API.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.distributed.ray_runtime import create_worker_actor
>>> create_worker_actor(...)

create_coordinator_actor(num_cpus=1.0)

Create coordinator actor.

Parameters:

Name Type Description Default
num_cpus float

float value used by this operation.

1.0

Returns:

Name Type Description
Any Any

Value produced by this API.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.distributed.ray_runtime import create_coordinator_actor
>>> create_coordinator_actor(...)

create_vllm_server_actor(num_cpus=1.0, num_gpus=1.0)

Create vllm server actor.

Parameters:

Name Type Description Default
num_cpus float

float value used by this operation.

1.0
num_gpus float

float value used by this operation.

1.0

Returns:

Name Type Description
Any Any

Value produced by this API.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.distributed.ray_runtime import create_vllm_server_actor
>>> create_vllm_server_actor(...)