Skip to content

trace

trace

ReorderingAnalysis(spec: ExecutionSpec, base: Optional[Node] = None)

Bases: AnalysisBase[ReorderingAnalysisConfig, M], Generic[M]

Task traces using trainer restoration and statically declared DATASET.

Compose before the task's trainer. Source parameters come from its dataset schema; analysis/split only overrides the raw source split for measurement. No materialized training files are needed. AnalysisBase owns initialization, restoration, debug discovery, result persistence, and cleanup.

capture_blocks(module: Any, method: str) -> bool staticmethod

Capture each transformer block's externally returned state.

encode_sequence(example_index: int, dataset: Dataset[Any]) -> tuple[list[int], str, Callable[[Sequence[int]], str]]

Encode a task example while keeping its human-readable token labels.

measure_sequence(example_index: int, dataset: Dataset[Any], measured: Any) -> dict[str, Any]

Measure aligned predictions and every layer's branch states.