xorbits.init#
- xorbits.init(address: Optional[str] = None, init_local: bool = _NoDefault.no_default, session_id: Optional[str] = None, timeout: Optional[float] = None, n_worker: int = 1, n_cpu: Union[int, str] = 'auto', mem_bytes: Union[int, str] = 'auto', cuda_devices: Union[List[int], List[List[int]], str] = 'auto', web: Union[bool, str] = 'auto', new: bool = True, storage_config: Optional[Dict] = None, **kwargs) None [source]#
Init Xorbits runtime locally or connect to an Xorbits cluster.
- Parameters
address (str, optional) –
if None which is default, address will be “127.0.0.1”, a local runtime will be initialized
if specify an address for creating a new local runtime, specify like
<ip>:<port>
if connect to a Xorbits cluster address, e.g.
http://<supervisor_ip>:<supervisor_web_port>
init_local (bool, no default value) –
Indicates if creating a new local runtime.
If has initialized,
init_local
cannot be True, it will skip creating,When address is None and not initialized,
init_local
will be True,Otherwise, if it’s not specified, False will be set.
session_id (str, optional) – Session ID, if not specified, a new ID will be auto generated.
timeout (float) – Timeout about creating a new runtime or connecting to an existing cluster.
n_worker (int, optional) –
How many workers to start when creating a local runtime.
Note
Take effect only when
init_local
is Truen_cpu (int, str) –
Number of CPUs, if
auto
, the number of cores will be specified.Note
Take effect only when
init_local
is Truemem_bytes (int, str) –
Memory to use, in bytes, if
auto
, total memory bytes will be specified.Note
Take effect only when
init_local
is Truecuda_devices (list of int, list of list) –
when
auto
which is default, all visible GPU devices will be usedWhen n_worker is 1, list of int can be specified, means the device indexes to use
When n_worker > 1, list of list can be specified for each worker.
Note
Take effect only when
init_local
is Trueweb (bool, str) –
If creating a web UI.
Note
Take effect only when
init_local
is Truenew (bool) –
If creating a new session when connecting to an existing cluster.
Note
Take effect only when
init_local
is Falsestorage_config (dict, optional) –
storage backend and its configuration when init a new local cluster. Using
shared_memory
storage backend by default. Currently, support shared_memory` andmmap
two options.Note
Take effect only when
init_local
is True