etha.tensor_bus.agent#

Tensor Bus Agent Process.

Attributes#

Classes#

TensorBusAgent

Tensor Bus Agent.

Module Contents#

class etha.tensor_bus.agent.TensorBusAgent(rank: int, world_size: int, store_host: str, store_port: int, lmdb_command_queue_path: str, lmdb_state_path: str, store_timeout: float = 3600.0, store_backend: str = 'tcp', store_namespace: str | None = None, dist_backend: str | None = None)#

Tensor Bus Agent.

Initialize Agent.

Parameters:
  • rank – Rank in the torch.distributed group

  • world_size – Total number of Agents

  • store_host – KVStore server host

  • store_port – KVStore server port

  • lmdb_command_queue_path – Path to CommandQueue LMDB

  • lmdb_state_path – Path to State LMDB

  • store_timeout – KVStore connection timeout in seconds

  • store_backend – KVStore backend (“tcp” or “etcd”)

  • dist_backend – torch.distributed backend string. Defaults to “cuda:nccl,cpu:gloo” on CUDA hosts and “cpu:gloo” otherwise (CPU instantiation exists for the gloo test ladder).

close(destroy: bool = True)#

Cleanup resources.

run()#

Main loop: process commands from Host.

step() → bool#

One loop iteration: heartbeat, one command, pending-pair polling.

Split out of run so tests (and future embedders) can drive the agent single-stepped. Returns True when a command was processed.

batches: dict[str, etha.tensor_bus.batch_state.BatchState]#
command_queue#
lmdb_state_path#
pairs: dict[str, etha.tensor_bus.pair_state.PairState]#
pending_pairs: dict[str, _PendingPair]#
rank#
state_db#
state_env#
store: etha.kvstore.KVStore#
world_size#
etha.tensor_bus.agent.COMMAND_ERROR_TTL = 1800.0#
etha.tensor_bus.agent.TIME_INTERVAL = 0.001#
etha.tensor_bus.agent.logfire = None#
etha.tensor_bus.agent.logger#