|
13 | 13 | from typing import TYPE_CHECKING, Callable |
14 | 14 |
|
15 | 15 | import libcst as cst |
16 | | -import sentry_sdk |
17 | 16 | from rich.console import Group |
18 | 17 | from rich.panel import Panel |
19 | 18 | from rich.syntax import Syntax |
@@ -680,30 +679,6 @@ def optimize_function(self) -> Result[BestOptimization, str]: |
680 | 679 | ): |
681 | 680 | console.rule() |
682 | 681 | 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 | | - ) |
707 | 682 | # Generate tests and optimizations in parallel |
708 | 683 | future_tests = self.executor.submit(self.generate_and_instrument_tests, new_code_context) |
709 | 684 | future_optimizations = self.executor.submit( |
|
0 commit comments