mstar.graph.graph_io#
Functions
Classes
|
Primary interface between the worker execution loop and a computation graph. |
- class mstar.graph.graph_io.WorkerGraphIO(graph, wg_id=None)[source]#
Bases:
objectPrimary interface between the worker execution loop and a computation graph.
The worker calls ingest_input with arriving edges, reads ready_node_names to pick a node to run, calls mark_node_complete, and routes the returned output edges. register_loop_finish_signal handles externally-signalled loop termination (e.g. EOS).
- Parameters:
graph (GraphSection)
wg_id (str | None)
- clear_speculative_inputs()[source]#
Clear all speculative buffers — call when discarding a speculative schedule.
- Return type:
None
- ingest_for_speculation(edges, source_node)[source]#
Ingest an set of anticipated output edges into speculative buffers.
Returns a list of nodes that are ready to be specilatively executed: (A) if the same as source_node, that speculative & next_iter & streaming cover all of the inputs.
if not the same, that speculative & inputs & streaming cover the inputs.
- Parameters:
- Return type:
- ingest_input(graph_edge, can_buffer=True)[source]#
Route an arriving edge to its destination node.
Returns False when the edge isn’t claimed here:
next_nodenot in this graph, OR the node exists but rejected the edge (name mismatch / both ready slots full — see GraphNode.ingest_input). Callers should treat the False return as “try the next destination” (cross-worker routing or StreamBuffer re-queue).
- mark_node_complete(node_name)[source]#
Signal that a node has finished executing.
The caller must route each edge in output_edges, skipping any in filtered_signals.
- Parameters:
node_name (str)
- Return type:
- property ready_for_streaming#
- property ready_node_names#