etha.tensor_bus.commands#
Command (Host to Tensor Bus) Definitions and State Structures.
Attributes#
Classes#
Base class for all Tensor Bus commands. |
|
Cleanup a batch's state in the agent. |
|
Init a Device Mesh + Placement to Device Mesh + Placement pair. |
|
Query status for a batch. |
|
Register multiple tensors for zero-copy sharing between processes. |
|
Transfer tensor command for a specific batch. |
Module Contents#
- class etha.tensor_bus.commands.BaseCommand#
Bases:
msgspec.StructBase class for all Tensor Bus commands.
Features: - Auto-tagging: Uses class name as type tag - Common timestamp field for all commands - Optional semaphore for completion notification
- class etha.tensor_bus.commands.CleanupBatch#
Bases:
BaseCommandCleanup a batch’s state in the agent.
- class etha.tensor_bus.commands.InitPair#
Bases:
BaseCommandInit a Device Mesh + Placement to Device Mesh + Placement pair.
- Parameters:
pair_name – Unique identifier for this pair (e.g., “obs”, “action”)
local_name – Name of local peer (e.g., “inference”, “training”)
expected_world_size – Number of ranks for local peer
remote_name – Name of remote peer (explicit pairing)
mesh_shape_payload – Serialized mesh shape tuple as memoryview
placements_payload – Serialized placements tuple as memoryview
- mesh_shape_payload: memoryview | None = None#
- placements_payload: memoryview | None = None#
- class etha.tensor_bus.commands.QueryStatus#
Bases:
BaseCommandQuery status for a batch.
- class etha.tensor_bus.commands.RegisterTensors#
Bases:
BaseCommandRegister multiple tensors for zero-copy sharing between processes.
Creates a new batch with a unique batch_id. Multiple tensors can be registered across different pairs in a single batch, enabling efficient cross-pair execution via flattened chunks/buckets.
- tensors: list[tuple[str, memoryview]]#
- class etha.tensor_bus.commands.Transfer#
Bases:
BaseCommandTransfer tensor command for a specific batch.
- transfer_type: Literal['send', 'recv']#
- etha.tensor_bus.commands.Message#