Skip to content

Commit 8c6dc83

Browse files
committed
fixes
1 parent b806542 commit 8c6dc83

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ def determine_best_candidate(
425425
)
426426
speedup_ratios[candidate.optimization_id] = perf_gain
427427

428-
tree = Tree(f"Candidate #{candidate_index} - Sum of Minimum Runtimes")
428+
tree = Tree(f"Candidate #{candidate_index} - Runtime Information")
429429
if speedup_critic(
430430
candidate_result, original_code_baseline.runtime, best_runtime_until_now
431431
) and quantity_of_tests_critic(candidate_result):
@@ -897,6 +897,7 @@ def establish_original_code_baseline(
897897
)
898898
console.rule()
899899

900+
900901
total_timing = benchmarking_results.total_passed_runtime() # caution: doesn't handle the loop index
901902
functions_to_remove = [
902903
result.id.test_function_name
@@ -906,7 +907,7 @@ def establish_original_code_baseline(
906907

907908
if not behavioral_results:
908909
logger.warning(
909-
f"Couldn't run any tests for original function {self.function_to_optimize.function_name}. SKIPPING OPTIMIZING THIS FUNCTION."
910+
f"Couldn't run any tests for original function {function_name}. SKIPPING OPTIMIZING THIS FUNCTION."
910911
)
911912
console.rule()
912913
success = False
@@ -929,19 +930,7 @@ def establish_original_code_baseline(
929930
f"{humanize_runtime(total_timing)} per full loop"
930931
)
931932
console.rule()
932-
logger.debug(f"Total original code summed runtime (ns): {total_timing}")
933-
console.rule()
934-
runtime_distribution, runtime_statistics = benchmarking_results.bayesian_nonparametric_bootstrap_analysis(
935-
100_000
936-
)
937-
logger.info(
938-
f"Bayesian Bootstrapping Nonparametric Analysis"
939-
f"\nExpected original code summed runtime (95% Credible Interval) = ["
940-
f"{humanize_runtime(round(runtime_statistics['credible_interval_lower_bound']))}, "
941-
f"{humanize_runtime(round(runtime_statistics['credible_interval_upper_bound']))}], "
942-
f"\nmedian: {humanize_runtime(round(runtime_statistics['median']))}"
943-
)
944-
933+
logger.debug(f"Total original code runtime (ns): {total_timing}")
945934
return Success(
946935
(
947936
OriginalCodeBaseline(
@@ -950,8 +939,6 @@ def establish_original_code_baseline(
950939
runtime=total_timing,
951940
coverage_results=coverage_results,
952941
),
953-
runtime_distribution,
954-
runtime_statistics,
955942
functions_to_remove,
956943
)
957944
)
@@ -1167,10 +1154,3 @@ def generate_and_instrument_tests(
11671154
)
11681155
]
11691156

1170-
@staticmethod
1171-
def write_code_and_helpers(original_code: str, original_helper_code: dict[Path, str], path: Path) -> None:
1172-
with path.open("w", encoding="utf8") as f:
1173-
f.write(original_code)
1174-
for module_abspath in original_helper_code:
1175-
with Path(module_abspath).open("w", encoding="utf8") as f:
1176-
f.write(original_helper_code[module_abspath])

0 commit comments

Comments
 (0)