mstar.streaming.topology#
Functions
|
Each client stream's limits: the model's declaration, with the serving config's |
|
|
|
Each client stream's consumer ( |
Classes
|
Where a client stream's items go: the node that consumes the edge, a walk it runs in (for routing to its workers) and its partition. |
|
Bounds on what the client feeds one client stream; None is unbounded. |
|
Defines a streaming connection between two partitions, or from the client ( |
|
Declares how a model's computation is split into async partitions. |
|
The producer's state for one pass that emits on a walk-driving edge. |
|
A graph edge that carries streaming data between partitions. |
- class mstar.streaming.topology.ClientStream(node, graph_walk, partition)[source]#
Bases:
NamedTupleWhere a client stream’s items go: the node that consumes the edge, a walk it runs in (for routing to its workers) and its partition.
- class mstar.streaming.topology.ClientStreamLimits(max_items=None, item_size=None, unit='items')[source]#
Bases:
NamedTupleBounds on what the client feeds one client stream; None is unbounded. A bound the model declares is the most its consumer can take; a deployment may lower it (
client_streams:in the serving config, seeclient_stream_limits()).
- class mstar.streaming.topology.Connection(from_partition, to_partition, edge_name, chunk_policy_factory, limits=None, consumer_walk=None)[source]#
Bases:
objectDefines a streaming connection between two partitions, or from the client (
from_partition=CLIENT) into one. Only a client stream takeslimits: a partition’s output is bounded by the model itself.- Parameters:
from_partition (str)
to_partition (str)
edge_name (str)
chunk_policy_factory (Callable[[], ChunkPolicy])
limits (ClientStreamLimits | None)
consumer_walk (Callable[[ProducerWalkCtx], str] | None)
- chunk_policy_factory: Callable[[], ChunkPolicy]#
- consumer_walk: Callable[[ProducerWalkCtx], str] | None = None#
- limits: ClientStreamLimits | None = None#
- class mstar.streaming.topology.PartitionTopology(partitions, connections=<factory>)[source]#
Bases:
objectDeclares how a model’s computation is split into async partitions.
Each partition has its own set of graph walks. Connections define streaming data flow between partitions via StreamBuffers.
- Parameters:
connections (list[Connection])
- check_walk_driving_connections()[source]#
A producer-triggered partition has one authority over its walk: all its incoming connections come from one producer and share one consumer_walk, so every edge’s items agree on the walk. Its chunks must not overlap either, since a chunk runs under exactly one walk.
- Return type:
None
- connections: list[Connection]#
- producer_triggered_partitions()[source]#
Partitions whose graph walk the stream drives, not the conductor.
- class mstar.streaming.topology.ProducerWalkCtx(producer_walk='', node='', loop_iters=<factory>, fwd_info=None)[source]#
Bases:
objectThe producer’s state for one pass that emits on a walk-driving edge.
The producer worker refills one instance for every call, since the hook runs per request on every emitting step: valid only during the call.
- Parameters:
- fwd_info: CurrentForwardPassInfo | None#
- class mstar.streaming.topology.StreamingGraphEdge(next_node, name, tensor_info=<factory>, persist=False, conductor_new_token=False, is_streaming=False, output_modality='', _persist_for_loop=False, _final_stream_chunk=False, _total_fanin=1, _shard_dim=None, target_partition='')[source]#
Bases:
GraphEdgeA graph edge that carries streaming data between partitions.
Routed like a normal GraphEdge (producer is unaware it’s streaming). On the consumer worker, the arriving tensors are buffered in a StreamBuffer and gated by a ChunkPolicy before satisfying the consuming node’s input.
- Parameters:
- mstar.streaming.topology.client_stream_limits(topology, model_config)[source]#
Each client stream’s limits: the model’s declaration, with the serving config’s
client_streams: {<edge name>: {max_items}}applied, asvalidate_deploymentaccepted it (seemstar.validation.client_streams).- Parameters:
topology (PartitionTopology)
model_config (Mapping | None)
- Return type:
- mstar.streaming.topology.find_client_stream(conn, walks, partitions)[source]#
conn’s consumer: the one node, over every walk, that takes the edge (asmstar.worker.stream_buffers.consumer_nodesresolves it), in a walk of the partition it flows into;ValueErrorfor a stream without one.- Parameters:
conn (Connection)
walks (Mapping[str, GraphSection])
partitions (Mapping[str, PartitionDefinition])
- Return type:
- mstar.streaming.topology.find_client_streams(model)[source]#
Each client stream’s consumer (
find_client_stream). The conductor reads it after the worker graphs are built (a model may shape its walks from the deployment, as BAGEL does), and names each node in its route to the data worker, whose copy of the model is unshaped.- Parameters:
model (Model)
- Return type: