Skip to content

Commit bcffb5e

Browse files
authored
Merge pull request #1461 from codeflash-ai/aseembits93-patch-1
Restore concurrency in testgen and candidate generation
2 parents 4a978b1 + 2f36044 commit bcffb5e

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

codeflash/optimization/function_optimizer.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from typing import TYPE_CHECKING, Callable
1414

1515
import libcst as cst
16-
import sentry_sdk
1716
from rich.console import Group
1817
from rich.panel import Panel
1918
from rich.syntax import Syntax
@@ -680,30 +679,6 @@ def optimize_function(self) -> Result[BestOptimization, str]:
680679
):
681680
console.rule()
682681
new_code_context = code_context
683-
if (
684-
self.is_numerical_code and not self.args.no_jit_opts
685-
): # if the code is numerical in nature (uses numpy/tensorflow/math/pytorch/jax)
686-
jit_compiled_opt_candidate = self.aiservice_client.get_jit_rewritten_code(
687-
code_context.read_writable_code.markdown, self.function_trace_id
688-
)
689-
if jit_compiled_opt_candidate: # jit rewrite was successful
690-
# write files
691-
# Try to replace function with optimized code
692-
self.replace_function_and_helpers_with_optimized_code(
693-
code_context=code_context,
694-
optimized_code=jit_compiled_opt_candidate[0].source_code,
695-
original_helper_code=original_helper_code,
696-
)
697-
# get code context
698-
try:
699-
new_code_context = self.get_code_optimization_context().unwrap()
700-
except Exception as e:
701-
sentry_sdk.capture_exception(e)
702-
logger.debug("!lsp|Getting new code context failed, revert to original one")
703-
# unwrite files
704-
self.write_code_and_helpers(
705-
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
706-
)
707682
# Generate tests and optimizations in parallel
708683
future_tests = self.executor.submit(self.generate_and_instrument_tests, new_code_context)
709684
future_optimizations = self.executor.submit(

0 commit comments

Comments
 (0)