Repository navigation
DeepEP V2.5 #763
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
+11,700
−17,402
Merged
DeepEP V2.5 #763
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| [submodule "third-party/fmt"] | ||
| path = third-party/fmt | ||
| url = https://github.com/fmtlib/fmt.git | ||
| [submodule "third-party/deep_jit"] | ||
| path = third-party/deep_jit | ||
| url = git@github.com:deepseek-ai/DeepJIT.git | ||
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,63 @@ | ||
| #pragma once | ||
|
|
||
| #include <cstdio> | ||
| #include <memory> | ||
| #include <pybind11/pybind11.h> | ||
|
|
||
| #include "../kernels/comm/api.hpp" | ||
|
|
||
| namespace deep_ep { | ||
|
|
||
| class BufferBase { | ||
| protected: | ||
| bool explicitly_destroy; | ||
| bool destroyed = false; | ||
|
|
||
| explicit BufferBase(const bool& explicitly_destroy): explicitly_destroy(explicitly_destroy) {} | ||
|
|
||
| // Called from the derived destructor, while its members and destroy() implementation are still available. | ||
| void destroy_on_destruction(const char* name) { | ||
| if (not explicitly_destroy and not destroyed) { | ||
| destroy(); | ||
| main_context = nullptr; | ||
| } | ||
|
|
||
| if (not destroyed) { | ||
| std::printf("`destroy()` is not called before DeepEP %s buffer destruction, which can leak resources.\n", name); | ||
| std::fflush(stdout); | ||
| } | ||
| } | ||
|
|
||
| public: | ||
| std::shared_ptr<comm::Context> main_context; | ||
|
|
||
| virtual ~BufferBase() noexcept(false) = default; | ||
| virtual void destroy() = 0; | ||
|
|
||
| void print_memory_usage() const { | ||
| EP_HOST_ASSERT(not destroyed and main_context != nullptr); | ||
| const auto num_workspace_gibs = main_context->num_workspace_bytes / float(1 << 30); | ||
| const auto num_buffer_gibs = main_context->num_gpu_buffer_bytes / float(1 << 30); | ||
| const auto num_gpu_storage_gibs = main_context->use_cpu_rdma_storage ? 0.0 : main_context->num_rdma_storage_bytes / float(1 << 30); | ||
| const auto num_cpu_storage_gibs = main_context->use_cpu_rdma_storage ? main_context->num_rdma_storage_bytes / float(1 << 30) : 0.0; | ||
| std::printf("[DeepEP memory usage] rank_idx=%d, num_ranks=%d, GPU total %.3f GiB " | ||
| "(workspace %.3f GiB, buffer %.3f GiB, RDMA storage %.3f GiB), CPU total %.3f GiB\n", | ||
| main_context->rank_idx, main_context->num_ranks, | ||
| num_workspace_gibs + num_buffer_gibs + num_gpu_storage_gibs, | ||
| num_workspace_gibs, num_buffer_gibs, num_gpu_storage_gibs, num_cpu_storage_gibs); | ||
| std::fflush(stdout); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace deep_ep | ||
|
|
||
| namespace deep_ep::base { | ||
|
|
||
| static void register_apis(pybind11::module_& m) { | ||
| pybind11::class_<BufferBase>(m, "BufferBase") | ||
| .def_readonly("main_context", &BufferBase::main_context) | ||
| .def("print_memory_usage", &BufferBase::print_memory_usage) | ||
| .def("destroy", &BufferBase::destroy); | ||
| } | ||
|
|
||
| } // namespace deep_ep::base |
Oops, something went wrong.
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.
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.
🔴 critical: 子模块 URL 使用 SSH 地址
git@github.com:deepseek-ai/DeepJIT.git。README 要求用户执行git submodule update --init --recursive,未配置 GitHub SSH key 的匿名/HTTPS 用户会直接失败(原fmt子模块使用的是 HTTPS)。建议改为https://github.com/deepseek-ai/DeepJIT.git。🤖 v5