taufactor.benchmark
Benchmark helpers for TauFactor convergence studies.
Functions
|
Format a benchmark result row and append it to the output file. |
|
Resolve a solver provided either as class object or string name. |
|
Resolve a benchmark structure from a predefined name or custom callable. |
|
Run a single structure benchmark case. |
|
Run a convergence benchmark on synthetic structures. |
|
Create output file and write header if it does not exist. |
- taufactor.benchmark.append_row_to_file(row: dict, outfile: str = 'taufactor_benchmark_results.txt') None[source]
Format a benchmark result row and append it to the output file.
- taufactor.benchmark.resolve_solver(solver: str | type | None) type[source]
Resolve a solver provided either as class object or string name.
- taufactor.benchmark.resolve_structure(structure: str | Callable, N: int, features: int | None = None) tuple[source]
Resolve a benchmark structure from a predefined name or custom callable.
- taufactor.benchmark.run_benchmark_case(N: int, device: str, conv_crit: float, structure: str | Callable = 'fcc', features: int | None = None, iter_limit: int = 10000, solver: str | type | None = None, solver_kwargs: dict | None = None, solve_kwargs: dict | None = None) dict[source]
Run a single structure benchmark case.
- Parameters:
structure – Either one of the predefined keys in
STRUCTURE_REGISTRYor a custom callable hook returning a structure array.
- taufactor.benchmark.run_benchmark_study(Ns: list[int] | tuple[int, ...] = (100, 128, 200, 256, 300, 384, 400), devices: list[str] | tuple[str, ...] = ('cuda',), conv_crit_values: list[float] | tuple[float, ...] = (0.001,), structure: str | Callable = 'fcc', features: int = 1, outfile: str = 'taufactor_benchmark_results.txt', write_file: bool = True, iter_limit: int = 10000, solver: str | type | None = None, solver_kwargs: dict | None = None, solve_kwargs: dict | None = None) list[dict][source]
Run a convergence benchmark on synthetic structures.
- Parameters:
structure – Either a predefined structure name (
fcc,blocks,diagonal2d,zigzag,diagonal3d) or a custom callable hook. Custom hooks should acceptNorNxand can optionally acceptfeatures.