forked from deepseek-ai/DeepEP
-
Notifications
You must be signed in to change notification settings - Fork 3
[Compat] Make hybrid ep branch compatible with PaddlePaddle #12
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
Draft
SigureMo
wants to merge
3
commits into
hybrid-ep-paddle
Choose a base branch
from
hybrid-ep-paddle-dev
base: hybrid-ep-paddle
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| rm -rf build | ||
| rm -rf dist | ||
| rm -rf deep_ep_cpp.cpython-38-x86_64-linux-gnu.so | ||
| export TORCH_CUDA_ARCH_LIST="10.0" | ||
| export PADDLE_CUDA_ARCH_LIST="10.0" | ||
| python setup_deep_ep.py bdist_wheel | ||
| python setup_hybrid_ep.py bdist_wheel | ||
| pip install dist/*.whl --force-reinstall |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
你说得有一定道理,那我能不能这样改,在调用 at::cuda::setCurrentCUDAStream() 时,同时更新 calc_ctx 的 stream:
// 封装一个工具函数 inline void set_current_stream(c10::cuda::CUDAStream stream, phi::GPUContext* calc_ctx) { // 1. 设置 ATen current stream(影响 at::cuda::getCurrentCUDAStream()) at::cuda::setCurrentCUDAStream(stream); // 2. 同步更新 Paddle GPUContext 的 stream // 假设 calc_ctx 提供了设置 stream 的方法 calc_ctx->SetStream(stream.stream()); // 或者等效方法 }然后替换 deep_ep.cpp 中所有的 setCurrentCUDAStream 调用:
注意,这里的修改是以 https://github.com/youge325/DeepEP/tree/cRemove_Optional 和 Paddle 最新的 develop 分支 为基准,或者你有更好的,能够尽可能减小 diff 的方案
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.
参考 #11 和 https://github.com/PaddlePaddle/Paddle 仓库,我们很经常使用
current_stream_wait吗,能不能使用void stream_wait(const at::cuda::CUDAStream& s_0, const at::cuda::CUDAStream& s_1)和void stream_wait(const at::cuda::CUDAStream& s, const EventHandle& event)来代替,我看到在 https://github.com/PaddlePaddle/Paddle 仓库里,有关current_stream_wait的测试都被注释掉了我们的目的就是让 Paddle 来管理 stream ,这样比较好区分通信流和计算流,因此,ProcessGroup 自然要成为唯一真源,至于
current_stream_wait,可以用stream_wait来代替,通过显式传入 CUDAStream 和 EventHandle 来明确语义,从而消除代码歧义