problem_logger#
Logger for kernel generation and evaluation results.
Functions
Reverse engineer result from a log file :param log: str, log file loaded as a string |
|
|
Load results from a previous job or initialize an empty results dictionary. |
Classes
|
Saves and loads the logged files for one problem in a single trial of one job |
- kernelfoundry.algorithm.problem_logger.extract_result_from_log(log: str) tuple[dict, EvalResult][source]#
Reverse engineer result from a log file :param log: str, log file loaded as a string
- Returns:
dict, exec result as dict EvalResult, the result inferred based on the log
- kernelfoundry.algorithm.problem_logger.initialize_or_load_results(logdir: str)[source]#
Load results from a previous job or initialize an empty results dictionary.
- class kernelfoundry.algorithm.problem_logger.ProblemLogger(level: int, problem_id: int, logdir: str, trial: int)[source]#
Saves and loads the logged files for one problem in a single trial of one job
- __init__(level: int, problem_id: int, logdir: str, trial: int)[source]#
Initialize the problem logger.
- log_eval_results(eval_results: list) None[source]#
Write eval results to a file.
Raw profiler payloads (e.g. unitrace metrics CSVs) can be large, and are only needed transiently to build the human-readable profiler feedback text (already saved separately in eval_log / the prompt files), so large string values inside
profiler_dataare trimmed to a short preview here to keep these files small and easy to open/diff/sync.
- save_gen_kernel_w_version(custom_kernel: str, language: str, version: int) str[source]#
Save the generated kernel code with versioning.
- save_diffs(custom_kernel_out_list) None[source]#
Save the diffs between the generated kernel and the previous one.