[Feat] CP-balance formal incorporation as flash_mask sub-module via build_ext#128
Open
Enigmatisms wants to merge 3 commits intoPaddlePaddle:mainfrom
Open
[Feat] CP-balance formal incorporation as flash_mask sub-module via build_ext#128Enigmatisms wants to merge 3 commits intoPaddlePaddle:mainfrom
Enigmatisms wants to merge 3 commits intoPaddlePaddle:mainfrom
Conversation
Co-authored-by: starcrown001 <148410714+starcrown001@users.noreply.github.com>
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#127 的优点和缺点都十分明显:
本 PR 探索了一种统一管理的方法,理论上这个方法能扩展到任意多的子模块。基本方法是:用 build_ext,对 cp_balance 只编译,不安装。生成 .so 文件后,将本地的 python wrapper + .so 文件 copy 到 flash_mask 库安装目录下,由 flash_mask 统一安装。build_ext 对 .so 的裸符号会自动生成适用于paddle动静态图的 wrapper code。不过总的来说,本 PR 的 code 改动相对 #127 还是抽象了一些,写法更 hack,但也能达到正确的 pip wheel 编 whl 以及 pip install -e .,这两种安装方式均已经测试通过。
PR 中的:
_build_cuda_submodule就是用于扩展不同子模块的代码。新的子模块只需要在 flash_mask 中 setup.py 调用此函数。