CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[SOT][3.8] Cleanup eval_frame
python3.9- code
#72868
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR cleans up legacy Python eval_frame code by removing support for Python versions older than 3.9. It deprecates outdated conditions and macros while simplifying eval_frame callback logic.
- Update the test to require Python 3.9–3.13
- Remove Python 3.8-specific macros and fallback code
- Simplify version-specific branches in eval_frame implementation
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
test/dygraph_to_static/test_eval_frame.py | Update test condition and comment to reflect new Python version support |
paddle/fluid/pybind/sot/macros.h | Remove obsolete Python 3.8 definitions and macros |
paddle/fluid/pybind/sot/guards.cc | Remove fallback implementation for PyObject_CallOneArg for Python below 3.9 |
paddle/fluid/pybind/sot/eval_frame.c | Eliminate legacy conditional branches for Python versions earlier than 3.9 |
Comments suppressed due to low confidence (2)
paddle/fluid/pybind/sot/eval_frame.c:63
- Add a comment noting that the alternative branch for Python versions below 3.9 has been removed to simplify the eval_frame logic.
return _PyEval_EvalFrameDefault(tstate, frame, throw_flag);
paddle/fluid/pybind/sot/guards.cc:23
- Confirm that the removal of the fallback for PyObject_CallOneArg is intentional and documented elsewhere, given the deprecation of pre-Python 3.9 support.
#if !defined(PyObject_CallOneArg) && !PY_3_9_PLUS
@@ -28,8 +28,8 @@ def tearDown(self): | |||
pass | |||
|
|||
def test_eval_frame(self): | |||
if not (sys.version_info >= (3, 8) and sys.version_info < (3, 14)): | |||
# skip test_eval_frame, current only support 3.8 - 3.13 | |||
if not (sys.version_info >= (3, 9) and sys.version_info < (3, 14)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider updating the inline comment to clearly state that only Python 3.9 to 3.13 are supported. A revision for clarity (eg. 'supported: Python 3.9 to 3.13') could benefit future readers.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还是有点用的啊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对啊,明明改了啊,为啥还会 comment
paddle/fluid/pybind/sot/eval_frame.c
Outdated
@@ -376,18 +367,11 @@ static PyObject *_custom_eval_frame_shim(PyThreadState *tstate, | |||
return _custom_eval_frame(tstate, frame, throw_flag, callback); | |||
} | |||
|
|||
#if PY_3_9_PLUS | |||
static PyObject *custom_eval_frame_shim(PyThreadState *tstate, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数是不是可以删掉了?再把 _custom_eval_frame_shim
rename 成 custom_eval_frame_shim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval_frame
python3.9- codeeval_frame
python3.9- code
eval_frame
python3.9- codeeval_frame
python3.9- code
PR Category
Execute Infrastructure
PR Types
Deprecations
Description
eval_frame
python3.9- 相关代码