Implementation:Ucbepic Docetl DSLRunner Load Run Save For Baseline
| Knowledge Sources | |
|---|---|
| Domains | Data_Engineering, Optimization |
| Last Updated | 2026-02-08 01:40 GMT |
Overview
Concrete tool for running a baseline DocETL pipeline to establish initial metrics before optimization.
Description
This uses the same DSLRunner.load_run_save() method as standard pipeline execution, but in the context of optimization: the pipeline contains operations marked with optimize: True. The baseline run produces initial accuracy and cost metrics that the optimizer uses as a reference point.
Usage
Run the baseline pipeline before invoking the optimizer. The results serve as the "root node" in the MOAR MCTS search tree and the comparison point for V1 optimization candidates.
Code Reference
Source Location
- Repository: docetl
- File: docetl/runner.py
- Lines: L106-130 (__init__), L462-494 (load_run_save)
Signature
class DSLRunner:
def __init__(self, config: dict, max_threads: int | None = None, **kwargs):
"""Initialize with pipeline config containing optimize: True operations."""
def load_run_save(self) -> float:
"""Execute baseline pipeline, returning total LLM API cost."""
Import
from docetl.runner import DSLRunner
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| config | dict | Yes | YAML config with operations marked optimize: True |
| max_threads | int or None | No | Parallel execution limit |
Outputs
| Name | Type | Description |
|---|---|---|
| load_run_save() returns | float | Total baseline execution cost |
| output file | JSON or CSV | Baseline results for accuracy measurement |
Usage Examples
import yaml
from docetl.runner import DSLRunner
# Load baseline pipeline with optimize flags
with open("baseline_pipeline.yaml") as f:
config = yaml.safe_load(f)
runner = DSLRunner(config)
baseline_cost = runner.load_run_save()
print(f"Baseline cost: ${baseline_cost:.2f}")