已合并
[Refactor] HIXL头文件整改 #438
ZhaoBaiwei创建于 5月7日
[Refactor] HIXL头文件整改 #438
已合并
ZhaoBaiwei创建于 5月7日
37 个文件变更+153-325
@@ -484,9 +484,7 @@ Software: metadef fedff4f
484 484 
485Official Repository: https://gitee.com/ascend/metadef485Official Repository: https://gitee.com/ascend/metadef
486 486 
487-Usage: "487+Usage: "tests/depends/error_manager/src/error_manager.h"
488-src/llm_datadist/common/aligned_ptr.cc,
489-tests/depends/error_manager/src/error_manager.h"
490 488 
491Copyright Notice:489Copyright Notice:
492Copyright 2020 Huawei Technologies Co., Ltd.490Copyright 2020 Huawei Technologies Co., Ltd.
@@ -496,18 +494,6 @@ License: Apache License V2.0
496Please see above.494Please see above.
497 495 
498 496 
499-Software: metadef 6e92218
500- 
501-Official Repository: https://gitee.com/ascend/metadef
502- 
503-Usage: "src/llm_datadist/common/aligned_ptr.h"
504- 
505-Copyright Notice: Copyright 2020 Huawei Technologies Co., Ltd.
506- 
507-License: Apache License V2.0
508-Please see above.
509- 
510- 
511Software: metadef d309580497Software: metadef d309580
512 498 
513Official Repository: https://gitee.com/ascend/metadef499Official Repository: https://gitee.com/ascend/metadef
Rsrc/hixl/engine/adxl_engine.ccsrc/hixl/engine/comm_engine.cc+17-17
@@ -8,47 +8,47 @@
8 * See LICENSE in the root of the software repository for the full text of the License.8 * See LICENSE in the root of the software repository for the full text of the License.
9 */9 */
10 10 
11-#include "adxl_engine.h"11+#include "comm_engine.h"
12#include "common/hixl_checker.h"12#include "common/hixl_checker.h"
13 13 
14namespace hixl {14namespace hixl {
15-Status AdxlEngine::Initialize(const std::map<AscendString, AscendString> &options) {15+Status CommEngine::Initialize(const std::map<AscendString, AscendString> &options) {
16 return adxl_inner_engine_.Initialize(options);16 return adxl_inner_engine_.Initialize(options);
17}17}
18 18 
19-void AdxlEngine::Finalize() {19+void CommEngine::Finalize() {
20 adxl_inner_engine_.Finalize();20 adxl_inner_engine_.Finalize();
21}21}
22 22 
23-bool AdxlEngine::IsInitialized() const {23+bool CommEngine::IsInitialized() const {
24 return adxl_inner_engine_.IsInitialized();24 return adxl_inner_engine_.IsInitialized();
25}25}
26 26 
27-Status AdxlEngine::RegisterMem(const MemDesc &mem, MemType type, MemHandle &mem_handle) {27+Status CommEngine::RegisterMem(const MemDesc &mem, MemType type, MemHandle &mem_handle) {
28 adxl::MemDesc adxl_mem{mem.addr, mem.len};28 adxl::MemDesc adxl_mem{mem.addr, mem.len};
29 adxl::MemType adxl_type = static_cast<adxl::MemType>(type);29 adxl::MemType adxl_type = static_cast<adxl::MemType>(type);
30 return adxl_inner_engine_.RegisterMem(adxl_mem, adxl_type, mem_handle);30 return adxl_inner_engine_.RegisterMem(adxl_mem, adxl_type, mem_handle);
31}31}
32 32 
33-Status AdxlEngine::DeregisterMem(MemHandle mem_handle) {33+Status CommEngine::DeregisterMem(MemHandle mem_handle) {
34 return adxl_inner_engine_.DeregisterMem(mem_handle);34 return adxl_inner_engine_.DeregisterMem(mem_handle);
35}35}
36 36 
37-Status AdxlEngine::Connect(const AscendString &remote_engine, int32_t timeout_in_millis) {37+Status CommEngine::Connect(const AscendString &remote_engine, int32_t timeout_in_millis) {
38 return adxl_inner_engine_.Connect(remote_engine, timeout_in_millis);38 return adxl_inner_engine_.Connect(remote_engine, timeout_in_millis);
39}39}
40 40 
41-Status AdxlEngine::Disconnect(const AscendString &remote_engine, int32_t timeout_in_millis) {41+Status CommEngine::Disconnect(const AscendString &remote_engine, int32_t timeout_in_millis) {
42 return adxl_inner_engine_.Disconnect(remote_engine, timeout_in_millis);42 return adxl_inner_engine_.Disconnect(remote_engine, timeout_in_millis);
43}43}
44 44 
45-void AdxlEngine::Disconnect() {45+void CommEngine::Disconnect() {
46 adxl_inner_engine_.Disconnect();46 adxl_inner_engine_.Disconnect();
47}47}
48 48 
49-Status AdxlEngine::TransferSync(const AscendString &remote_engine, TransferOp operation,49+Status CommEngine::TransferSync(const AscendString &remote_engine, TransferOp operation,
50 const std::vector<TransferOpDesc> &op_descs, int32_t timeout_in_millis) {50 const std::vector<TransferOpDesc> &op_descs, int32_t timeout_in_millis) {
51- HIXL_CHK_BOOL_RET_STATUS(!op_descs.empty(), PARAM_INVALID, "[AdxlEngine] TransferSync failed, op_descs is empty.");51+ HIXL_CHK_BOOL_RET_STATUS(!op_descs.empty(), PARAM_INVALID, "[CommEngine] TransferSync failed, op_descs is empty.");
52 adxl::TransferOp adxl_operation = static_cast<adxl::TransferOp>(operation);52 adxl::TransferOp adxl_operation = static_cast<adxl::TransferOp>(operation);
53 std::vector<adxl::TransferOpDesc> adxl_op_descs;53 std::vector<adxl::TransferOpDesc> adxl_op_descs;
54 for (const auto &op_desc : op_descs) {54 for (const auto &op_desc : op_descs) {
@@ -57,10 +57,10 @@ Status AdxlEngine::TransferSync(const AscendString &remote_engine, TransferOp op
57 return adxl_inner_engine_.TransferSync(remote_engine, adxl_operation, adxl_op_descs, timeout_in_millis);57 return adxl_inner_engine_.TransferSync(remote_engine, adxl_operation, adxl_op_descs, timeout_in_millis);
58}58}
59 59 
60-Status AdxlEngine::TransferAsync(const AscendString &remote_engine, TransferOp operation,60+Status CommEngine::TransferAsync(const AscendString &remote_engine, TransferOp operation,
61 const std::vector<TransferOpDesc> &op_descs, const TransferArgs &optional_args,61 const std::vector<TransferOpDesc> &op_descs, const TransferArgs &optional_args,
62 TransferReq &req) {62 TransferReq &req) {
63- HIXL_CHK_BOOL_RET_STATUS(!op_descs.empty(), PARAM_INVALID, "[AdxlEngine] TransferAsync failed, op_descs is empty.");63+ HIXL_CHK_BOOL_RET_STATUS(!op_descs.empty(), PARAM_INVALID, "[CommEngine] TransferAsync failed, op_descs is empty.");
64 (void)optional_args;64 (void)optional_args;
65 adxl::TransferOp adxl_operation = static_cast<adxl::TransferOp>(operation);65 adxl::TransferOp adxl_operation = static_cast<adxl::TransferOp>(operation);
66 std::vector<adxl::TransferOpDesc> adxl_op_descs;66 std::vector<adxl::TransferOpDesc> adxl_op_descs;
@@ -71,19 +71,19 @@ Status AdxlEngine::TransferAsync(const AscendString &remote_engine, TransferOp o
71 return adxl_inner_engine_.TransferAsync(remote_engine, adxl_operation, adxl_op_descs, adxl_optional_args, req);71 return adxl_inner_engine_.TransferAsync(remote_engine, adxl_operation, adxl_op_descs, adxl_optional_args, req);
72}72}
73 73 
74-Status AdxlEngine::GetTransferStatus(const TransferReq &req, TransferStatus &status) {74+Status CommEngine::GetTransferStatus(const TransferReq &req, TransferStatus &status) {
75 adxl::TransferStatus adxl_status;75 adxl::TransferStatus adxl_status;
76 auto ret = adxl_inner_engine_.GetTransferStatus(req, adxl_status);76 auto ret = adxl_inner_engine_.GetTransferStatus(req, adxl_status);
77 status = static_cast<hixl::TransferStatus>(adxl_status);77 status = static_cast<hixl::TransferStatus>(adxl_status);
78 return ret;78 return ret;
79}79}
80 80 
81-Status AdxlEngine::SendNotify(const AscendString &remote_engine, const NotifyDesc &notify, int32_t timeout_in_millis) {81+Status CommEngine::SendNotify(const AscendString &remote_engine, const NotifyDesc &notify, int32_t timeout_in_millis) {
82 adxl::NotifyDesc adxl_notify{notify.name, notify.notify_msg};82 adxl::NotifyDesc adxl_notify{notify.name, notify.notify_msg};
83 return adxl_inner_engine_.SendNotify(remote_engine, adxl_notify, timeout_in_millis);83 return adxl_inner_engine_.SendNotify(remote_engine, adxl_notify, timeout_in_millis);
84}84}
85 85 
86-Status AdxlEngine::GetNotifies(std::vector<NotifyDesc> &notifies) {86+Status CommEngine::GetNotifies(std::vector<NotifyDesc> &notifies) {
87 std::vector<adxl::NotifyDesc> adxl_notifies;87 std::vector<adxl::NotifyDesc> adxl_notifies;
88 auto ret = adxl_inner_engine_.GetNotifies(adxl_notifies);88 auto ret = adxl_inner_engine_.GetNotifies(adxl_notifies);
89 for (const auto &adxl_notify : adxl_notifies) {89 for (const auto &adxl_notify : adxl_notifies) {
@@ -92,7 +92,7 @@ Status AdxlEngine::GetNotifies(std::vector<NotifyDesc> &notifies) {
92 return ret;92 return ret;
93}93}
94 94 
95-Status AdxlEngine::RegisterCallbackProcessor(int32_t msg_type, CallbackProcessor processor) {95+Status CommEngine::RegisterCallbackProcessor(int32_t msg_type, CallbackProcessor processor) {
96 return adxl_inner_engine_.RegisterCallbackProcessor(msg_type, processor);96 return adxl_inner_engine_.RegisterCallbackProcessor(msg_type, processor);
97}97}
98} // namespace hixl98} // namespace hixl
Rsrc/hixl/engine/adxl_engine.hsrc/hixl/engine/comm_engine.h+3-3
@@ -17,11 +17,11 @@
17#include "hixl/hixl_types.h"17#include "hixl/hixl_types.h"
18 18 
19namespace hixl {19namespace hixl {
20-class AdxlEngine : public Engine {20+class CommEngine : public Engine {
21 public:21 public:
22- explicit AdxlEngine(const AscendString &local_engine) : Engine(local_engine), adxl_inner_engine_(local_engine) {};22+ explicit CommEngine(const AscendString &local_engine) : Engine(local_engine), adxl_inner_engine_(local_engine) {};
23 23 
24- ~AdxlEngine() override = default;24+ ~CommEngine() override = default;
25 25 
26 Status Initialize(const std::map<AscendString, AscendString> &options) override;26 Status Initialize(const std::map<AscendString, AscendString> &options) override;
27 27 
@@ -46,7 +46,7 @@ std::unique_ptr<Engine> EngineFactory::CreateEngine(const std::string local_engi
46 const auto hixl_it = options.find(hixl::OPTION_LOCAL_COMM_RES);46 const auto hixl_it = options.find(hixl::OPTION_LOCAL_COMM_RES);
47 const auto adxl_it = options.find(adxl::OPTION_LOCAL_COMM_RES);47 const auto adxl_it = options.find(adxl::OPTION_LOCAL_COMM_RES);
48 if ((hixl_it == options.end()) && (adxl_it == options.end())) {48 if ((hixl_it == options.end()) && (adxl_it == options.end())) {
49- return std::make_unique<AdxlEngine>(AscendString(local_engine.c_str()));49+ return std::make_unique<CommEngine>(AscendString(local_engine.c_str()));
50 }50 }
51 const auto &it = hixl_it == options.end() ? adxl_it : hixl_it;51 const auto &it = hixl_it == options.end() ? adxl_it : hixl_it;
52 std::string local_comm_res = it->second.GetString();52 std::string local_comm_res = it->second.GetString();
@@ -62,6 +62,6 @@ std::unique_ptr<Engine> EngineFactory::CreateEngine(const std::string local_engi
62 if (use_hixl) {62 if (use_hixl) {
63 return std::make_unique<HixlEngine>(AscendString(local_engine.c_str()));63 return std::make_unique<HixlEngine>(AscendString(local_engine.c_str()));
64 }64 }
65- return std::make_unique<AdxlEngine>(AscendString(local_engine.c_str()));65+ return std::make_unique<CommEngine>(AscendString(local_engine.c_str()));
66}66}
67} // namespace hixl67} // namespace hixl
@@ -14,7 +14,7 @@
14#include <map>14#include <map>
15#include "engine.h"15#include "engine.h"
16#include "hixl_engine.h"16#include "hixl_engine.h"
17-#include "adxl_engine.h"17+#include "comm_engine.h"
18 18 
19namespace hixl {19namespace hixl {
20class EngineFactory {20class EngineFactory {
@@ -12,7 +12,7 @@
12#include "hixl/hixl.h"12#include "hixl/hixl.h"
13#include "common/hixl_checker.h"13#include "common/hixl_checker.h"
14#include "common/hixl_utils.h"14#include "common/hixl_utils.h"
15-#include "adxl_engine.h"15+#include "comm_engine.h"
16#include "base/err_msg.h"16#include "base/err_msg.h"
17#include "engine.h"17#include "engine.h"
18#include "engine_factory.h"18#include "engine_factory.h"
@@ -92,7 +92,7 @@ add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
92file(GLOB ADXL_SRC_LIST92file(GLOB ADXL_SRC_LIST
93 "${CMAKE_CURRENT_LIST_DIR}/adxl/*.cc"93 "${CMAKE_CURRENT_LIST_DIR}/adxl/*.cc"
94 "${CMAKE_CURRENT_LIST_DIR}/llm_datadist_timer.cc"94 "${CMAKE_CURRENT_LIST_DIR}/llm_datadist_timer.cc"
95- "${CMAKE_CURRENT_LIST_DIR}/statistic_manager.cc"95+ "${CMAKE_CURRENT_LIST_DIR}/comm_statistic_manager.cc"
96 "${CMAKE_CURRENT_LIST_DIR}/common/*.cc"96 "${CMAKE_CURRENT_LIST_DIR}/common/*.cc"
97 "${CMAKE_CURRENT_LIST_DIR}/hccl/*.cc"97 "${CMAKE_CURRENT_LIST_DIR}/hccl/*.cc"
98 "${CMAKE_CURRENT_LIST_DIR}/memory/*.cc"98 "${CMAKE_CURRENT_LIST_DIR}/memory/*.cc"
@@ -16,7 +16,7 @@
16#include "adxl/adxl_types.h"16#include "adxl/adxl_types.h"
17#include "common/llm_mem_pool.h"17#include "common/llm_mem_pool.h"
18#include "common/llm_thread_pool.h"18#include "common/llm_thread_pool.h"
19-#include "channel.h"19+#include "comm_channel.h"
20#include "control_msg_handler.h"20#include "control_msg_handler.h"
21 21 
22namespace adxl {22namespace adxl {
@@ -427,7 +427,7 @@ Status ChannelManager::CreateChannel(const ChannelInfo &channel_info, ChannelPtr
427 "Channel already exists, channel_type = %d, channel id:%s",427 "Channel already exists, channel_type = %d, channel id:%s",
Z
Zzhaozhihui5月19日
已过期

这种日志没必要改

likedislike
428 static_cast<int32_t>(channel_info.channel_type), channel_info.channel_id.c_str());428 static_cast<int32_t>(channel_info.channel_type), channel_info.channel_id.c_str());
429 }429 }
430- ChannelPtr channel = llm::MakeShared<Channel>(channel_info);430+ ChannelPtr channel = llm::MakeShared<CommChannel>(channel_info);
431 ADXL_CHECK_NOTNULL(channel);431 ADXL_CHECK_NOTNULL(channel);
432 ADXL_CHK_STATUS_RET(channel->Initialize(), "Failed to init channel");432 ADXL_CHK_STATUS_RET(channel->Initialize(), "Failed to init channel");
433 channel->SetStreamPool(stream_pool_);433 channel->SetStreamPool(stream_pool_);
@@ -18,7 +18,7 @@
18#include <queue>18#include <queue>
19#include <atomic>19#include <atomic>
20#include <functional>20#include <functional>
21-#include "channel.h"21+#include "comm_channel.h"
22#include "common/llm_mem_pool.h"22#include "common/llm_mem_pool.h"
23#include "buffer_transfer_service.h"23#include "buffer_transfer_service.h"
24 24 
@@ -16,7 +16,7 @@
16#include "common/msg_handler_plugin.h"16#include "common/msg_handler_plugin.h"
17#include "hccl/hccl_adapter.h"17#include "hccl/hccl_adapter.h"
18#include "common/llm_utils.h"18#include "common/llm_utils.h"
19-#include "channel.h"19+#include "comm_channel.h"
20#include "common/llm_checker.h"20#include "common/llm_checker.h"
21#include "common/llm_scope_guard.h"21#include "common/llm_scope_guard.h"
22#include "common/def_types.h"22#include "common/def_types.h"
Rsrc/llm_datadist/adxl/channel.ccsrc/llm_datadist/adxl/comm_channel.cc+28-28
@@ -8,7 +8,7 @@
8 * See LICENSE in the root of the software repository for the full text of the License.8 * See LICENSE in the root of the software repository for the full text of the License.
9 */9 */
10 10 
11-#include "channel.h"11+#include "comm_channel.h"
12#include <mutex>12#include <mutex>
13#include <fcntl.h>13#include <fcntl.h>
14#include <unistd.h>14#include <unistd.h>
@@ -36,9 +36,9 @@ uint64_t GetDurationUs(const std::chrono::steady_clock::time_point &start,
36}36}
37} // namespace37} // namespace
38 38 
39-int64_t Channel::timeout_in_millis_ = kHeartbeatTimeoutInMillis;39+int64_t CommChannel::timeout_in_millis_ = kHeartbeatTimeoutInMillis;
40 40 
41-Status Channel::Initialize() {41+Status CommChannel::Initialize() {
42 const auto hccl_start = std::chrono::steady_clock::now();42 const auto hccl_start = std::chrono::steady_clock::now();
43 ADXL_CHK_STATUS_RET(InitializeHcclComm(), "Failed to initialize hccl comm");43 ADXL_CHK_STATUS_RET(InitializeHcclComm(), "Failed to initialize hccl comm");
44 44 
@@ -55,16 +55,16 @@ Status Channel::Initialize() {
55 return SUCCESS;55 return SUCCESS;
56}56}
57 57 
58-std::string Channel::GetChannelId() const {58+std::string CommChannel::GetChannelId() const {
59 return channel_info_.channel_id;59 return channel_info_.channel_id;
60}60}
61 61 
62-std::string Channel::GetStatisticChannelId() const {62+std::string CommChannel::GetStatisticChannelId() const {
63 return StatisticManager::GetStatisticChannelId(channel_info_.channel_id,63 return StatisticManager::GetStatisticChannelId(channel_info_.channel_id,
64 channel_info_.channel_type == ChannelType::kClient);64 channel_info_.channel_type == ChannelType::kClient);
65}65}
66 66 
67-Status Channel::InitializeHcclComm() {67+Status CommChannel::InitializeHcclComm() {
68 LLMLOGI("HcclCommInitClusterInfoMemConfig begin, comm_name=%s, local rank_id=%u, rank_table=%s",68 LLMLOGI("HcclCommInitClusterInfoMemConfig begin, comm_name=%s, local rank_id=%u, rank_table=%s",
69 channel_info_.comm_config.hcclCommName, channel_info_.local_rank_id, channel_info_.rank_table.c_str());69 channel_info_.comm_config.hcclCommName, channel_info_.local_rank_id, channel_info_.rank_table.c_str());
70 std::lock_guard<std::mutex> lock(g_mutex_);70 std::lock_guard<std::mutex> lock(g_mutex_);
@@ -78,7 +78,7 @@ Status Channel::InitializeHcclComm() {
78 return SUCCESS;78 return SUCCESS;
79}79}
80 80 
81-Status Channel::BindRegisteredMemory(std::vector<void *> &bind_handles) {81+Status CommChannel::BindRegisteredMemory(std::vector<void *> &bind_handles) {
82 const auto start = std::chrono::steady_clock::now();82 const auto start = std::chrono::steady_clock::now();
83 for (const auto &reg_handle_it : channel_info_.registered_mems) {83 for (const auto &reg_handle_it : channel_info_.registered_mems) {
84 auto reg_handle = reg_handle_it.first;84 auto reg_handle = reg_handle_it.first;
@@ -91,7 +91,7 @@ Status Channel::BindRegisteredMemory(std::vector<void *> &bind_handles) {
91 return SUCCESS;91 return SUCCESS;
92}92}
93 93 
94-Status Channel::PrepareHcclComm(const std::chrono::steady_clock::time_point &hccl_start) {94+Status CommChannel::PrepareHcclComm(const std::chrono::steady_clock::time_point &hccl_start) {
95 const auto start = std::chrono::steady_clock::now();95 const auto start = std::chrono::steady_clock::now();
96 HcclPrepareConfig prepareConfig{};96 HcclPrepareConfig prepareConfig{};
97 ADXL_CHK_HCCL_RET(97 ADXL_CHK_HCCL_RET(
@@ -104,14 +104,14 @@ Status Channel::PrepareHcclComm(const std::chrono::steady_clock::time_point &hcc
104 return SUCCESS;104 return SUCCESS;
105}105}
106 106 
107-void Channel::ClearNotifyMessages() {107+void CommChannel::ClearNotifyMessages() {
108 {108 {
109 std::lock_guard<std::mutex> notify_lock(notify_message_mutex_);109 std::lock_guard<std::mutex> notify_lock(notify_message_mutex_);
110 notify_messages_.clear();110 notify_messages_.clear();
111 }111 }
112}112}
113 113 
114-Status Channel::Finalize() {114+Status CommChannel::Finalize() {
115 finalized_.store(true, std::memory_order_release);115 finalized_.store(true, std::memory_order_release);
116 ADXL_CHK_STATUS_RET(ClearResources(), "Failed to clear channel resources.");116 ADXL_CHK_STATUS_RET(ClearResources(), "Failed to clear channel resources.");
117 117 
@@ -130,7 +130,7 @@ Status Channel::Finalize() {
130 return SUCCESS;130 return SUCCESS;
131}131}
132 132 
133-Status Channel::ClearResources() {133+Status CommChannel::ClearResources() {
134 std::lock_guard<std::mutex> lock(transfer_mutex_);134 std::lock_guard<std::mutex> lock(transfer_mutex_);
135 auto ret = SUCCESS;135 auto ret = SUCCESS;
136 for (const auto &reg_handle_it : channel_info_.registered_mems) {136 for (const auto &reg_handle_it : channel_info_.registered_mems) {
@@ -167,11 +167,11 @@ Status Channel::ClearResources() {
167 return ret;167 return ret;
168}168}
169 169 
170-void Channel::SetStreamPool(StreamPool *stream_pool) {170+void CommChannel::SetStreamPool(StreamPool *stream_pool) {
171 stream_pool_ = stream_pool;171 stream_pool_ = stream_pool;
172}172}
173 173 
174-Status Channel::TransferAsync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,174+Status CommChannel::TransferAsync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,
175 const TransferArgs &optional_args, TransferReq &req) {175 const TransferArgs &optional_args, TransferReq &req) {
176 (void)optional_args;176 (void)optional_args;
177 aclrtStream stream = nullptr;177 aclrtStream stream = nullptr;
@@ -200,7 +200,7 @@ Status Channel::TransferAsync(TransferOp operation, const std::vector<TransferOp
200 return SUCCESS;200 return SUCCESS;
201}201}
202 202 
203-Status Channel::GetTransferStatus(const TransferReq &req, TransferStatus &status) {203+Status CommChannel::GetTransferStatus(const TransferReq &req, TransferStatus &status) {
204 std::lock_guard<std::mutex> lock(transfer_reqs_mutex_);204 std::lock_guard<std::mutex> lock(transfer_reqs_mutex_);
205 auto id = reinterpret_cast<uint64_t>(req);205 auto id = reinterpret_cast<uint64_t>(req);
206 auto it = req_2_async_record_.find(id);206 auto it = req_2_async_record_.find(id);
@@ -251,7 +251,7 @@ Status Channel::GetTransferStatus(const TransferReq &req, TransferStatus &status
251 return SUCCESS;251 return SUCCESS;
252}252}
253 253 
254-Status Channel::TransferAsync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs, aclrtStream stream) {254+Status CommChannel::TransferAsync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs, aclrtStream stream) {
255 ADXL_CHK_BOOL_RET_STATUS(channel_info_.comm != nullptr, FAILED,255 ADXL_CHK_BOOL_RET_STATUS(channel_info_.comm != nullptr, FAILED,
256 "Channel comm is null, channel may have been finalized, channel_id:%s.",256 "Channel comm is null, channel may have been finalized, channel_id:%s.",
257 channel_info_.channel_id.c_str());257 channel_info_.channel_id.c_str());
@@ -273,7 +273,7 @@ Status Channel::TransferAsync(TransferOp operation, const std::vector<TransferOp
273 return SUCCESS;273 return SUCCESS;
274}274}
275 275 
276-Status Channel::TransferAsyncWithTimeout(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,276+Status CommChannel::TransferAsyncWithTimeout(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,
277 aclrtStream stream, uint64_t timeout) {277 aclrtStream stream, uint64_t timeout) {
278 ADXL_CHK_BOOL_RET_STATUS(channel_info_.comm != nullptr, FAILED,278 ADXL_CHK_BOOL_RET_STATUS(channel_info_.comm != nullptr, FAILED,
279 "Channel comm is null, channel may have been finalized, channel_id:%s.",279 "Channel comm is null, channel may have been finalized, channel_id:%s.",
@@ -309,7 +309,7 @@ Status Channel::TransferAsyncWithTimeout(TransferOp operation, const std::vector
309 return SUCCESS;309 return SUCCESS;
310}310}
311 311 
312-Status Channel::TransferSync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,312+Status CommChannel::TransferSync(TransferOp operation, const std::vector<TransferOpDesc> &op_descs,
313 int32_t timeout_in_millis) {313 int32_t timeout_in_millis) {
314 const auto start = std::chrono::steady_clock::now();314 const auto start = std::chrono::steady_clock::now();
315 aclrtStream stream = nullptr;315 aclrtStream stream = nullptr;
@@ -333,7 +333,7 @@ Status Channel::TransferSync(TransferOp operation, const std::vector<TransferOpD
333 return SUCCESS;333 return SUCCESS;
334}334}
335 335 
336-Status Channel::SetSocketNonBlocking(int32_t fd) {336+Status CommChannel::SetSocketNonBlocking(int32_t fd) {
337 std::lock_guard<std::mutex> lock(mutex_);337 std::lock_guard<std::mutex> lock(mutex_);
338 int flags = fcntl(fd, F_GETFL, 0);338 int flags = fcntl(fd, F_GETFL, 0);
339 ADXL_CHK_BOOL_RET_STATUS(flags != -1, FAILED, "Failed to get fd flags: %s", strerror(errno));339 ADXL_CHK_BOOL_RET_STATUS(flags != -1, FAILED, "Failed to get fd flags: %s", strerror(errno));
@@ -347,13 +347,13 @@ Status Channel::SetSocketNonBlocking(int32_t fd) {
347 return SUCCESS;347 return SUCCESS;
348}348}
349 349 
350-void Channel::StopHeartbeat() {350+void CommChannel::StopHeartbeat() {
351 std::lock_guard<std::mutex> lock(mutex_);351 std::lock_guard<std::mutex> lock(mutex_);
352 with_heartbeat_.store(false, std::memory_order_release);352 with_heartbeat_.store(false, std::memory_order_release);
353 disconnect_flag_.store(true, std::memory_order_release);353 disconnect_flag_.store(true, std::memory_order_release);
354}354}
355 355 
356-Status Channel::CommWithFd(const std::function<Status(int32_t)> &func) {356+Status CommChannel::CommWithFd(const std::function<Status(int32_t)> &func) {
357 std::lock_guard<std::mutex> lock(mutex_);357 std::lock_guard<std::mutex> lock(mutex_);
358 if (fd_ < 0) {358 if (fd_ < 0) {
359 return FAILED;359 return FAILED;
@@ -361,26 +361,26 @@ Status Channel::CommWithFd(const std::function<Status(int32_t)> &func) {
361 return func(fd_);361 return func(fd_);
362}362}
363 363 
364-Status Channel::SendControlMsg(const std::function<Status(int32_t)> &func) {364+Status CommChannel::SendControlMsg(const std::function<Status(int32_t)> &func) {
365 return CommWithFd(func);365 return CommWithFd(func);
366}366}
367 367 
368-Status Channel::SendHeartBeat(const std::function<Status(int32_t)> &func) {368+Status CommChannel::SendHeartBeat(const std::function<Status(int32_t)> &func) {
369 if (with_heartbeat_.load(std::memory_order_acquire)) {369 if (with_heartbeat_.load(std::memory_order_acquire)) {
370 return CommWithFd(func);370 return CommWithFd(func);
371 }371 }
372 return SUCCESS;372 return SUCCESS;
373}373}
374 374 
375-void Channel::SetHeartbeatTimeout(int64_t timeout_in_millis) {375+void CommChannel::SetHeartbeatTimeout(int64_t timeout_in_millis) {
376 timeout_in_millis_ = timeout_in_millis;376 timeout_in_millis_ = timeout_in_millis;
377}377}
378 378 
379-void Channel::UpdateHeartbeatTime() {379+void CommChannel::UpdateHeartbeatTime() {
380 last_heartbeat_time_ = std::chrono::steady_clock::now();380 last_heartbeat_time_ = std::chrono::steady_clock::now();
381}381}
382 382 
383-bool Channel::IsHeartbeatTimeout() const {383+bool CommChannel::IsHeartbeatTimeout() const {
384 if (with_heartbeat_.load(std::memory_order_acquire)) {384 if (with_heartbeat_.load(std::memory_order_acquire)) {
385 auto now = std::chrono::steady_clock::now();385 auto now = std::chrono::steady_clock::now();
386 const auto cost = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_heartbeat_time_).count();386 const auto cost = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_heartbeat_time_).count();
@@ -392,15 +392,15 @@ bool Channel::IsHeartbeatTimeout() const {
392 return false;392 return false;
393}393}
394 394 
395-StreamPool *Channel::GetStreamPool() {395+StreamPool *CommChannel::GetStreamPool() {
396 return stream_pool_;396 return stream_pool_;
397}397}
398 398 
399-std::mutex &Channel::GetTransferMutex() {399+std::mutex &CommChannel::GetTransferMutex() {
400 return transfer_mutex_;400 return transfer_mutex_;
401}401}
402 402 
403-void Channel::GetNotifyMessages(std::vector<NotifyDesc> &notifies) {403+void CommChannel::GetNotifyMessages(std::vector<NotifyDesc> &notifies) {
404 std::lock_guard<std::mutex> lock(notify_message_mutex_);404 std::lock_guard<std::mutex> lock(notify_message_mutex_);
405 for (auto &notify_msg : notify_messages_) {405 for (auto &notify_msg : notify_messages_) {
406 NotifyDesc notify;406 NotifyDesc notify;
Rsrc/llm_datadist/adxl/channel.hsrc/llm_datadist/adxl/comm_channel.h+3-3
@@ -62,9 +62,9 @@ struct AsyncRecord {
62 62 
63enum class RecvState { WAITING_FOR_HEADER, WAITING_FOR_BODY };63enum class RecvState { WAITING_FOR_HEADER, WAITING_FOR_BODY };
64 64 
65-class Channel {65+class CommChannel {
66 public:66 public:
67- explicit Channel(ChannelInfo info) : channel_info_(std::move(info)){};67+ explicit CommChannel(ChannelInfo info) : channel_info_(std::move(info)){};
68 Status Initialize();68 Status Initialize();
69 Status Finalize();69 Status Finalize();
70 std::string GetChannelId() const;70 std::string GetChannelId() const;
@@ -155,7 +155,7 @@ class Channel {
155 std::unordered_map<uint64_t, AsyncRecord> req_2_async_record_;155 std::unordered_map<uint64_t, AsyncRecord> req_2_async_record_;
156 StreamPool *stream_pool_ = nullptr;156 StreamPool *stream_pool_ = nullptr;
157};157};
158-using ChannelPtr = std::shared_ptr<Channel>;158+using ChannelPtr = std::shared_ptr<CommChannel>;
159} // namespace adxl159} // namespace adxl
160 160 
161#endif // CANN_GRAPH_ENGINE_RUNTIME_LLM_DATADIST_V2_CHANNEL_H_161#endif // CANN_GRAPH_ENGINE_RUNTIME_LLM_DATADIST_V2_CHANNEL_H_
@@ -11,7 +11,7 @@
11#include "data_cache_engine.h"11#include "data_cache_engine.h"
12#include <set>12#include <set>
13#include "llm_datadist/llm_error_codes.h"13#include "llm_datadist/llm_error_codes.h"
14-#include "statistic_manager.h"14+#include "comm_statistic_manager.h"
15#include "common/common.h"15#include "common/common.h"
16#include "common/llm_utils.h"16#include "common/llm_utils.h"
17#include "common/hixl_utils.h"17#include "common/hixl_utils.h"
Rsrc/llm_datadist/statistic_manager.ccsrc/llm_datadist/comm_statistic_manager.cc+22-22
@@ -9,13 +9,13 @@
9 */9 */
10 10 
11#include "common/llm_log.h"11#include "common/llm_log.h"
12-#include "statistic_manager.h"12+#include "comm_statistic_manager.h"
13namespace llm {13namespace llm {
14-StatisticManager &StatisticManager::GetInstance() {14+CommStatisticManager &CommStatisticManager::GetInstance() {
15- static StatisticManager instance;15+ static CommStatisticManager instance;
16 return instance;16 return instance;
17}17}
18-void StatisticManager::UpdateCost(const uint64_t cost, uint64_t &total_times, uint64_t &min_cost, uint64_t &max_cost,18+void CommStatisticManager::UpdateCost(const uint64_t cost, uint64_t &total_times, uint64_t &min_cost, uint64_t &max_cost,
19 uint64_t &total_cost) {19 uint64_t &total_cost) {
20 total_times++;20 total_times++;
21 total_cost += cost;21 total_cost += cost;
@@ -23,7 +23,7 @@ void StatisticManager::UpdateCost(const uint64_t cost, uint64_t &total_times, ui
23 min_cost = (min_cost > cost) ? cost : min_cost;23 min_cost = (min_cost > cost) ? cost : min_cost;
24}24}
25 25 
26-void StatisticManager::UpdateCost(const uint64_t cost, std::atomic<uint64_t> &total_times,26+void CommStatisticManager::UpdateCost(const uint64_t cost, std::atomic<uint64_t> &total_times,
27 std::atomic<uint64_t> &min_cost, std::atomic<uint64_t> &max_cost,27 std::atomic<uint64_t> &min_cost, std::atomic<uint64_t> &max_cost,
28 std::atomic<uint64_t> &total_cost) {28 std::atomic<uint64_t> &total_cost) {
29 (void)total_times.fetch_add(1U);29 (void)total_times.fetch_add(1U);
@@ -36,68 +36,68 @@ void StatisticManager::UpdateCost(const uint64_t cost, std::atomic<uint64_t> &to
36 }36 }
37}37}
38 38 
39-void StatisticManager::AddExchangeMemCost(const uint64_t cost) {39+void CommStatisticManager::AddExchangeMemCost(const uint64_t cost) {
40 UpdateCost(cost, link_statistic_info_.exchange_mem_times, link_statistic_info_.exchange_mem_min_cost,40 UpdateCost(cost, link_statistic_info_.exchange_mem_times, link_statistic_info_.exchange_mem_min_cost,
41 link_statistic_info_.exchange_mem_max_cost, link_statistic_info_.exchange_mem_total_cost);41 link_statistic_info_.exchange_mem_max_cost, link_statistic_info_.exchange_mem_total_cost);
42}42}
43 43 
44-void StatisticManager::AddCommInitCost(const uint64_t cost) {44+void CommStatisticManager::AddCommInitCost(const uint64_t cost) {
45 UpdateCost(cost, link_statistic_info_.comm_init_times, link_statistic_info_.comm_init_min_cost,45 UpdateCost(cost, link_statistic_info_.comm_init_times, link_statistic_info_.comm_init_min_cost,
46 link_statistic_info_.comm_init_max_cost, link_statistic_info_.comm_init_total_cost);46 link_statistic_info_.comm_init_max_cost, link_statistic_info_.comm_init_total_cost);
47}47}
48 48 
49-void StatisticManager::AddCommDestroyCost(const uint64_t cost) {49+void CommStatisticManager::AddCommDestroyCost(const uint64_t cost) {
50 UpdateCost(cost, link_statistic_info_.comm_destroy_times, link_statistic_info_.comm_destroy_min_cost,50 UpdateCost(cost, link_statistic_info_.comm_destroy_times, link_statistic_info_.comm_destroy_min_cost,
51 link_statistic_info_.comm_destroy_max_cost, link_statistic_info_.comm_destroy_total_cost);51 link_statistic_info_.comm_destroy_max_cost, link_statistic_info_.comm_destroy_total_cost);
52}52}
53 53 
54-void StatisticManager::AddRegisterGlobalMemTimes() {54+void CommStatisticManager::AddRegisterGlobalMemTimes() {
55 link_statistic_info_.register_global_mem_times++;55 link_statistic_info_.register_global_mem_times++;
56}56}
57 57 
58-void StatisticManager::AddDeregisterGlobalMemTimes() {58+void CommStatisticManager::AddDeregisterGlobalMemTimes() {
59 link_statistic_info_.deregister_global_mem_times++;59 link_statistic_info_.deregister_global_mem_times++;
60}60}
61 61 
62-void StatisticManager::AddCommBindMemTimes() {62+void CommStatisticManager::AddCommBindMemTimes() {
63 link_statistic_info_.comm_bind_mem_times++;63 link_statistic_info_.comm_bind_mem_times++;
64}64}
65 65 
66-void StatisticManager::AddCommUnbindMemTimes() {66+void CommStatisticManager::AddCommUnbindMemTimes() {
67 link_statistic_info_.comm_unbind_mem_times++;67 link_statistic_info_.comm_unbind_mem_times++;
68}68}
69 69 
70-void StatisticManager::AddCommPrepareCost(const uint64_t cost) {70+void CommStatisticManager::AddCommPrepareCost(const uint64_t cost) {
71 UpdateCost(cost, link_statistic_info_.comm_prepare_times, link_statistic_info_.comm_prepare_min_cost,71 UpdateCost(cost, link_statistic_info_.comm_prepare_times, link_statistic_info_.comm_prepare_min_cost,
72 link_statistic_info_.comm_prepare_max_cost, link_statistic_info_.comm_prepare_total_cost);72 link_statistic_info_.comm_prepare_max_cost, link_statistic_info_.comm_prepare_total_cost);
73}73}
74 74 
75-void StatisticManager::AddBatchPutCost(const uint64_t cost) {75+void CommStatisticManager::AddBatchPutCost(const uint64_t cost) {
76 send_statistic_info_.batch_put_times++;76 send_statistic_info_.batch_put_times++;
77 send_statistic_info_.batch_put_total_cost += cost;77 send_statistic_info_.batch_put_total_cost += cost;
78}78}
79 79 
80-MemoryStatisticInfo &StatisticManager::GetMemoryStatisticInfo() {80+MemoryStatisticInfo &CommStatisticManager::GetMemoryStatisticInfo() {
81 return memory_statistic_info_;81 return memory_statistic_info_;
82}82}
83-FuncStatisticInfo &StatisticManager::GetFuncStatisticInfo() {83+FuncStatisticInfo &CommStatisticManager::GetFuncStatisticInfo() {
84 return func_statistic_info_;84 return func_statistic_info_;
85}85}
86 86 
87-void StatisticManager::Dump() const{87+void CommStatisticManager::Dump() const{
88 DumpMemoryProfilingTrack();88 DumpMemoryProfilingTrack();
89 DumpFuncProfilingTrack();89 DumpFuncProfilingTrack();
90 DumpLinkProfilingTrack();90 DumpLinkProfilingTrack();
91 DumpUnLinkProfilingTrack();91 DumpUnLinkProfilingTrack();
92}92}
93 93 
94-void StatisticManager::DumpMemoryProfilingTrack() const {94+void CommStatisticManager::DumpMemoryProfilingTrack() const {
95 LLMEVENT("Memory statistic info:alloc mem:%lu, free mem:%lu, alloc times:%lu, free times%:lu",95 LLMEVENT("Memory statistic info:alloc mem:%lu, free mem:%lu, alloc times:%lu, free times%:lu",
96 memory_statistic_info_.alloc_mem, memory_statistic_info_.free_mem, memory_statistic_info_.alloc_times,96 memory_statistic_info_.alloc_mem, memory_statistic_info_.free_mem, memory_statistic_info_.alloc_times,
97 memory_statistic_info_.free_times);97 memory_statistic_info_.free_times);
98}98}
99 99 
100-void StatisticManager::DumpFuncProfilingTrack() const {100+void CommStatisticManager::DumpFuncProfilingTrack() const {
101 const uint64_t link_func_avg_cost =101 const uint64_t link_func_avg_cost =
102 func_statistic_info_.link_func_times == 0U102 func_statistic_info_.link_func_times == 0U
103 ? 0U103 ? 0U
@@ -143,7 +143,7 @@ void StatisticManager::DumpFuncProfilingTrack() const {
143 func_statistic_info_.transfer_func_min_cost.load(), transfer_func_avg_cost);143 func_statistic_info_.transfer_func_min_cost.load(), transfer_func_avg_cost);
144}144}
145 145 
146-void StatisticManager::DumpLinkProfilingTrack() const {146+void CommStatisticManager::DumpLinkProfilingTrack() const {
147 const uint64_t comm_init_avg_cost =147 const uint64_t comm_init_avg_cost =
148 link_statistic_info_.comm_init_times == 0U148 link_statistic_info_.comm_init_times == 0U
149 ? 0U149 ? 0U
@@ -172,7 +172,7 @@ void StatisticManager::DumpLinkProfilingTrack() const {
172 );172 );
173}173}
174 174 
175-void StatisticManager::DumpUnLinkProfilingTrack() const {175+void CommStatisticManager::DumpUnLinkProfilingTrack() const {
176 const uint64_t comm_destroy_avg_cost =176 const uint64_t comm_destroy_avg_cost =
177 link_statistic_info_.comm_destroy_times == 0U177 link_statistic_info_.comm_destroy_times == 0U
178 ? 0U178 ? 0U
@@ -187,7 +187,7 @@ void StatisticManager::DumpUnLinkProfilingTrack() const {
187 );187 );
188}188}
189 189 
190-void StatisticManager::Reset() {190+void CommStatisticManager::Reset() {
191 link_statistic_info_.Reset();191 link_statistic_info_.Reset();
192 send_statistic_info_.Reset();192 send_statistic_info_.Reset();
193 recv_statistic_info_.Reset();193 recv_statistic_info_.Reset();
Rsrc/llm_datadist/statistic_manager.hsrc/llm_datadist/comm_statistic_manager.h+8-8
@@ -215,18 +215,18 @@ struct FuncStatisticInfo {
215 }215 }
216};216};
217 217 
218-class StatisticManager {218+class CommStatisticManager {
219 public:219 public:
220- static StatisticManager &GetInstance();220+ static CommStatisticManager &GetInstance();
221 static void UpdateCost(const uint64_t cost, uint64_t &total_times, uint64_t &min_cost, uint64_t &max_cost,221 static void UpdateCost(const uint64_t cost, uint64_t &total_times, uint64_t &min_cost, uint64_t &max_cost,
222 uint64_t &total_cost);222 uint64_t &total_cost);
223 static void UpdateCost(const uint64_t cost, std::atomic<uint64_t> &total_times, std::atomic<uint64_t> &min_cost,223 static void UpdateCost(const uint64_t cost, std::atomic<uint64_t> &total_times, std::atomic<uint64_t> &min_cost,
224 std::atomic<uint64_t> &max_cost, std::atomic<uint64_t> &total_cost);224 std::atomic<uint64_t> &max_cost, std::atomic<uint64_t> &total_cost);
225- ~StatisticManager() = default;225+ ~CommStatisticManager() = default;
226- StatisticManager(const StatisticManager &) = delete;226+ CommStatisticManager(const CommStatisticManager &) = delete;
227- StatisticManager(const StatisticManager &&) = delete;227+ CommStatisticManager(const CommStatisticManager &&) = delete;
228- StatisticManager &operator=(const StatisticManager &) = delete;228+ CommStatisticManager &operator=(const CommStatisticManager &) = delete;
229- StatisticManager &operator=(const StatisticManager &&) = delete;229+ CommStatisticManager &operator=(const CommStatisticManager &&) = delete;
230 void Dump() const;230 void Dump() const;
231 void Reset();231 void Reset();
232 232 
@@ -243,7 +243,7 @@ class StatisticManager {
243 FuncStatisticInfo &GetFuncStatisticInfo();243 FuncStatisticInfo &GetFuncStatisticInfo();
244 244 
245 private:245 private:
246- StatisticManager() = default;246+ CommStatisticManager() = default;
247 void DumpMemoryProfilingTrack() const;247 void DumpMemoryProfilingTrack() const;
248 void DumpFuncProfilingTrack() const;248 void DumpFuncProfilingTrack() const;
249 void DumpLinkProfilingTrack() const;249 void DumpLinkProfilingTrack() const;
@@ -1,52 +0,0 @@
1-/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- 
10- * The code snippet comes from Huawei's open-source Ascend project.
11- * Copyright 2020 Huawei Technologies Co., Ltd.
12- * Licensed under the Apache License, Version 2.0 (the "License");
13- * You may obtain a copy of the License at
14- *
15- * http://www.apache.org/licenses/LICENSE-2.0
16- */
17- 
18-#include "aligned_ptr.h"
19-#include "mem_utils.h"
20-#include "def_types.h"
21-#include "common/llm_log.h"
22- 
23-namespace llm {
24-AlignedPtr::AlignedPtr(const size_t buffer_size, const size_t alignment) {
25- size_t alloc_size = buffer_size;
26- if (alignment > 0U) {
27- alloc_size = buffer_size + alignment - 1U;
28- }
29- if ((buffer_size == 0U) || (alloc_size < buffer_size)) {
30- LLMLOGW("[Allocate][Buffer] Allocate empty buffer or overflow, size=%zu, alloc_size=%zu", buffer_size, alloc_size);
31- return;
32- }
33- 
34- base_ =
35- std::unique_ptr<uint8_t[], AlignedPtr::Deleter>(new (std::nothrow) uint8_t[alloc_size], [](const uint8_t *ptr) {
36- delete[] ptr;
37- ptr = nullptr;
38- });
39- if (base_ == nullptr) {
40- LLMLOGW("[Allocate][Buffer] Allocate buffer failed, size=%zu", alloc_size);
41- return;
42- }
43- 
44- if (alignment == 0U) {
45- aligned_addr_ = base_.get();
46- } else {
47- const size_t offset = alignment - 1U;
48- aligned_addr_ =
49- PtrToPtr<void, uint8_t>(ValueToPtr((PtrToValue(PtrToPtr<uint8_t, void>(base_.get())) + offset) & ~offset));
50- }
51-}
52-} // namespace llm
@@ -1,45 +0,0 @@
1-/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- 
10- * The code snippet comes from Huawei's open-source Ascend project.
11- * Copyright 2020 Huawei Technologies Co., Ltd.
12- * Licensed under the Apache License, Version 2.0 (the "License");
13- * You may obtain a copy of the License at
14- *
15- * http://www.apache.org/licenses/LICENSE-2.0
16- */
17- 
18-#ifndef CANN_GRAPH_ENGINE_RUNTIME_LLM_DATADIST_V2_ALIGNED_PTR_H_
19-#define CANN_GRAPH_ENGINE_RUNTIME_LLM_DATADIST_V2_ALIGNED_PTR_H_
20- 
21-#include <memory>
22-#include <functional>
23- 
24-namespace llm {
25-class AlignedPtr {
26- public:
27- using Deleter = std::function<void(uint8_t *)>;
28- using Allocator = std::function<void(std::unique_ptr<uint8_t[], Deleter> &base_addr)>;
29- explicit AlignedPtr(const size_t buffer_size, const size_t alignment = 16U);
30- AlignedPtr() = default;
31- ~AlignedPtr() = default;
32- AlignedPtr(const AlignedPtr &) = delete;
33- AlignedPtr(AlignedPtr &&) = delete;
34- AlignedPtr &operator=(const AlignedPtr &) = delete;
35- AlignedPtr &operator=(AlignedPtr &&) = delete;
36- 
37- const uint8_t *Get() const { return aligned_addr_; }
38- uint8_t *MutableGet() { return aligned_addr_; }
39- 
40- private:
41- std::unique_ptr<uint8_t[], AlignedPtr::Deleter> base_ = nullptr;
42- uint8_t *aligned_addr_ = nullptr;
43-};
44-} // namespace llm
45-#endif // CANN_GRAPH_ENGINE_RUNTIME_LLM_DATADIST_V2_ALIGNED_PTR_H_
@@ -14,7 +14,7 @@
14#include "common/def_types.h"14#include "common/def_types.h"
15#include "common/llm_checker.h"15#include "common/llm_checker.h"
16#include "cache_mgr/cache_manager.h"16#include "cache_mgr/cache_manager.h"
17-#include "statistic_manager.h"17+#include "comm_statistic_manager.h"
18#include "data_transfer/data_transfer_utils.h"18#include "data_transfer/data_transfer_utils.h"
19#include "acl/acl.h"19#include "acl/acl.h"
20#include "common/llm_scope_guard.h"20#include "common/llm_scope_guard.h"
@@ -105,7 +105,7 @@ ge::Status D2DDataTransferJob::Process(bool &is_done) {
105 const auto cost = static_cast<uint64_t>(105 const auto cost = static_cast<uint64_t>(
106 std::chrono::duration_cast<std::chrono::microseconds>(finished_time_point - timeout_point_).count());106 std::chrono::duration_cast<std::chrono::microseconds>(finished_time_point - timeout_point_).count());
107 auto &send_statistic_info = comm_entity_->GetSendStatisticInfo();107 auto &send_statistic_info = comm_entity_->GetSendStatisticInfo();
108- StatisticManager::GetInstance().UpdateCost(cost, send_statistic_info.send_times, send_statistic_info.send_min_cost,108+ CommStatisticManager::GetInstance().UpdateCost(cost, send_statistic_info.send_times, send_statistic_info.send_min_cost,
109 send_statistic_info.send_max_cost, send_statistic_info.send_total_cost);109 send_statistic_info.send_max_cost, send_statistic_info.send_total_cost);
110 LLMLOGI("comm_entity:%s send all task of request finished", comm_entity_->GetDesc().c_str());110 LLMLOGI("comm_entity:%s send all task of request finished", comm_entity_->GetDesc().c_str());
111 return ge::SUCCESS;111 return ge::SUCCESS;
@@ -175,7 +175,7 @@ ge::Status LayerWiseTransferJob::SynchronizeTransferCacheWithRecord(const int32_
175 const auto cost =175 const auto cost =
176 static_cast<uint64_t>(std::chrono::duration_cast<std::chrono::microseconds>(finished - start).count());176 static_cast<uint64_t>(std::chrono::duration_cast<std::chrono::microseconds>(finished - start).count());
177 auto &send_statistic_info = comm_entity_->GetSendStatisticInfo(stream_);177 auto &send_statistic_info = comm_entity_->GetSendStatisticInfo(stream_);
178- StatisticManager::GetInstance().UpdateCost(cost, send_statistic_info.send_times, send_statistic_info.send_min_cost,178+ CommStatisticManager::GetInstance().UpdateCost(cost, send_statistic_info.send_times, send_statistic_info.send_min_cost,
179 send_statistic_info.send_max_cost, send_statistic_info.send_total_cost);179 send_statistic_info.send_max_cost, send_statistic_info.send_total_cost);
180 LLMLOGI("comm_entity:%s send all task of request finished", comm_entity_->GetDesc().c_str());180 LLMLOGI("comm_entity:%s send all task of request finished", comm_entity_->GetDesc().c_str());
181 return ge::SUCCESS;181 return ge::SUCCESS;
@@ -12,7 +12,7 @@
12#include <map>12#include <map>
13#include "mmpa/mmpa_api.h"13#include "mmpa/mmpa_api.h"
14#include "common/common.h"14#include "common/common.h"
15-#include "statistic_manager.h"15+#include "comm_statistic_manager.h"
16#include "common/llm_checker.h"16#include "common/llm_checker.h"
17#include "common/llm_scope_guard.h"17#include "common/llm_scope_guard.h"
18 18 
@@ -127,7 +127,7 @@ HcclResult HcclAdapter::HcclExchangeMemDesc(HcclComm comm, uint32_t remote_rank,
127 const auto start = std::chrono::steady_clock::now();127 const auto start = std::chrono::steady_clock::now();
128 auto ret = hccl_exchange_mem_desc_func_(comm, remote_rank, local, timeout, remote, actual_num);128 auto ret = hccl_exchange_mem_desc_func_(comm, remote_rank, local, timeout, remote, actual_num);
129 const auto end = std::chrono::steady_clock::now();129 const auto end = std::chrono::steady_clock::now();
130- StatisticManager::GetInstance().AddExchangeMemCost(130+ CommStatisticManager::GetInstance().AddExchangeMemCost(
131 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());131 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
132 return ret;132 return ret;
133}133}
@@ -137,7 +137,7 @@ HcclResult HcclAdapter::HcclCommInitClusterInfoMemConfig(const char *cluster, ui
137 const auto start = std::chrono::steady_clock::now();137 const auto start = std::chrono::steady_clock::now();
138 auto ret = hccl_comm_init_cluster_info_mem_func_(cluster, rank, config, comm);138 auto ret = hccl_comm_init_cluster_info_mem_func_(cluster, rank, config, comm);
139 const auto end = std::chrono::steady_clock::now();139 const auto end = std::chrono::steady_clock::now();
140- StatisticManager::GetInstance().AddCommInitCost(140+ CommStatisticManager::GetInstance().AddCommInitCost(
141 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());141 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
142 return ret;142 return ret;
143}143}
@@ -176,7 +176,7 @@ HcclResult HcclAdapter::HcclCommDestroy(HcclComm comm) {
176 const auto start = std::chrono::steady_clock::now();176 const auto start = std::chrono::steady_clock::now();
177 auto ret = hccl_comm_destroy_func_(comm);177 auto ret = hccl_comm_destroy_func_(comm);
178 const auto end = std::chrono::steady_clock::now();178 const auto end = std::chrono::steady_clock::now();
179- StatisticManager::GetInstance().AddCommDestroyCost(179+ CommStatisticManager::GetInstance().AddCommDestroyCost(
180 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());180 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
181 return ret;181 return ret;
182}182}
@@ -186,7 +186,7 @@ HcclResult HcclAdapter::HcclBatchPut(HcclComm comm, uint32_t remote_rank, HcclOn
186 const auto start = std::chrono::steady_clock::now();186 const auto start = std::chrono::steady_clock::now();
187 auto ret = hccl_batch_put_func_(comm, remote_rank, desc, desc_num, stream);187 auto ret = hccl_batch_put_func_(comm, remote_rank, desc, desc_num, stream);
188 const auto end = std::chrono::steady_clock::now();188 const auto end = std::chrono::steady_clock::now();
189- StatisticManager::GetInstance().AddBatchPutCost(189+ CommStatisticManager::GetInstance().AddBatchPutCost(
190 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());190 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
191 return ret;191 return ret;
192}192}
@@ -212,7 +212,7 @@ HcclResult HcclAdapter::HcclRegisterGlobalMem(HcclMem *mem, void **mem_handle) c
212 auto ret = HCCL_E_NOT_SUPPORT;212 auto ret = HCCL_E_NOT_SUPPORT;
213 if (hccl_register_global_mem_func_ != nullptr) {213 if (hccl_register_global_mem_func_ != nullptr) {
214 ret = hccl_register_global_mem_func_(mem, mem_handle);214 ret = hccl_register_global_mem_func_(mem, mem_handle);
215- StatisticManager::GetInstance().AddRegisterGlobalMemTimes();215+ CommStatisticManager::GetInstance().AddRegisterGlobalMemTimes();
216 }216 }
217 return ret;217 return ret;
218}218}
@@ -221,7 +221,7 @@ HcclResult HcclAdapter::HcclDeregisterGlobalMem(void *mem_handle) const {
221 auto ret = HCCL_E_NOT_SUPPORT;221 auto ret = HCCL_E_NOT_SUPPORT;
222 if (hccl_deregister_global_mem_func_ != nullptr) {222 if (hccl_deregister_global_mem_func_ != nullptr) {
223 ret = hccl_deregister_global_mem_func_(mem_handle);223 ret = hccl_deregister_global_mem_func_(mem_handle);
224- StatisticManager::GetInstance().AddDeregisterGlobalMemTimes();224+ CommStatisticManager::GetInstance().AddDeregisterGlobalMemTimes();
225 }225 }
226 return ret;226 return ret;
227}227}
@@ -230,7 +230,7 @@ HcclResult HcclAdapter::HcclCommBindMem(HcclComm comm, void *mem_handle) const {
230 auto ret = HCCL_E_NOT_SUPPORT;230 auto ret = HCCL_E_NOT_SUPPORT;
231 if (hccl_comm_bind_mem_func_ != nullptr) {231 if (hccl_comm_bind_mem_func_ != nullptr) {
232 ret = hccl_comm_bind_mem_func_(comm, mem_handle);232 ret = hccl_comm_bind_mem_func_(comm, mem_handle);
233- StatisticManager::GetInstance().AddCommBindMemTimes();233+ CommStatisticManager::GetInstance().AddCommBindMemTimes();
234 }234 }
235 return ret;235 return ret;
236}236}
@@ -239,7 +239,7 @@ HcclResult HcclAdapter::HcclCommUnbindMem(HcclComm comm, void *mem_handle) const
239 auto ret = HCCL_E_NOT_SUPPORT;239 auto ret = HCCL_E_NOT_SUPPORT;
240 if (hccl_comm_unbind_mem_func_ != nullptr) {240 if (hccl_comm_unbind_mem_func_ != nullptr) {
241 ret = hccl_comm_unbind_mem_func_(comm, mem_handle);241 ret = hccl_comm_unbind_mem_func_(comm, mem_handle);
242- StatisticManager::GetInstance().AddCommUnbindMemTimes();242+ CommStatisticManager::GetInstance().AddCommUnbindMemTimes();
243 }243 }
244 return ret;244 return ret;
245}245}
@@ -250,7 +250,7 @@ HcclResult HcclAdapter::HcclCommPrepare(HcclComm comm, HcclPrepareConfig *prepar
250 const auto start = std::chrono::steady_clock::now();250 const auto start = std::chrono::steady_clock::now();
251 ret = hccl_comm_prepare_func_(comm, prepare_config, timeout);251 ret = hccl_comm_prepare_func_(comm, prepare_config, timeout);
252 const auto end = std::chrono::steady_clock::now();252 const auto end = std::chrono::steady_clock::now();
253- StatisticManager::GetInstance().AddCommPrepareCost(253+ CommStatisticManager::GetInstance().AddCommPrepareCost(
254 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());254 std::chrono::duration_cast<std::chrono::microseconds>(end - start).count());
255 }255 }
256 return ret;256 return ret;
@@ -11,7 +11,7 @@
11#include "llm_datadist_v2.h"11#include "llm_datadist_v2.h"
12#include "common/llm_utils.h"12#include "common/llm_utils.h"
13#include "llm_datadist_timer.h"13#include "llm_datadist_timer.h"
14-#include "statistic_manager.h"14+#include "comm_statistic_manager.h"
15#include "common/llm_checker.h"15#include "common/llm_checker.h"
16#include "common/mem_utils.h"16#include "common/mem_utils.h"
17#include "common/llm_scope_guard.h"17#include "common/llm_scope_guard.h"
@@ -48,7 +48,7 @@ ge::Status LLMDataDistV2::DoInnerInitialize(int32_t device_id,
48 48 
49 LlmDatadistTimer::Instance().Init();49 LlmDatadistTimer::Instance().Init();
50 statistic_timer_handle_ = LlmDatadistTimer::Instance().CreateTimer([this]() {50 statistic_timer_handle_ = LlmDatadistTimer::Instance().CreateTimer([this]() {
51- StatisticManager::GetInstance().Dump();51+ CommStatisticManager::GetInstance().Dump();
52 comm_entity_manager_->Dump();52 comm_entity_manager_->Dump();
53 });53 });
54 constexpr uint32_t kStatisticTimerPeriod = 80U * 1000U;54 constexpr uint32_t kStatisticTimerPeriod = 80U * 1000U;
@@ -111,8 +111,8 @@ void LLMDataDistV2::DoInnerFinalize() {
111 GlobalMemManager::GetInstance().Finalize();111 GlobalMemManager::GetInstance().Finalize();
112 transfer_engine_->Finalize();112 transfer_engine_->Finalize();
113 113 
114- StatisticManager::GetInstance().Dump();114+ CommStatisticManager::GetInstance().Dump();
115- StatisticManager::GetInstance().Reset();115+ CommStatisticManager::GetInstance().Reset();
116 if (statistic_timer_handle_ != nullptr) {116 if (statistic_timer_handle_ != nullptr) {
117 (void)LlmDatadistTimer::Instance().StopTimer(statistic_timer_handle_);117 (void)LlmDatadistTimer::Instance().StopTimer(statistic_timer_handle_);
118 (void)LlmDatadistTimer::Instance().DeleteTimer(statistic_timer_handle_);118 (void)LlmDatadistTimer::Instance().DeleteTimer(statistic_timer_handle_);
@@ -162,9 +162,9 @@ ge::Status LLMDataDistV2::Link(std::string &cluster_name,
162 hixl::TemporaryRtContext with_context(aclrt_context_);162 hixl::TemporaryRtContext with_context(aclrt_context_);
163 LLM_CHK_STATUS_RET(transfer_engine_->Link(cluster_name, cluster2rank, rank_table, comm_id), "Link failed.");163 LLM_CHK_STATUS_RET(transfer_engine_->Link(cluster_name, cluster2rank, rank_table, comm_id), "Link failed.");
164 const auto end = std::chrono::steady_clock::now();164 const auto end = std::chrono::steady_clock::now();
165- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();165+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
166 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();166 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
167- StatisticManager::UpdateCost(cost, func_statistic_info.link_func_times, func_statistic_info.link_func_min_cost,167+ CommStatisticManager::UpdateCost(cost, func_statistic_info.link_func_times, func_statistic_info.link_func_min_cost,
168 func_statistic_info.link_func_max_cost, func_statistic_info.link_func_total_cost);168 func_statistic_info.link_func_max_cost, func_statistic_info.link_func_total_cost);
169 return ge::SUCCESS;169 return ge::SUCCESS;
170}170}
@@ -176,9 +176,9 @@ ge::Status LLMDataDistV2::Unlink(uint64_t comm_id) {
176 hixl::TemporaryRtContext with_context(aclrt_context_);176 hixl::TemporaryRtContext with_context(aclrt_context_);
177 LLM_CHK_STATUS_RET(transfer_engine_->Unlink(comm_id), "Unlink failed.");177 LLM_CHK_STATUS_RET(transfer_engine_->Unlink(comm_id), "Unlink failed.");
178 const auto end = std::chrono::steady_clock::now();178 const auto end = std::chrono::steady_clock::now();
179- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();179+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
180 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();180 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
181- StatisticManager::UpdateCost(cost, func_statistic_info.unlink_func_times, func_statistic_info.unlink_func_min_cost,181+ CommStatisticManager::UpdateCost(cost, func_statistic_info.unlink_func_times, func_statistic_info.unlink_func_min_cost,
182 func_statistic_info.unlink_func_max_cost, func_statistic_info.unlink_func_total_cost);182 func_statistic_info.unlink_func_max_cost, func_statistic_info.unlink_func_total_cost);
183 return ge::SUCCESS;183 return ge::SUCCESS;
184}184}
@@ -196,7 +196,7 @@ ge::Status LLMDataDistV2::RegisterCache(const CacheDesc &cache_desc, Cache &cach
196 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,196 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,
197 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);197 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);
198 hixl::TemporaryRtContext with_context(aclrt_context_);198 hixl::TemporaryRtContext with_context(aclrt_context_);
199- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();199+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
200 func_statistic_info.register_func_times++;200 func_statistic_info.register_func_times++;
201 return data_cache_engine_->Register(cache_desc, cache_keys, cache);201 return data_cache_engine_->Register(cache_desc, cache_keys, cache);
202}202}
@@ -206,7 +206,7 @@ ge::Status LLMDataDistV2::AllocateCache(const CacheDesc &cache_desc, Cache &cach
206 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,206 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,
207 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);207 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);
208 hixl::TemporaryRtContext with_context(aclrt_context_);208 hixl::TemporaryRtContext with_context(aclrt_context_);
209- auto &mem_statistic_info = StatisticManager::GetInstance().GetMemoryStatisticInfo();209+ auto &mem_statistic_info = CommStatisticManager::GetInstance().GetMemoryStatisticInfo();
210 mem_statistic_info.alloc_times++;210 mem_statistic_info.alloc_times++;
211 return data_cache_engine_->Allocate(cache_desc, cache_keys, cache);211 return data_cache_engine_->Allocate(cache_desc, cache_keys, cache);
212}212}
@@ -215,7 +215,7 @@ ge::Status LLMDataDistV2::DeallocateCache(int64_t cache_id) {
215 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,215 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,
216 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);216 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);
217 hixl::TemporaryRtContext with_context(aclrt_context_);217 hixl::TemporaryRtContext with_context(aclrt_context_);
218- auto &mem_statistic_info = StatisticManager::GetInstance().GetMemoryStatisticInfo();218+ auto &mem_statistic_info = CommStatisticManager::GetInstance().GetMemoryStatisticInfo();
219 mem_statistic_info.free_times++;219 mem_statistic_info.free_times++;
220 return data_cache_engine_->Deallocate(cache_id);220 return data_cache_engine_->Deallocate(cache_id);
221}221}
@@ -232,9 +232,9 @@ ge::Status LLMDataDistV2::PullCache(int64_t cache_id, const CacheKey &cache_key,
232 "data can not be pulled from own cluster:%lu", cluster_id_);232 "data can not be pulled from own cluster:%lu", cluster_id_);
233 LLM_CHK_STATUS_RET(data_cache_engine_->PullCache(cache_id, cache_key, pull_cache_param), "pull cache failed");233 LLM_CHK_STATUS_RET(data_cache_engine_->PullCache(cache_id, cache_key, pull_cache_param), "pull cache failed");
234 const auto end = std::chrono::steady_clock::now();234 const auto end = std::chrono::steady_clock::now();
235- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();235+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
236 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();236 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
237- StatisticManager::UpdateCost(cost, func_statistic_info.pull_func_times, func_statistic_info.pull_func_min_cost,237+ CommStatisticManager::UpdateCost(cost, func_statistic_info.pull_func_times, func_statistic_info.pull_func_min_cost,
238 func_statistic_info.pull_func_max_cost, func_statistic_info.pull_func_total_cost);238 func_statistic_info.pull_func_max_cost, func_statistic_info.pull_func_total_cost);
239 return ge::SUCCESS;239 return ge::SUCCESS;
240}240}
@@ -262,9 +262,9 @@ ge::Status LLMDataDistV2::CopyCache(const CopyCacheParam &copy_cache_param) {
262 hixl::TemporaryRtContext with_context(aclrt_context_);262 hixl::TemporaryRtContext with_context(aclrt_context_);
263 LLM_CHK_STATUS_RET(data_cache_engine_->CopyCache(copy_cache_param), "copy cache failed");263 LLM_CHK_STATUS_RET(data_cache_engine_->CopyCache(copy_cache_param), "copy cache failed");
264 const auto end = std::chrono::steady_clock::now();264 const auto end = std::chrono::steady_clock::now();
265- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();265+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
266 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();266 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
267- StatisticManager::UpdateCost(cost, func_statistic_info.copy_func_times, func_statistic_info.copy_func_min_cost,267+ CommStatisticManager::UpdateCost(cost, func_statistic_info.copy_func_times, func_statistic_info.copy_func_min_cost,
268 func_statistic_info.copy_func_max_cost, func_statistic_info.copy_func_total_cost);268 func_statistic_info.copy_func_max_cost, func_statistic_info.copy_func_total_cost);
269 return ge::SUCCESS;269 return ge::SUCCESS;
270}270}
@@ -292,9 +292,9 @@ ge::Status LLMDataDistV2::SwapBlocks(const Cache &src, const Cache &dst, const u
292 hixl::TemporaryRtContext with_context(aclrt_context_);292 hixl::TemporaryRtContext with_context(aclrt_context_);
293 LLM_CHK_STATUS_RET(data_cache_engine_->SwapBlocks(src, dst, block_size, type, block_mapping), "swap blocks failed");293 LLM_CHK_STATUS_RET(data_cache_engine_->SwapBlocks(src, dst, block_size, type, block_mapping), "swap blocks failed");
294 const auto end = std::chrono::steady_clock::now();294 const auto end = std::chrono::steady_clock::now();
295- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();295+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
296 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();296 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
297- StatisticManager::UpdateCost(cost, func_statistic_info.swap_func_times, func_statistic_info.swap_func_min_cost,297+ CommStatisticManager::UpdateCost(cost, func_statistic_info.swap_func_times, func_statistic_info.swap_func_min_cost,
298 func_statistic_info.swap_func_max_cost, func_statistic_info.swap_func_total_cost);298 func_statistic_info.swap_func_max_cost, func_statistic_info.swap_func_total_cost);
299 return ge::SUCCESS;299 return ge::SUCCESS;
300}300}
@@ -320,9 +320,9 @@ ge::Status LLMDataDistV2::TransferCache(const uint64_t task_id, const TransferCa
320 "task:%lu of cluster:%lu transfer cache of layer[%lu] failed", task_id,320 "task:%lu of cluster:%lu transfer cache of layer[%lu] failed", task_id,
321 transfer_cache_config.cluster_id, transfer_cache_config.layer_index);321 transfer_cache_config.cluster_id, transfer_cache_config.layer_index);
322 const auto end = std::chrono::steady_clock::now();322 const auto end = std::chrono::steady_clock::now();
323- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();323+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
324 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();324 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
325- StatisticManager::UpdateCost(cost, func_statistic_info.transfer_func_times,325+ CommStatisticManager::UpdateCost(cost, func_statistic_info.transfer_func_times,
326 func_statistic_info.transfer_func_min_cost, func_statistic_info.transfer_func_max_cost,326 func_statistic_info.transfer_func_min_cost, func_statistic_info.transfer_func_max_cost,
327 func_statistic_info.transfer_func_total_cost);327 func_statistic_info.transfer_func_total_cost);
328 LLMLOGI("task:%lu of cluster:%lu transfer cache of layer[%lu] success", task_id, transfer_cache_config.cluster_id,328 LLMLOGI("task:%lu of cluster:%lu transfer cache of layer[%lu] success", task_id, transfer_cache_config.cluster_id,
@@ -334,7 +334,7 @@ ge::Status LLMDataDistV2::UnregisterCache(int64_t cache_id) {
334 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,334 LLM_CHK_BOOL_RET_STATUS(is_initialized_.load(std::memory_order::memory_order_relaxed), ge::FAILED,
335 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);335 "Llm datadist of cluster:%lu is not initialized.", cluster_id_);
336 hixl::TemporaryRtContext with_context(aclrt_context_);336 hixl::TemporaryRtContext with_context(aclrt_context_);
337- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();337+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
338 func_statistic_info.deregister_func_times++;338 func_statistic_info.deregister_func_times++;
339 return data_cache_engine_->Unregister(cache_id);339 return data_cache_engine_->Unregister(cache_id);
340}340}
@@ -348,9 +348,9 @@ ge::Status LLMDataDistV2::LinkClusters(const std::vector<ClusterInfo> &clusters,
348 hixl::TemporaryRtContext with_context(aclrt_context_);348 hixl::TemporaryRtContext with_context(aclrt_context_);
349 LLM_CHK_STATUS_RET(transfer_engine_->LinkClusters(clusters, rets, timeout), "Failed to link clusters.");349 LLM_CHK_STATUS_RET(transfer_engine_->LinkClusters(clusters, rets, timeout), "Failed to link clusters.");
350 const auto end = std::chrono::steady_clock::now();350 const auto end = std::chrono::steady_clock::now();
351- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();351+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
352 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();352 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
353- StatisticManager::UpdateCost(cost, func_statistic_info.link_func_times, func_statistic_info.link_func_min_cost,353+ CommStatisticManager::UpdateCost(cost, func_statistic_info.link_func_times, func_statistic_info.link_func_min_cost,
354 func_statistic_info.link_func_max_cost, func_statistic_info.link_func_total_cost);354 func_statistic_info.link_func_max_cost, func_statistic_info.link_func_total_cost);
355 return ge::SUCCESS;355 return ge::SUCCESS;
356}356}
@@ -365,9 +365,9 @@ ge::Status LLMDataDistV2::UnlinkClusters(const std::vector<ClusterInfo> &cluster
365 hixl::TemporaryRtContext with_context(aclrt_context_);365 hixl::TemporaryRtContext with_context(aclrt_context_);
366 LLM_CHK_STATUS_RET(transfer_engine_->UnlinkClusters(clusters, rets, timeout, force_flag), "Failed to unlink clusters.");366 LLM_CHK_STATUS_RET(transfer_engine_->UnlinkClusters(clusters, rets, timeout, force_flag), "Failed to unlink clusters.");
367 const auto end = std::chrono::steady_clock::now();367 const auto end = std::chrono::steady_clock::now();
368- auto &func_statistic_info = StatisticManager::GetInstance().GetFuncStatisticInfo();368+ auto &func_statistic_info = CommStatisticManager::GetInstance().GetFuncStatisticInfo();
369 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();369 const uint64_t cost = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
370- StatisticManager::UpdateCost(cost, func_statistic_info.unlink_func_times, func_statistic_info.unlink_func_min_cost,370+ CommStatisticManager::UpdateCost(cost, func_statistic_info.unlink_func_times, func_statistic_info.unlink_func_min_cost,
371 func_statistic_info.unlink_func_max_cost, func_statistic_info.unlink_func_total_cost);371 func_statistic_info.unlink_func_max_cost, func_statistic_info.unlink_func_total_cost);
372 return ge::SUCCESS;372 return ge::SUCCESS;
373}373}
@@ -46,7 +46,7 @@ file(GLOB HIXL_SRC_LIST
46 46 
47file(GLOB ADXL_SRC_LIST47file(GLOB ADXL_SRC_LIST
48 "${HIXL_CODE_DIR}/src/llm_datadist/api/adxl_engine_impl.cc"48 "${HIXL_CODE_DIR}/src/llm_datadist/api/adxl_engine_impl.cc"
49- "${HIXL_CODE_DIR}/src/llm_datadist/statistic_manager.cc"49+ "${HIXL_CODE_DIR}/src/llm_datadist/comm_statistic_manager.cc"
50 "${HIXL_CODE_DIR}/src/llm_datadist/llm_datadist_timer.cc"50 "${HIXL_CODE_DIR}/src/llm_datadist/llm_datadist_timer.cc"
51 "${HIXL_CODE_DIR}/src/llm_datadist/adxl/*.cc"51 "${HIXL_CODE_DIR}/src/llm_datadist/adxl/*.cc"
52 "${HIXL_CODE_DIR}/src/llm_datadist/common/*.cc"52 "${HIXL_CODE_DIR}/src/llm_datadist/common/*.cc"
@@ -21,7 +21,6 @@ set(LLM_DATADIST_TEST_FILES
21 llm_datadist_v2_api_unittest.cc21 llm_datadist_v2_api_unittest.cc
22 llm_utils_v2_unittest.cc22 llm_utils_v2_unittest.cc
23 data_cache_engine_unittest.cc23 data_cache_engine_unittest.cc
24- aligned_ptr_unittest.cc
25 hixl_api_unittest.cc24 hixl_api_unittest.cc
26 adxl_engine_api_unittest.cc25 adxl_engine_api_unittest.cc
27 segment_table_unittest.cc26 segment_table_unittest.cc
@@ -24,7 +24,7 @@
24#include "engine/engine_factory.h"24#include "engine/engine_factory.h"
25#include "engine/fabric_mem_engine.h"25#include "engine/fabric_mem_engine.h"
26#include "engine/hixl_engine.h"26#include "engine/hixl_engine.h"
27-#include "engine/adxl_engine.h"27+#include "engine/comm_engine.h"
28#include "dlog_pub.h"28#include "dlog_pub.h"
29#include "depends/mmpa/src/mmpa_stub.h"29#include "depends/mmpa/src/mmpa_stub.h"
30#include "depends/llm_datadist/src/data_cache_engine_test_helper.h"30#include "depends/llm_datadist/src/data_cache_engine_test_helper.h"
@@ -151,7 +151,7 @@ TEST_F(AdxlEngineUTest, TestEngineFactoryFallbackToAdxlEngineWithoutLocalCommRes
151 151 
152 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", options);152 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", options);
153 ASSERT_NE(engine, nullptr);153 ASSERT_NE(engine, nullptr);
154- EXPECT_NE(dynamic_cast<hixl::AdxlEngine *>(engine.get()), nullptr);154+ EXPECT_NE(dynamic_cast<hixl::CommEngine *>(engine.get()), nullptr);
155 EXPECT_EQ(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);155 EXPECT_EQ(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);
156}156}
157 157 
@@ -159,7 +159,7 @@ TEST_F(AdxlEngineUTest, TestEngineFactoryUseHixlEngineWithLocalCommRes) {
159 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", BuildHixlCsOptions("127.0.0.1"));159 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", BuildHixlCsOptions("127.0.0.1"));
160 ASSERT_NE(engine, nullptr);160 ASSERT_NE(engine, nullptr);
161 EXPECT_NE(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);161 EXPECT_NE(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);
162- EXPECT_EQ(dynamic_cast<hixl::AdxlEngine *>(engine.get()), nullptr);162+ EXPECT_EQ(dynamic_cast<hixl::CommEngine *>(engine.get()), nullptr);
163}163}
164 164 
165TEST_F(AdxlEngineUTest, TestEngineFactoryUseHixlEngineWhenUboeNotFirstInProtocolDesc) {165TEST_F(AdxlEngineUTest, TestEngineFactoryUseHixlEngineWhenUboeNotFirstInProtocolDesc) {
@@ -173,7 +173,7 @@ TEST_F(AdxlEngineUTest, TestEngineFactoryUseHixlEngineWhenUboeNotFirstInProtocol
173 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", options);173 auto engine = hixl::EngineFactory::CreateEngine("127.0.0.1", options);
174 ASSERT_NE(engine, nullptr);174 ASSERT_NE(engine, nullptr);
175 EXPECT_NE(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);175 EXPECT_NE(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);
176- EXPECT_EQ(dynamic_cast<hixl::AdxlEngine *>(engine.get()), nullptr);176+ EXPECT_EQ(dynamic_cast<hixl::CommEngine *>(engine.get()), nullptr);
177}177}
178 178 
179TEST_F(AdxlEngineUTest, TestEngineFactoryUseFabricMemEngineWhenFabricMemEnabled) {179TEST_F(AdxlEngineUTest, TestEngineFactoryUseFabricMemEngineWhenFabricMemEnabled) {
@@ -183,7 +183,7 @@ TEST_F(AdxlEngineUTest, TestEngineFactoryUseFabricMemEngineWhenFabricMemEnabled)
183 ASSERT_NE(engine, nullptr);183 ASSERT_NE(engine, nullptr);
184 EXPECT_NE(dynamic_cast<hixl::FabricMemEngine *>(engine.get()), nullptr);184 EXPECT_NE(dynamic_cast<hixl::FabricMemEngine *>(engine.get()), nullptr);
185 EXPECT_EQ(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);185 EXPECT_EQ(dynamic_cast<hixl::HixlEngine *>(engine.get()), nullptr);
186- EXPECT_EQ(dynamic_cast<hixl::AdxlEngine *>(engine.get()), nullptr);186+ EXPECT_EQ(dynamic_cast<hixl::CommEngine *>(engine.get()), nullptr);
187}187}
188 188 
189TEST_F(AdxlEngineUTest, TestAdxlEngine) {189TEST_F(AdxlEngineUTest, TestAdxlEngine) {
@@ -378,7 +378,7 @@ TEST_F(AdxlEngineUTest, TestDeregisterUnregisterMem) {
378 378 
379TEST_F(AdxlEngineUTest, TestHeartbeat) {379TEST_F(AdxlEngineUTest, TestHeartbeat) {
380 ChannelManager::SetHeartbeatWaitTime(10); // 10ms380 ChannelManager::SetHeartbeatWaitTime(10); // 10ms
381- Channel::SetHeartbeatTimeout(50); // 50ms381+ CommChannel::SetHeartbeatTimeout(50); // 50ms
382 AdxlEngine engine1;382 AdxlEngine engine1;
383 llm::AutoCommResRuntimeMock::SetDevice(0);383 llm::AutoCommResRuntimeMock::SetDevice(0);
384 std::map<AscendString, AscendString> options1;384 std::map<AscendString, AscendString> options1;
@@ -1,58 +0,0 @@
1-/**
2- * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3- * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4- * CANN Open Software License Agreement Version 2.0 (the "License").
5- * Please refer to the License for details. You may not use this file except in compliance with the License.
6- * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7- * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8- * See LICENSE in the root of the software repository for the full text of the License.
9- */
10- 
11- 
12-#include <gtest/gtest.h>
13-#include "common/aligned_ptr.h"
14- 
15-using namespace std;
16-using namespace ::testing;
17- 
18-namespace llm {
19-class AlignedPtrTest : public ::testing::Test {
20- protected:
21- void SetUp() override {}
22- // 在测试类中进行清理工作,如果需要的话
23- void TearDown() override {}
24-};
25- 
26-TEST_F(AlignedPtrTest, NormalAlignment) {
27- const size_t buffer_size = 1024;
28- const size_t alignment = 64;
29- AlignedPtr ptr(buffer_size, alignment);
30- EXPECT_NE(ptr.Get(), nullptr);
31- EXPECT_EQ(reinterpret_cast<uintptr_t>(ptr.Get()) % alignment, 0);
32-}
33- 
34-TEST_F(AlignedPtrTest, ZeroBufferSize) {
35- AlignedPtr ptr(0, 16);
36- EXPECT_EQ(ptr.Get(), nullptr);
37-}
38- 
39-TEST_F(AlignedPtrTest, ZeroAlignmentWithNonZeroSize) {
40- const size_t buffer_size = 1024;
41- AlignedPtr ptr(buffer_size, 0);
42- EXPECT_NE(ptr.Get(), nullptr);
43-}
44- 
45-TEST_F(AlignedPtrTest, AllocationFailure) {
46- const size_t huge_size = std::numeric_limits<size_t>::max();
47- AlignedPtr ptr(huge_size, 16);
48- EXPECT_EQ(ptr.Get(), nullptr);
49-}
50- 
51-TEST_F(AlignedPtrTest, AlignmentLargerThanSize) {
52- const size_t buffer_size = 16;
53- const size_t alignment = 64;
54- AlignedPtr ptr(buffer_size, alignment);
55- EXPECT_NE(ptr.Get(), nullptr);
56- EXPECT_EQ(reinterpret_cast<uintptr_t>(ptr.Get()) % alignment, 0);
57-}
58-} // namespace llm
@@ -17,7 +17,7 @@
17#include "adxl/buffer_transfer_service.h"17#include "adxl/buffer_transfer_service.h"
18#undef private18#undef private
19 19 
20-#include "adxl/channel.h"20+#include "adxl/comm_channel.h"
21#include "depends/ascendcl/src/ascendcl_stub.h"21#include "depends/ascendcl/src/ascendcl_stub.h"
22 22 
23namespace adxl {23namespace adxl {
@@ -46,7 +46,7 @@ ChannelPtr CreateChannel() {
46 channel_info.channel_id = kChannelId;46 channel_info.channel_id = kChannelId;
47 channel_info.local_rank_id = 0;47 channel_info.local_rank_id = 0;
48 channel_info.peer_rank_id = kPeerRankId;48 channel_info.peer_rank_id = kPeerRankId;
49- return std::make_shared<Channel>(channel_info);49+ return std::make_shared<CommChannel>(channel_info);
50}50}
51} // namespace51} // namespace
52 52 
@@ -28,7 +28,7 @@ class ChannelManagerUnitTest : public ::testing::Test {
28 ChannelInfo channel_info{};28 ChannelInfo channel_info{};
29 channel_info.channel_type = ChannelType::kServer;29 channel_info.channel_type = ChannelType::kServer;
30 channel_info.channel_id = kChannelId;30 channel_info.channel_id = kChannelId;
31- auto channel = std::make_shared<Channel>(channel_info);31+ auto channel = std::make_shared<CommChannel>(channel_info);
32 ProtocolHeader header{magic, body_size};32 ProtocolHeader header{magic, body_size};
33 channel->recv_buffer_.resize(sizeof(header));33 channel->recv_buffer_.resize(sizeof(header));
34 memcpy_s(channel->recv_buffer_.data(), sizeof(header), &header, sizeof(header));34 memcpy_s(channel->recv_buffer_.data(), sizeof(header), &header, sizeof(header));
@@ -79,7 +79,7 @@ TEST_F(ChannelManagerUnitTest, HandleNotifyMessage_WhenStorageLimitExceeded_Retu
79 ChannelInfo channel_info{};79 ChannelInfo channel_info{};
80 channel_info.channel_type = ChannelType::kServer;80 channel_info.channel_type = ChannelType::kServer;
81 channel_info.channel_id = kChannelId;81 channel_info.channel_id = kChannelId;
82- auto channel = std::make_shared<Channel>(channel_info);82+ auto channel = std::make_shared<CommChannel>(channel_info);
83 83 
84 // Fill notify messages to reach limit84 // Fill notify messages to reach limit
85 for (size_t i = 0; i < kMaxNotifyStorageSize; ++i) {85 for (size_t i = 0; i < kMaxNotifyStorageSize; ++i) {
@@ -117,7 +117,7 @@ TEST_F(ChannelManagerUnitTest, HandleRequestDisconnectMessage_WhenDisconnectCall
117 ChannelInfo channel_info{};117 ChannelInfo channel_info{};
118 channel_info.channel_type = ChannelType::kServer;118 channel_info.channel_type = ChannelType::kServer;
119 channel_info.channel_id = kChannelId;119 channel_info.channel_id = kChannelId;
120- auto channel = std::make_shared<Channel>(channel_info);120+ auto channel = std::make_shared<CommChannel>(channel_info);
121 121 
122 // Verify transfer count is 0122 // Verify transfer count is 0
123 EXPECT_EQ(channel->GetTransferCount(), 0);123 EXPECT_EQ(channel->GetTransferCount(), 0);
@@ -156,7 +156,7 @@ TEST_F(ChannelMsgHandlerUnitTest, ProcessServerEviction_WhenClientReturnsError_L
156 ChannelInfo channel_info{};156 ChannelInfo channel_info{};
157 channel_info.channel_type = ChannelType::kServer;157 channel_info.channel_type = ChannelType::kServer;
158 channel_info.channel_id = kRemoteEngine;158 channel_info.channel_id = kRemoteEngine;
159- auto channel = std::make_shared<Channel>(channel_info);159+ auto channel = std::make_shared<CommChannel>(channel_info);
160 160 
161 // Create a socket pair for communication161 // Create a socket pair for communication
162 int socket_pair[2];162 int socket_pair[2];
@@ -13,7 +13,7 @@
13#include <chrono>13#include <chrono>
14#include <vector>14#include <vector>
15#include <atomic>15#include <atomic>
16-#include "adxl/channel.h"16+#include "adxl/comm_channel.h"
17#include "hixl/hixl.h"17#include "hixl/hixl.h"
18#include "adxl/channel_manager.h"18#include "adxl/channel_manager.h"
19#include "adxl/channel_msg_handler.h"19#include "adxl/channel_msg_handler.h"
@@ -14,7 +14,7 @@
14#include <vector>14#include <vector>
15#include <atomic>15#include <atomic>
16#include <algorithm>16#include <algorithm>
17-#include "adxl/channel.h"17+#include "adxl/comm_channel.h"
18#include "adxl/channel_manager.h"18#include "adxl/channel_manager.h"
19#include "adxl/channel_msg_handler.h"19#include "adxl/channel_msg_handler.h"
20#include "adxl/buffer_transfer_service.h"20#include "adxl/buffer_transfer_service.h"
@@ -218,7 +218,7 @@ TEST_F(HixlUTest, TestDeregisterUnregisterMem) {
218 218 
219TEST_F(HixlUTest, TestHeartbeat) {219TEST_F(HixlUTest, TestHeartbeat) {
220 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms220 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms
221- adxl::Channel::SetHeartbeatTimeout(50); // 50ms221+ adxl::CommChannel::SetHeartbeatTimeout(50); // 50ms
222 Hixl engine1;222 Hixl engine1;
223 llm::AutoCommResRuntimeMock::SetDevice(0);223 llm::AutoCommResRuntimeMock::SetDevice(0);
224 std::map<AscendString, AscendString> options1;224 std::map<AscendString, AscendString> options1;
@@ -341,7 +341,7 @@ TEST_F(AdxlEngineSTest, TestAdxlEngineFabricMemWithStartAddress) {
341 341 
342TEST_F(AdxlEngineSTest, TestHeartbeat) {342TEST_F(AdxlEngineSTest, TestHeartbeat) {
343 ChannelManager::SetHeartbeatWaitTime(10); // 10ms343 ChannelManager::SetHeartbeatWaitTime(10); // 10ms
344- Channel::SetHeartbeatTimeout(50); // 50ms344+ CommChannel::SetHeartbeatTimeout(50); // 50ms
345 AdxlEngine engine1;345 AdxlEngine engine1;
346 llm::AutoCommResRuntimeMock::SetDevice(0);346 llm::AutoCommResRuntimeMock::SetDevice(0);
347 std::map<AscendString, AscendString> options1;347 std::map<AscendString, AscendString> options1;
@@ -375,7 +375,7 @@ TEST_F(HixlSTest, TestHixlDisableBufferPoolD2D) {
375 375 
376TEST_F(HixlSTest, TestHeartbeat) {376TEST_F(HixlSTest, TestHeartbeat) {
377 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms377 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms
378- adxl::Channel::SetHeartbeatTimeout(50); // 50ms378+ adxl::CommChannel::SetHeartbeatTimeout(50); // 50ms
379 Hixl engine1;379 Hixl engine1;
380 llm::AutoCommResRuntimeMock::SetDevice(0);380 llm::AutoCommResRuntimeMock::SetDevice(0);
381 std::map<AscendString, AscendString> options1;381 std::map<AscendString, AscendString> options1;
@@ -425,7 +425,7 @@ TEST_F(HixlSTest, TestHixlServerDown) {
425 425 
426TEST_F(HixlSTest, TestHixlAutoClearChannel) {426TEST_F(HixlSTest, TestHixlAutoClearChannel) {
427 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms427 adxl::ChannelManager::SetHeartbeatWaitTime(10); // 10ms
428- adxl::Channel::SetHeartbeatTimeout(50); // 50ms428+ adxl::CommChannel::SetHeartbeatTimeout(50); // 50ms
429 llm::AutoCommResRuntimeMock::SetDevice(0);429 llm::AutoCommResRuntimeMock::SetDevice(0);
430 Hixl engine1;430 Hixl engine1;
431 std::map<AscendString, AscendString> options1;431 std::map<AscendString, AscendString> options1;