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] rewrite eval frame in C-lang #57653

Merged

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Sep 22, 2023

PR types

Bug fixes

PR changes

Others

Description

修复 3.11 编译问题

使用 C 编译 eval_frame,否则因为 eval_frame 中所 include 的部分 Python internal library 使用了 C++ 所不兼容的写法,会导致编译失败,如果不使用 C 的话就需要将相关代码 copy 出来,并使用 C++ 兼容的写法重写一遍,成本巨大,且不易维护

因为无法使用 VLOG,所以原来 VLOG 相关位置暂时注释掉,之后可能寻找合适的方式 log

另外修复了下创建 Function 时候没有 copy closure 的问题

以及修复了 test_pylayer 无法直接 run 的问题

PCard-66972

@paddle-bot
Copy link

paddle-bot bot commented Sep 22, 2023

你的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 use c-lang write eval frame [SOT] rewrite eval frame in C-lang Sep 22, 2023
@@ -94,9 +94,9 @@ repos:
description: Check C++ code style using cpplint.py.
entry: bash ./tools/codestyle/cpplint_pre_commit.hook
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
files: \.(cc|cxx|cpp|cu|h|hpp|hxx)$
Copy link
Member Author

Choose a reason for hiding this comment

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

eval_frame.c 是 Paddle 唯一现存的 C 代码,cpplint 里有大量的 C 写法检查,这些是不正确的(比如 NULL -> nullptr),也是没有办法修改的,添加大量 NOLINT 也是不建议的,鉴于所有 C 代码应当都有同样的问题,因此将其从 cpplint 监控列表移除

clang-format 不应禁掉,我们仍然需要代码格式化

clang-tidy 理应禁掉,但是目前并没有发现报错,也许是对 .c 后缀进行了特判,需要之后进一步观察

@SigureMo SigureMo merged commit 9985598 into PaddlePaddle:develop Sep 23, 2023
@SigureMo SigureMo deleted the sot/fix-eval-frame-311-compile-issues branch September 23, 2023 03:17
Frida-a pushed a commit to Frida-a/Paddle that referenced this pull request Oct 14, 2023
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 16, 2023
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
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.

2 participants