Skip to content

[SOT][3.11,3.12.3.14] cpython_internals use PyThreadState_GET error#78708

Merged
SigureMo merged 1 commit intoPaddlePaddle:developfrom
gouzil:sot/fix_debug_build
Apr 18, 2026
Merged

[SOT][3.11,3.12.3.14] cpython_internals use PyThreadState_GET error#78708
SigureMo merged 1 commit intoPaddlePaddle:developfrom
gouzil:sot/fix_debug_build

Conversation

@gouzil
Copy link
Copy Markdown
Member

@gouzil gouzil commented Apr 17, 2026

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

修复 cpython_internals 中的 PyThreadState_GET 使用错误. _PyThreadState_GET 是不对外开放的,会导致 debug 模式编译错误

是否引起精度变化

Copilot AI review requested due to automatic review settings April 17, 2026 16:27
@paddle-bot
Copy link
Copy Markdown

paddle-bot Bot commented Apr 17, 2026

你的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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect CPython thread-state accessor usage in cpython_internals for multiple Python versions by switching from the internal _PyThreadState_GET() to the public PyThreadState_GET() macro.

Changes:

  • Update frame-clearing assertions in the Python 3.11, 3.12, and 3.14 internals shims to use PyThreadState_GET().

Reviewed changes

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

File Description
paddle/fluid/pybind/sot/cpython_internals/internals_3_11.c Replace _PyThreadState_GET() usage with PyThreadState_GET() in frame-clearing assert for Py3.11 path.
paddle/fluid/pybind/sot/cpython_internals/internals_3_12.c Replace _PyThreadState_GET() usage with PyThreadState_GET() in frame-clearing assert for Py3.12 path.
paddle/fluid/pybind/sot/cpython_internals/internals_3_14.c Replace _PyThreadState_GET() usage with PyThreadState_GET() in frame-clearing assert for Py3.14 path.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@paddle-bot paddle-bot Bot added the contributor External developers label Apr 17, 2026
@gouzil gouzil requested a review from SigureMo April 18, 2026 11:56
@SigureMo
Copy link
Copy Markdown
Member

修复 cpython_internals 中的 PyThreadState_GET 使用错误

具体是什么使用错误?写清楚点

@gouzil
Copy link
Copy Markdown
Member Author

gouzil commented Apr 18, 2026

具体是什么使用错误?写清楚点

Done

@SigureMo SigureMo merged commit bae4558 into PaddlePaddle:develop Apr 18, 2026
116 of 118 checks passed
@SigureMo SigureMo deleted the sot/fix_debug_build branch April 18, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants