Skip to content

Commit

Permalink
cleanup CLEAN_CODE
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Feb 25, 2025
1 parent 75c51f6 commit 74200f8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
FallbackError,
InnerError,
ResumeFnNameFactory,
is_clean_code,
list_contain_by_id,
list_find_index_by_id,
no_eval_frame,
Expand Down Expand Up @@ -514,8 +513,6 @@ def gen_disable_eval_frame(self):
"""
Generates instructions to disable the evaluation frame.
"""
if is_clean_code():
return
self.gen_load_object(
paddle.framework.core.set_eval_frame, "paddle_set_eval_frame_fn"
)
Expand All @@ -527,8 +524,6 @@ def gen_enable_eval_frame(self):
"""
Generates instructions to enable the evaluation frame.
"""
if is_clean_code():
return
self.gen_load_object(
paddle.framework.core.set_eval_frame, "paddle_set_eval_frame_fn"
)
Expand Down
2 changes: 0 additions & 2 deletions python/paddle/jit/sot/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

from .call_ast_utils import get_static_function, try_ast_func # noqa: F401
from .envs import ( # noqa: F401
ENV_CLEAN_CODE,
ENV_COST_MODEL,
ENV_MIN_GRAPH_SIZE,
ENV_SOT_ALLOW_DYNAMIC_SHAPE,
Expand Down Expand Up @@ -77,7 +76,6 @@
in_paddle_module,
is_break_graph_api,
is_builtin_fn,
is_clean_code,
is_comprehensive_name,
is_paddle_api,
is_strict_mode,
Expand Down
1 change: 0 additions & 1 deletion python/paddle/jit/sot/utils/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
ENV_MIN_GRAPH_SIZE = IntegerEnvironmentVariable("MIN_GRAPH_SIZE", 10)
ENV_SOT_LOG_LEVEL = IntegerEnvironmentVariable("SOT_LOG_LEVEL", 0)
ENV_STRICT_MODE = BooleanEnvironmentVariable("STRICT_MODE", False)
ENV_CLEAN_CODE = BooleanEnvironmentVariable("CLEAN_CODE", False)
ENV_SOT_WITH_CONTROL_FLOW = BooleanEnvironmentVariable(
"SOT_WITH_CONTROL_FLOW", True
)
Expand Down
5 changes: 0 additions & 5 deletions python/paddle/jit/sot/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from paddle.utils import flatten, map_structure

from .envs import (
ENV_CLEAN_CODE,
ENV_COST_MODEL,
ENV_SOT_LOG_LEVEL,
ENV_STRICT_MODE,
Expand Down Expand Up @@ -319,10 +318,6 @@ def is_strict_mode():
return ENV_STRICT_MODE.get()


def is_clean_code() -> bool:
return ENV_CLEAN_CODE.get()


def list_find_index_by_id(li: list[Any], item: Any) -> int:
return [id(it) for it in li].index(id(item))

Expand Down

0 comments on commit 74200f8

Please sign in to comment.