Expand description
Distributed inference runtime scaffolding.
This module provides lightweight execution planning primitives that bridge placement plans to token-step pipeline schedules across heterogeneous devices.
Structs§
- Bridge
Accumulator - Execution
Result - Aggregate runtime execution output.
- Pipeline
Plan - Pipeline execution plan for one model.
- Stage
Execution Stats - Per-stage runtime telemetry captured from real in-process execution.
- Stage
Placement - Placement of one contiguous layer range onto a node and device.
- Stage
Worker Summary - Summary a
stage-workerprocess reports (to its own stdout, and back to any caller driving it directly) once its one coordinator connection closes. - TcpTransport
Config - Runtime controls for TCP/Unix transport execution.
- Token
Step - One scheduled operation in steady-state token generation.
- Transport
Batch
Enums§
- Bridge
Addr - Unified transport address for TCP or Unix domain sockets.
- Bridge
Listener - Unified transport listener wrapping platform-specific socket types.
- Bridge
Stream - Unified transport stream wrapping platform-specific socket types.
- Device
Kind - Execution target selected for a pipeline stage.
- Transport
Kind - Transport protocol selection for inter-stage bridges.
Functions§
- build_
token_ schedule - Generate a simple steady-state pipeline schedule preview.
- execute_
pipeline - Execute pipeline stages with real channel/thread wiring for
token_counttokens. - execute_
pipeline_ distributed - Execute pipeline stages distributed across the LAN using TCP transport.
- execute_
pipeline_ tcp_ loopback - execute_
pipeline_ tcp_ loopback_ with_ config - Execute pipeline stages with real TCP loopback transport bridges and explicit transport config.
- execute_
pipeline_ with_ rebalance - execute_
pipeline_ with_ rebalance_ and_ measured - execute_
pipeline_ with_ remote_ stage - Coordinator side of real remote execution.
planmust have at least one stage assigned tolocal_node_idand at least one assigned toremote_node_id— matchingflow’s existing local+remote 2-node model, though each node’s stages get merged (seemerge_stages_for_node) since the real assignment algorithm splits one node’s layers into several raw stages, not necessarily one. The merged local stage runs in-process as usual; the merged remote stage’s batches are sent over a real outbound connection (TcpStream::connect(remote_addr)) to a separaterun_stage_workerprocess, so the round-trip time recorded here is genuine network + remote-compute time, not a local simulation. - run_
stage_ worker - Runs as a real, separate OS process (see
ghost-link stage-worker): accepts exactly one coordinator connection onlistener, reads the stage handshake, then loops read-batch → compute → write-result until the coordinator closes the connection. One-shot, matching howcluster-start’s childlistenprocesses already behave. - spawn_
tcp_ bridge - Spawn a TCP transport bridge between pipeline stages.