Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions codeflash/optimization/function_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def determine_best_candidate(
candidates = deque(candidates)
# Start a new thread for AI service request, start loop in main thread
# check if aiservice request is complete, when it is complete, append result to the candidates list
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
future_line_profile_results = executor.submit(
self.aiservice_client.optimize_python_code_line_profiler,
source_code=code_context.read_writable_code,
Expand All @@ -382,8 +382,8 @@ def determine_best_candidate(
if done and (future_line_profile_results is not None):
line_profile_results = future_line_profile_results.result()
candidates.extend(line_profile_results)
original_len+= len(candidates)
logger.info(f"Added results from line profiler to candidates, total candidates now: {original_len}")
original_len+= len(line_profile_results)
logger.info(f"Added {len(line_profile_results)} results from line profiler to candidates, total candidates now: {original_len}")
future_line_profile_results = None
candidate_index += 1
candidate = candidates.popleft()
Expand Down Expand Up @@ -1086,8 +1086,8 @@ def run_and_parse_tests(
pytest_cmd=self.test_cfg.pytest_cmd,
pytest_timeout=INDIVIDUAL_TESTCASE_TIMEOUT,
pytest_target_runtime_seconds=testing_time,
pytest_min_loops=1,
pytest_max_loops=1,
pytest_min_loops=pytest_min_loops,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can skip these arguments here since these are actually not used and is hardcoded. This is giving the wrong indication to the reader of this code, about how many times this code loops

pytest_max_loops=pytest_min_loops,
test_framework=self.test_cfg.test_framework,
line_profiler_output_file=line_profiler_output_file,
)
Expand Down
4 changes: 2 additions & 2 deletions codeflash/verification/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ def run_line_profile_tests(
f"--timeout={pytest_timeout}",
"-q",
"--codeflash_loops_scope=session",
f"--codeflash_min_loops={pytest_min_loops}",
f"--codeflash_max_loops={pytest_max_loops}",
"--codeflash_min_loops=1",
"--codeflash_max_loops=1",
f"--codeflash_seconds={pytest_target_runtime_seconds}",
]
result_file_path = get_run_tmp_file(Path("pytest_results.xml"))
Expand Down
Loading