Skip to content

Commit f3718d7

Browse files
authored
Restore concurrency in testgen and candidate generation
1 parent 2e6903a commit f3718d7

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

codeflash/optimization/function_optimizer.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -680,30 +680,6 @@ def optimize_function(self) -> Result[BestOptimization, str]:
680680
):
681681
console.rule()
682682
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-
)
707683
# Generate tests and optimizations in parallel
708684
future_tests = self.executor.submit(self.generate_and_instrument_tests, new_code_context)
709685
future_optimizations = self.executor.submit(

0 commit comments

Comments
 (0)