mstar.utils.ipc_format#
Classes
|
|
|
|
|
|
|
|
|
A worker reporting requests it can no longer serve. |
|
|
|
|
|
|
|
|
|
A rank's offloads and reloads, in the order it made them. |
|
An entity confirming it has no in-flight reads for a request and will start none — the conductor's gate before sending the hard RemoveRequest. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- class mstar.utils.ipc_format.AbortRequest(request_id: str)[source]#
Bases:
MessageBody- Parameters:
request_id (str)
- class mstar.utils.ipc_format.ConductorMessage(message_type: mstar.utils.ipc_format.ConductorMessageType, body: mstar.utils.ipc_format.MessageBody)[source]#
Bases:
object- Parameters:
message_type (ConductorMessageType)
body (MessageBody)
- body: MessageBody#
- message_type: ConductorMessageType#
- class mstar.utils.ipc_format.ConductorMessageType(*values)[source]#
Bases:
Enum- ABORT_REQUEST = 'abort_request'#
- FAIL_REQUESTS = 'fail_requests'#
- NEW_REQUEST = 'new_request'#
- READS_DONE = 'reads_done'#
- SETUP_DONE = 'setup_done'#
- WORKER_GRAPHS_DONE = 'worker_graphs_done'#
- class mstar.utils.ipc_format.DrainRequest(request_id: str, source: int = <MessageSource.CONDUCTOR: 0>)[source]#
Bases:
MessageBody
- class mstar.utils.ipc_format.FailRequests(errors)[source]#
Bases:
MessageBodyA worker reporting requests it can no longer serve.
errorsmaps request_id -> message. It’s a dict rather than a (rids, message) pair because per-rid stages (prepare_inputs, postprocess) attribute a distinct error to each request, and one step can fail several of them for different reasons.
- class mstar.utils.ipc_format.InputSignals(request_id: str, inputs: list[mstar.graph.base.GraphEdge], request_info: mstar.conductor.request_info.CurrentForwardPassInfo, partition_name: str = 'default', producer_done: set[str] = <factory>)[source]#
Bases:
MessageBody- Parameters:
- request_info: CurrentForwardPassInfo#
- class mstar.utils.ipc_format.MessageSource(*values)[source]#
Bases:
IntEnum- CONDUCTOR = 0#
- SELF = 2#
- TP_RANK_0 = 1#
- class mstar.utils.ipc_format.NewRequest(request_id: str, partition_worker_graph_ids: list[int], worker_graph_to_workers: dict[int, list[str]], initial_inputs: list[mstar.graph.base.GraphEdge], request_info: mstar.conductor.request_info.CurrentForwardPassInfo)[source]#
Bases:
MessageBody- Parameters:
- request_info: CurrentForwardPassInfo#
- class mstar.utils.ipc_format.NewRequestConductor(request_id: str, initial_signals: dict[str, list[mstar.graph.base.TensorPointerInfo]], initial_input_modalities: list[str], initial_output_modalities: list[str], input_metadata: dict[str, list[dict]], model_kwargs: dict)[source]#
Bases:
MessageBody- Parameters:
- initial_signals: dict[str, list[TensorPointerInfo]]#
- class mstar.utils.ipc_format.OffloadDelta(rids=<factory>, is_offload=<factory>)[source]#
Bases:
objectA rank’s offloads and reloads, in the order it made them.
Ordered so the follower replays the leader’s decisions in the same order: a sequence that worked for the leader works for the followers too.
Holds WIRE request ids, not worker-local handles: a handle is minted per worker, so rank 0’s would name different requests on the follower.
A dataclass of lists rather than a NamedTuple of deques so that the wire codec can automatically encode it.
pop_leftis O(n) on a list, which costs nothing at the handful of entries a delta ever holds.__len__is the queue depth, so an empty delta is falsy – several callers lean on that.- copy()[source]#
An independent queue holding the same moves.
One per follower: each replays at its own pace, popping as it goes.
- Return type:
- extend(other)[source]#
- Parameters:
other (OffloadDelta)
- Return type:
None
- class mstar.utils.ipc_format.ReadsDone(request_id, entity_id)[source]#
Bases:
MessageBodyAn entity confirming it has no in-flight reads for a request and will start none — the conductor’s gate before sending the hard RemoveRequest.
- class mstar.utils.ipc_format.RemoveRequest(request_id: str, source: int = <MessageSource.CONDUCTOR: 0>, after_tp_seq: int = -1)[source]#
Bases:
MessageBody
- class mstar.utils.ipc_format.ScheduleTPNode(node_name: str, graph_walk: str, request_ids: list[str], speculative: bool = False, spec_seq: int = -1, spec_from_seq: int = -1, resident_delta: mstar.utils.ipc_format.OffloadDelta = <factory>)[source]#
Bases:
MessageBody- Parameters:
- resident_delta: OffloadDelta#
- class mstar.utils.ipc_format.SetupDone(worker_id: str)[source]#
Bases:
MessageBody- Parameters:
worker_id (str)
- class mstar.utils.ipc_format.Status(*values)[source]#
Bases:
Enum- DONE = 'done'#
- IN_PROGRESS = 'in_progress'#
- READY = 'ready'#
- WAITING = 'waiting'#
- class mstar.utils.ipc_format.StopLoops(request_id: str, loop_names: set[str], partition_name: str, loop_stop_times: dict[str, mstar.graph.loop_indices.NestedLoopIndices] = <factory>)[source]#
Bases:
MessageBody- Parameters:
- loop_stop_times: dict[str, NestedLoopIndices]#
- class mstar.utils.ipc_format.TPNoSpeculation(node_name: str, graph_walk: str, spec_from_seq: int)[source]#
Bases:
MessageBody
- class mstar.utils.ipc_format.TensorReceived(request_id: str, successful_tensors: dict[int, int], failed_tensor_ids: list[int])[source]#
Bases:
MessageBody
- class mstar.utils.ipc_format.UnpersistTensors(request_id: str, uuid_to_ref_count: dict[int, int])[source]#
Bases:
MessageBody
- class mstar.utils.ipc_format.WorkerGraphsDone(request_id: str, worker_graph_ids: list[int], is_first_tp_rank: bool, persist_signals: dict[str, list[mstar.graph.base.TensorPointerInfo]] = <factory>, new_token_counts: dict[str, int] = <factory>, output_signal_names: list[str] = <factory>, resource_publish_info: dict[str, mstar.engine.resources.base.PublishedInfo] = <factory>, partition_name: str = 'default', partition_done: bool = False, stream_tokens_consumed: dict[str, int] = <factory>, output_loop_indices: dict[str, mstar.graph.loop_indices.NestedLoopIndices] = <factory>, graph_timings: dict[tuple[str, str], mstar.profile.format.GraphTiming] = <factory>, rx_info: list[mstar.profile.format.RxInfo] = <factory>, tx_info: list[mstar.profile.format.TxInfo] = <factory>)[source]#
Bases:
MessageBody- Parameters:
- output_loop_indices: dict[str, NestedLoopIndices]#
- persist_signals: dict[str, list[TensorPointerInfo]]#
- resource_publish_info: dict[str, PublishedInfo]#
- class mstar.utils.ipc_format.WorkerMessage(message_type: mstar.utils.ipc_format.WorkerMessageType, body: mstar.utils.ipc_format.MessageBody)[source]#
Bases:
object- Parameters:
message_type (WorkerMessageType)
body (MessageBody)
- body: MessageBody#
- message_type: WorkerMessageType#
- class mstar.utils.ipc_format.WorkerMessageType(*values)[source]#
Bases:
Enum- DRAIN_REQUEST = 'drain_request'#
- INPUT_SIGNALS = 'input_signals'#
- NEW_REQUEST = 'new_request'#
- REMOVE_REQUEST = 'remove_request'#
- SCHEDULE_TP = 'schedule_tp'#
- STOP_LOOPS = 'stop_loops'#
- TENSOR_RECEIVED = 'tensor_received'#
- TP_NO_SPEC = 'tp_no_spec'#
- UNPERSIST_TENSORS = 'unpersist'#