You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
818 B
Python
42 lines
818 B
Python
2 years ago
|
from dataclasses import dataclass
|
||
|
from enum import Enum
|
||
2 years ago
|
from typing import Any, Dict
|
||
2 years ago
|
|
||
|
from hivemind import PeerID
|
||
|
|
||
|
ModuleUID = str
|
||
2 years ago
|
UID_DELIMITER = "." # delimits parts of one module uid, e.g. "bloom.transformer.h.4.self_attention"
|
||
|
CHAIN_DELIMITER = " " # delimits multiple uids in a sequence, e.g. "bloom.layer3 bloom.layer4"
|
||
2 years ago
|
|
||
|
|
||
|
class ServerState(Enum):
|
||
|
OFFLINE = 0
|
||
|
JOINING = 1
|
||
|
ONLINE = 2
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class ServerInfo:
|
||
|
state: ServerState
|
||
|
throughput: float
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class RemoteModuleInfo:
|
||
2 years ago
|
"""A remote module that is served by one or more servers"""
|
||
|
|
||
2 years ago
|
uid: ModuleUID
|
||
|
servers: Dict[PeerID, ServerInfo]
|
||
2 years ago
|
|
||
|
|
||
|
@dataclass
|
||
|
class RemoteSpanInfo:
|
||
|
"""A chain of remote blocks served by one specific remote peer"""
|
||
|
|
||
|
start: int
|
||
|
end: int
|
||
|
peer_id: PeerID
|
||
2 years ago
|
|
||
|
|
||
|
RPCInfo = Dict[str, Any]
|