-
Notifications
You must be signed in to change notification settings - Fork 876
【Hackathon 9th No.109】[CppExtension] Support build Custom OP in setuptools 80+ -part #7645
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
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7645.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
📚 本次 PR 文档预览链接(点击展开)
|
|
还得是顺师傅考虑的周全,我稍后看下,这个倒没那么急 |
| [0. , 0. , 0.12062856, 0.18853758, 0.54154527, 0.73217475, | ||
| 0. , 0. , 0. , 0. ], | ||
| [0.04105225, 0. , 0.67857188, 0.95838499, 1.08346415, 2.47209001, | ||
| 0. , 0. , 0.22969440, 1.08237624]]) |
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.
这里代码保持源码吧,这样方便 copy,输出用注释表示下
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 updates the Custom C++ Operator documentation to reflect changes in setuptools 80+ behavior. The update addresses compatibility with modern setuptools versions, which changed the installation mechanism from egg-based to modern Python package structure.
Key changes:
- Updated installation directory reference to include both
site-packagesanddist-packages - Replaced old egg-based installation logs with modern setuptools installation output
- Updated package structure documentation from
.pyfile to proper Python package with__init__.py
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ``` shell | ||
|
|
||
| > tree /usr/local/lib/python3.9/dist-packages/custom_setup_ops* | ||
| /usr/local/lib/python3.9/dist-packages/custom_setup_ops |
Copilot
AI
Nov 19, 2025
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.
The tree output shows custom_setup_ops as a file instead of a directory. The first line after the path should indicate it's a directory. Consider adding a trailing slash or appropriate directory indicator to clarify that custom_setup_ops is a directory containing __init__.py and the .so file.
| /usr/local/lib/python3.9/dist-packages/custom_setup_ops | |
| /usr/local/lib/python3.9/dist-packages/custom_setup_ops/ |
| 其中 `custom_setup_ops_pd_.so` 为自定义算子编译生成的动态库,`custom_setup_ops/__init__.py` 为根据 `PaddlePaddle` 接口的定义规则,自动生成的自定义算子 python 模块源码,其示例内容为(自动生成的代码后续可能会更新,生成结果可能与示例代码不一致): | ||
|
|
||
| ```python | ||
|
|
Copilot
AI
Nov 19, 2025
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] Unnecessary blank line at the start of the code block. This empty line should be removed for cleaner code presentation.
|
|
||
| `/usr/local/lib/python3.7/site-packages/custom_setup_ops-0.0.0-py3.7-linux-x86_64.egg` | ||
| ``` shell | ||
|
|
Copilot
AI
Nov 19, 2025
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] Unnecessary blank line at the start of the shell code block. This should be removed to maintain consistent formatting with other code blocks in the documentation.
| 其目录结构如下: | ||
|
|
||
| ``` shell | ||
|
|
Copilot
AI
Nov 19, 2025
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] Unnecessary blank line at the start of the shell code block. This should be removed to maintain consistent formatting with other code blocks in the documentation.
SigureMo
left a comment
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.
另外我觉得可以单独提一下,在当前目录只有一个 setup.py 时可以使用 pip install . --no-build-isolation 这种现代化的方式来构建
SigureMo
left a comment
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.
关联:PaddlePaddle/Paddle#76008
更新文档中 《自定义 C++算子》 部分相关内容。
@SigureMo @sunzhongkai588