Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SOT] Cleanup legacy flags and policies #71279

Merged

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Feb 25, 2025

PR Category

Execute Infrastructure

PR Types

Devs

Description

清理过时的 flags 和策略

PCard-66972

Copy link

paddle-bot bot commented Feb 25, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@SigureMo SigureMo changed the title cleanup CLEAN_CODE [SOT] Cleanup legacy flags and policies Feb 26, 2025
@SigureMo SigureMo changed the title [SOT] Cleanup legacy flags and policies [SOT][3.13] Cleanup legacy flags and policies Feb 26, 2025
@SigureMo SigureMo requested a review from Copilot February 26, 2025 11:43

Choose a reason for hiding this comment

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

python/paddle/jit/sot/translate.py:97

  • [nitpick] The renaming from 'impl_sot' to 'impl' results in a generic function name that may reduce clarity regarding its role in handling symbolic translation. Consider a more descriptive name such as 'translated_function'.
def impl(*args: P.args, **kwargs: P.kwargs) -> R:

test/sot/test_sot_cost_model.py:1

  • [nitpick] The removal of this test file may reduce the coverage for cost model functionality. Please verify that the critical behaviors are adequately covered in other test suites.
# Removed entire test file
gouzil
gouzil previously approved these changes Feb 26, 2025
@SigureMo SigureMo requested a review from Copilot February 27, 2025 06:36
@gouzil gouzil requested review from Copilot and removed request for Copilot February 27, 2025 06:43

Choose a reason for hiding this comment

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

PR Overview

This PR cleans up legacy flags and policies in the PaddleSOT code by removing deprecated environment variables, state management, and legacy code paths.

  • Removed legacy state logic in symbolic translation (including StepState, impl_sot, and related branches)
  • Eliminated outdated environment variables and cost model guards (ENV_COST_MODEL, ENV_CLEAN_CODE, and associated functions)
  • Renamed comparison operator mappings and removed is_clean_code checks from code generation functions

Reviewed Changes

File Description
python/paddle/jit/sot/translate.py Removed legacy dynamic mode logic and simplified symbolic translation function
python/paddle/jit/sot/utils/envs.py Removed legacy environment variable declarations and cost model guard
python/paddle/jit/sot/utils/utils.py Cleaned up legacy cost model logic and state management in StepInfo and StepInfoManager
python/paddle/jit/sot/opcode_translator/executor/opcode_executor.py Renamed and updated comparison operator mapping for clarity
python/paddle/jit/sot/opcode_translator/executor/pycode_generator.py Removed conditional checks using the legacy is_clean_code flag
python/paddle/jit/sot/utils/init.py Updated module exports by removing deprecated flags

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (7)

python/paddle/jit/sot/translate.py:98

  • [nitpick] Renaming 'impl_sot' to 'impl' may reduce clarity regarding its role; consider either adopting a more descriptive name or updating documentation to reflect this change.
def impl(*args: P.args, **kwargs: P.kwargs) -> R:

python/paddle/jit/sot/utils/envs.py:27

  • Removal of the ENV_COST_MODEL flag requires verifying that no remaining code depends on its behavior.
ENV_COST_MODEL = BooleanEnvironmentVariable("COST_MODEL", False)

python/paddle/jit/sot/utils/envs.py:30

  • Removal of the ENV_CLEAN_CODE flag mandates a check that all code paths previously controlled by this flag have been fully refactored.
ENV_CLEAN_CODE = BooleanEnvironmentVariable("CLEAN_CODE", False)

python/paddle/jit/sot/utils/utils.py:403

  • The extensive removal of legacy cost model logic and state management in StepInfo (and its use in StepInfoManager) should be verified to ensure that no external modules still depend on the removed functionality.
class StepInfo:

python/paddle/jit/sot/opcode_translator/executor/opcode_executor.py:115

  • [nitpick] Renaming the operator mapping from SUPPORT_COMPARE_OP to COMPARE_OP_NAME_TO_FN enhances clarity; ensure that all references to the old name have been updated accordingly.
COMPARE_OP_NAME_TO_FN = {

python/paddle/jit/sot/opcode_translator/executor/pycode_generator.py:516

  • The removal of the is_clean_code check in the eval frame enabling/disabling functions changes their behavior; confirm that this change is intentional and that tests cover the new logic.
if is_clean_code():

python/paddle/jit/sot/utils/init.py:14

  • Removal of legacy flag exports from the module init requires ensuring that no external code depends on these now-deprecated public APIs.
from .envs import (
@SigureMo SigureMo changed the title [SOT][3.13] Cleanup legacy flags and policies [SOT] Cleanup legacy flags and policies Mar 1, 2025
@SigureMo SigureMo merged commit 4705ebe into PaddlePaddle:develop Mar 1, 2025
33 checks passed
@SigureMo SigureMo deleted the sot/cleanup-legacy-flags-and-policies branch March 1, 2025 12:27
Enigmatisms pushed a commit to Enigmatisms/Paddle that referenced this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants