# tensorplay.distributed.elastic.rendezvous API Source: https://www.tensorplay.cn/docs/api/tensorplay.distributed.elastic.rendezvous.html ## Functions 1 [#](#api-tensorplay.distributed.elastic.rendezvous.create_handler) ### create_handler function[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.create_handler.html) ```python tensorplay.distributed.elastic.rendezvous.create_handler(params: RendezvousParameters) → RendezvousHandler ``` Create a handler from the process-wide registry. ## Classes 9 [#](#api-tensorplay.distributed.elastic.rendezvous.DynamicRendezvousHandler) ### DynamicRendezvousHandler class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.DynamicRendezvousHandler.html) ```python class tensorplay.distributed.elastic.rendezvous.DynamicRendezvousHandler(backend: RendezvousBackend | _NodeDesc | None = None, settings: RendezvousSettings | None = None, local_addr: str | None = None, node_rank: int = 0, run_id: str = '', store: Store | None = None, backend_name: str = 'core', state_holder: _RendezvousStateHolder | None = None, node: _NodeDesc | None = None) ``` Coordinate membership, ranks, heartbeats, and round transitions. ```python pre_shutdown() → None ``` Optional hook invoked before shutdown() during agent teardown. [#](#api-tensorplay.distributed.elastic.rendezvous.P10dRendezvousBackend) ### P10dRendezvousBackend class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.P10dRendezvousBackend.html) ```python class tensorplay.distributed.elastic.rendezvous.P10dRendezvousBackend(store: Store, run_id: str) ``` Rendezvous state backend backed by a TP key/value Store. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousHandler) ### RendezvousHandler class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousHandler.html) ```python class tensorplay.distributed.elastic.rendezvous.RendezvousHandler ``` Algorithmic interface of one rendezvous backend. ```python abstractmethod get_backend() → str ``` Backend name (e.g. static or core). ```python abstractmethod get_run_id() → str ``` Run identifier of this rendezvous. ```python abstractmethod is_closed() → bool ``` Whether the rendezvous has been marked closed. ```python abstractmethod next_rendezvous() → RendezvousInfo ``` Join or re-join the rendezvous; blocks until this round completes. ```python abstractmethod num_nodes_waiting() → int ``` Number of nodes queued for the next round (pending scale-up). ```python pre_shutdown() → None ``` Optional hook invoked before [shutdown()](#tensorplay.distributed.elastic.rendezvous.RendezvousHandler.shutdown) during agent teardown. ```python abstractmethod set_closed() → None ``` Mark the rendezvous closed; new joiners are rejected. ```python abstractmethod shutdown() → bool ``` Release rendezvous resources; returns True when the backend shut down. ```python property use_agent_store: bool ``` Whether workers can reuse the agent-held store as their bootstrap store. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousInfo) ### RendezvousInfo class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousInfo.html) ```python class tensorplay.distributed.elastic.rendezvous.RendezvousInfo(store: Store, rank: int, world_size: int, bootstrap_store_info: RendezvousStoreInfo | None = None, participants: list | None = None, wait_list: list | None = None) ``` Outcome of a successful rendezvous for one agent. ```python property bootstrap_store_info: RendezvousStoreInfo | None ``` Connection info for the worker-facing bootstrap store. ```python property participants: list ``` Nodes participating in this round. ```python property rank: int ``` This agent’s rank within the rendezvous. ```python property store: Store ``` Shared store for this rendezvous round. ```python property wait_list: list ``` Nodes waiting for a future round. ```python property world_size: int ``` Number of participating agents. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousParameters) ### RendezvousParameters class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousParameters.html) ```python class tensorplay.distributed.elastic.rendezvous.RendezvousParameters(backend: str, endpoint: str, run_id: str, *args, min_nodes: int | None = None, max_nodes: int | None = None, local_addr: str | None = None, node_rank: int = 0, local_world_size: int = 1, config: dict | None = None, **kwargs) ``` Parameters describing one rendezvous request. endpoint is host:port of the rendezvous store, local_addr the address of this node (autodetected when empty), and config carries backend-specific options accessible through [get()](#tensorplay.distributed.elastic.rendezvous.RendezvousParameters.get). ```python get(key: str, default=None) ``` Return backend parameter key or default. ```python get_as_bool(key: str, default: bool | None = None) → bool | None ``` Return key coerced to bool (accepts 1/0/true/false). ```python get_as_int(key: str, default: int | None = None) → int | None ``` Return key coerced to int. ```python property timeout: RendezvousTimeout ``` Timeouts assembled from join/last_call/close/heartbeat params (seconds). [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousSettings) ### RendezvousSettings class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousSettings.html) ```python class tensorplay.distributed.elastic.rendezvous.RendezvousSettings(*args: Any, join: timedelta | None = None, last_call: timedelta | None = None, close: timedelta | None = None, heartbeat: timedelta | None = None, min_nodes: int = 1, max_nodes: int = 1, run_id: str = '', timeout: RendezvousTimeout | None = None, keep_alive_interval: timedelta | None = None, keep_alive_max_attempt: int = 3) ``` Configuration shared by the rendezvous state machine. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousStoreInfo) ### RendezvousStoreInfo class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousStoreInfo.html) ```python class tensorplay.distributed.elastic.rendezvous.RendezvousStoreInfo(master_addr: str, port: int) ``` Connection information for the bootstrap store handed to workers. ```python property addr: str ``` Alias of master_addr. ```python classmethod build(rank: int, store: Store, local_addr: str | None = None, server_port: int | None = None) ``` Derive store info for rank from the rendezvous store. Rank 0 owns the address/port pair: it uses the store’s own listening endpoint when available and otherwise publishes one through the store so every other rank can read it. [#](#api-tensorplay.distributed.elastic.rendezvous.StaticTCPRendezvous) ### StaticTCPRendezvous class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.StaticTCPRendezvous.html) ```python class tensorplay.distributed.elastic.rendezvous.StaticTCPRendezvous(params: RendezvousParameters | str, master_port: int | None = None, rank: int = 0, world_size: int = 1, run_id: str = '', timeout: int = 600) ``` One-shot rendezvous over a static TCPStore endpoint. ```python pre_shutdown() → None ``` Optional hook invoked before shutdown() during agent teardown. [#](#api-tensorplay.distributed.elastic.rendezvous.TpRendezvousBackend) ### TpRendezvousBackend class[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.TpRendezvousBackend.html) ```python class tensorplay.distributed.elastic.rendezvous.TpRendezvousBackend(store: Store, run_id: str) ``` Store rendezvous state behind compare-and-set operations. ## Exceptions 7 [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousClosedError) ### RendezvousClosedError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousClosedError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousClosedError ``` The rendezvous has been closed and accepts no more participants. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousConnectionError) ### RendezvousConnectionError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousConnectionError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousConnectionError ``` The rendezvous backend store could not be reached. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousError) ### RendezvousError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousError ``` Base class for all rendezvous failures. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousExhaustedError) ### RendezvousExhaustedError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousExhaustedError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousExhaustedError(config, timeout) ``` The rendezvous join window elapsed without reaching min nodes. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousGracefulExitError) ### RendezvousGracefulExitError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousGracefulExitError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousGracefulExitError ``` Raised to unwind an agent when it is the last node leaving. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousStateError) ### RendezvousStateError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousStateError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousStateError ``` The rendezvous state is corrupt or the backend rejected an update. [#](#api-tensorplay.distributed.elastic.rendezvous.RendezvousTimeoutError) ### RendezvousTimeoutError exception[Full reference ↗](/docs/generated/tensorplay.distributed.elastic.rendezvous.RendezvousTimeoutError.html) ```python exception tensorplay.distributed.elastic.rendezvous.RendezvousTimeoutError ``` A rendezvous phase exceeded its time budget.