Skip to content

[SOT][3.14] Update the internal function to use PyObject_GC_Track replace _PyObject_GC_TRACK#78558

Merged
SigureMo merged 4 commits intoPaddlePaddle:developfrom
gouzil:sot/fix_314x_build_error
Apr 2, 2026
Merged

[SOT][3.14] Update the internal function to use PyObject_GC_Track replace _PyObject_GC_TRACK#78558
SigureMo merged 4 commits intoPaddlePaddle:developfrom
gouzil:sot/fix_314x_build_error

Conversation

@gouzil
Copy link
Copy Markdown
Member

@gouzil gouzil commented Apr 1, 2026

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

  • 修复 debug 模式下 _PyGen_GetGeneratorFromFrame 内部函数编译错误
  • 修复 _PyObject_GC_TRACK 内部函数因为宏展开导致的更多内部函数使用,报错: undefined symbol: _Py_TriggerGC。 改用公开的 api PyObject_GC_Track

相关链接

是否引起精度变化

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

paddle-bot bot commented Apr 1, 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

This PR fixes CPython 3.14 internal-API integration issues in Paddle’s SOT pybind layer, addressing compilation problems in debug builds by adjusting which CPython headers/APIs are used.

Changes:

  • Include internal/pycore_genobject.h to ensure _PyGen_GetGeneratorFromFrame and related generator internals are available for compilation.
  • Replace _PyObject_GC_TRACK usage with the public PyObject_GC_Track API when tracking frame objects for GC.

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

Comment on lines 143 to 146
}
if (!_PyObject_GC_IS_TRACKED((PyObject *)f)) {
_PyObject_GC_TRACK((PyObject *)f);
PyObject_GC_Track((PyObject *)f);
}
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The PR title says to replace PyObject_GC_Track with _PyObject_GC_TRACK, but the actual change does the opposite (switches _PyObject_GC_TRACK to PyObject_GC_Track). Please update the title (and/or description) to match the implemented fix to avoid confusion for reviewers and release notes.

Copilot uses AI. Check for mistakes.
@SigureMo
Copy link
Copy Markdown
Member

SigureMo commented Apr 1, 2026

@ShigureNyako 喵子来 review 下,是 #78484 遇到的 SOT CI 问题的修复 PR

@SigureMo SigureMo changed the title fix: Update the internal function to use _PyObject_GC_TRACK replace PyObject_GC_Track [SOT] Update the internal function to use _PyObject_GC_TRACK replace PyObject_GC_Track Apr 1, 2026
@SigureMo SigureMo changed the title [SOT] Update the internal function to use _PyObject_GC_TRACK replace PyObject_GC_Track [SOT][3.14] Update the internal function to use _PyObject_GC_TRACK replace PyObject_GC_Track Apr 1, 2026
@gouzil gouzil changed the title [SOT][3.14] Update the internal function to use _PyObject_GC_TRACK replace PyObject_GC_Track [SOT][3.14] Update the internal function to use PyObject_GC_Track replace _PyObject_GC_TRACK Apr 1, 2026
@paddle-bot paddle-bot bot added the contributor External developers label Apr 1, 2026
@gouzil
Copy link
Copy Markdown
Member Author

gouzil commented Apr 2, 2026

@ShigureNyako 排查一下 PR-CI-SOT 的日志看看是什么原因导致的

Copy link
Copy Markdown
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

看来确实可以了,喵子牛哇

@SigureMo SigureMo merged commit 4f0218b into PaddlePaddle:develop Apr 2, 2026
102 of 105 checks passed
liuhao2638 pushed a commit to liuhao2638/Paddle that referenced this pull request Apr 7, 2026
…eplace `_PyObject_GC_TRACK` (PaddlePaddle#78558)

---------

Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
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