Index
bench
¶
Benchmarking framework for Diapason inference engines.
Classes¶
BaseBenchmark
¶
Bases: ABC
Base class for all benchmark implementations.
Subclasses must be registered via
@BenchmarkRegistry.register("name") to become discoverable.
Attributes¶
description
abstractmethod
property
¶
Human-readable description of what this benchmark measures.
Methods:¶
run
abstractmethod
¶
run(
engine: InferenceEngine,
model: str,
*,
num_samples: int = 10,
**kwargs: Any,
) -> BenchmarkResult
BenchmarkResult
dataclass
¶
BenchmarkResult(
benchmark_name: str,
model: str,
engine: str,
metrics: Dict[str, float] = dict(),
metadata: Dict[str, Any] = dict(),
samples: int = 0,
errors: int = 0,
warmup_samples: int = 0,
steady_state_samples: int = 0,
steady_state_reached: bool = False,
total_energy_joules: float = 0.0,
energy_per_token_joules: float = 0.0,
energy_method: str = "",
)
Result from running a single benchmark.
BenchmarkSuite
¶
BenchmarkSuite(
benchmarks: Optional[List[BaseBenchmark]] = None,
)
Run a collection of benchmarks and aggregate results.
Source code in src/diapason/bench/_stubs.py
Methods:¶
run_all
¶
run_all(
engine: InferenceEngine,
model: str,
*,
num_samples: int = 10,
**kwargs: Any,
) -> List[BenchmarkResult]
Run all benchmarks and return a list of results.
Source code in src/diapason/bench/_stubs.py
to_jsonl
¶
to_jsonl(results: List[BenchmarkResult]) -> str
Serialize results to JSONL format (one JSON object per line).
Source code in src/diapason/bench/_stubs.py
summary
¶
summary(results: List[BenchmarkResult]) -> Dict[str, Any]
Create a summary dict from benchmark results.
Source code in src/diapason/bench/_stubs.py
BenchmarkRegistry
¶
Functions:¶
ensure_registered
¶
Ensure all benchmark implementations are registered.