Skip to content

Commit

Permalink
Enable all reduce P2P add through iteration & fix mem leak & refacter…
Browse files Browse the repository at this point in the history
… the mem using to decrease the GPU mem using

Signed-off-by: Zhai, Xuejun <xuejun.zhai@intel.com>
  • Loading branch information
zhaixuejun1993 committed Oct 17, 2024
1 parent 66f88b5 commit 25de131
Show file tree
Hide file tree
Showing 3 changed files with 1,331 additions and 142 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ class SubMemoryManager {
void* send_buf;
std::shared_ptr<void> buf;
bool flag;
int32_t last_rec_part;
bool last_used;
std::shared_ptr<cldnn::stream> stream_ptr;
std::vector<cldnn::memory::ptr> recv_bufs;
std::vector<void*> remote_mems;
std::vector<void*> remote_mems_p2p;
std::vector<bool> recv_flag;
std::vector<bool> recv_flag_concat;
std::vector<bool> add_flag;
std::vector<cldnn::event::ptr> events;
cldnn::memory::ptr output;
cldnn::layout layout;
Expand All @@ -33,9 +39,15 @@ class SubMemoryManager {
_num_sub_streams = num_sub_streams;
MemoryInfo memory_info;
memory_info.flag = false;
memory_info.last_rec_part = -1;
memory_info.last_used = false;
memory_info.layout = cldnn::layout();
memory_info.recv_bufs.assign(_num_sub_streams, nullptr);
memory_info.remote_mems.assign(_num_sub_streams, nullptr);
memory_info.remote_mems_p2p.assign(_num_sub_streams, nullptr);
memory_info.recv_flag.assign(_num_sub_streams, false);
memory_info.recv_flag_concat.assign(_num_sub_streams, false);
memory_info.add_flag.assign(_num_sub_streams, false);
memory_info.events.assign(_num_sub_streams, nullptr);
std::vector<MemoryInfo> memorys;
memorys.assign(_num_sub_streams, memory_info);
Expand Down
Loading

0 comments on commit 25de131

Please sign in to comment.