taps.executor.ray¶
RayExecutor
¶
Bases: Executor
Ray execution engine.
Note
Ray will raise a serialization error if a
Proxy[bytes]
is passed to or returned
by a function. This is because Ray skips serializing bytes
instances. Ray works with all other types of proxies, so if you need
to send bytes
data, wrap the data in another type.
Parameters:
-
address
(str | None
, default:'local'
) –Address to pass to
ray.init()
. -
num_cpus
(int | None
, default:None
) –Number of CPUs to use.
Source code in taps/executor/ray.py
submit
¶
Schedule the callable to be executed.
Parameters:
-
function
(Callable[P, T]
) –Callable to execute.
-
args
(args
, default:()
) –Positional arguments.
-
kwargs
(kwargs
, default:{}
) –Keyword arguments.
Returns:
Source code in taps/executor/ray.py
RayConfig
¶
Bases: ExecutorConfig
RayExecutor
plugin configuration.
Parameters:
-
name
(Literal[str]
, default:'ray'
) –Executor name.
-
address
(str | None
, default:'local'
) –Ray scheduler address (default spawns local cluster).
-
num_cpus
(int | None
, default:None
) –Maximum number of CPUs that ray will use.
get_executor
¶
get_executor() -> RayExecutor