Skip to content

nexuml.core.pipeline

nexuml.core.pipeline

Compiled pipeline: the runtime model assembled from specs.

CompiledPipeline

Bases: Module

Executable pipeline assembled from compiled layer specs.

Holds ordered stages of layers, executes sequentially over TensorDicts, and provides optimizer/scheduler factory methods.

iter_layers

iter_layers() -> Iterator[tuple[str, str, nn.Module]]

Yield pipeline layers in execution order.

forward_until

forward_until(
    x: TensorDict,
    y: TensorDict | None = None,
    *,
    x_keys: Sequence[str] | None = None,
    y_keys: Sequence[str] | None = None,
) -> tuple[TensorDict, TensorDict | None]

Run the pipeline until the requested keys are available.

This is useful for feature export when the codebase does not yet model preprocessing layers separately from the rest of the network.

Returns:

Type Description
tuple[TensorDict, TensorDict | None]

Tuple of (x_out, y_out) with the requested keys present.

Raises:

Type Description
KeyError

If the pipeline did not produce the requested keys.

call_layer_hook

call_layer_hook(hook_name: str) -> None

Propagate a lifecycle hook to all pipeline layers.