Skip to content

Commit 23ff79b

Browse files
committed
debug
1 parent 771d882 commit 23ff79b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

codeflash/benchmarking/trace_benchmarks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
def trace_benchmarks_pytest(
1313
benchmarks_root: Path, tests_root: Path, project_root: Path, trace_file: Path, timeout: int = 300
1414
) -> None:
15+
logger.info("Tracing benchmarks with codeflash-benchmark")
1516
benchmark_env = os.environ.copy()
1617
if "PYTHONPATH" not in benchmark_env:
1718
benchmark_env["PYTHONPATH"] = str(project_root)
@@ -32,6 +33,7 @@ def trace_benchmarks_pytest(
3233
env=benchmark_env,
3334
timeout=timeout,
3435
)
36+
logger.info(f"ran with args: {result.args}")
3537
if result.returncode != 0:
3638
if "ERROR collecting" in result.stdout:
3739
# Pattern matches "===== ERRORS =====" (any number of =) and captures everything after

codeflash/optimization/optimizer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def run_benchmarks(
7474
for file in file_to_funcs_to_optimize:
7575
with file.open("r", encoding="utf8") as f:
7676
file_path_to_source_code[file] = f.read()
77+
console.print(f"Instrumented {len(file_to_funcs_to_optimize)} files for benchmarking…")
7778
try:
7879
instrument_codeflash_trace_decorator(file_to_funcs_to_optimize)
7980
trace_file = Path(self.args.benchmarks_root) / "benchmarks.trace"
@@ -83,6 +84,7 @@ def run_benchmarks(
8384
self.replay_tests_dir = Path(
8485
tempfile.mkdtemp(prefix="codeflash_replay_tests_", dir=self.args.benchmarks_root)
8586
)
87+
logger.info(f"Tracing benchmarks to {trace_file} in {self.replay_tests_dir}")
8688
trace_benchmarks_pytest(
8789
self.args.benchmarks_root, self.args.tests_root, self.args.project_root, trace_file
8890
) # Run all tests that use pytest-benchmark

0 commit comments

Comments
 (0)