已合并
refactor: 清理block_mem_zero_copy未使用变量并优化注释 #4522
tangqunzhang创建于 9 天前
refactor: 清理block_mem_zero_copy未使用变量并优化注释 #4522
已合并
共 2 个文件变更+3-8
| @@ -47,7 +47,6 @@ const char *const kOpNoReuseMem = "no_reuse_mem_flag"; | |||
| 47 | const std::string kOffline = "offline"; | 47 | const std::string kOffline = "offline"; |
| 48 | const int32_t kReuseMaxOpNum = 10; | 48 | const int32_t kReuseMaxOpNum = 10; |
| 49 | const int32_t kReuseMaxCharNum = 2000; | 49 | const int32_t kReuseMaxCharNum = 2000; |
| 50 | -const std::set<ge::DataType> kNotPostReuseDataType = {ge::DT_RESOURCE, ge::DT_VARIANT}; | ||
| 51 | 50 | ||
| 52 | int64_t GetStreamId(const ge::OpDesc *const desc) { | 51 | int64_t GetStreamId(const ge::OpDesc *const desc) { |
| 53 | return ge::MemReuseUtils::GetStreamId(desc); | 52 | return ge::MemReuseUtils::GetStreamId(desc); |
| @@ -29,10 +29,6 @@ | |||
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | namespace ge { | 31 | namespace ge { |
| 32 | -namespace { | ||
| 33 | -const std::string kOffline = "offline"; | ||
| 34 | -} | ||
| 35 | - | ||
| 36 | // 地址不可刷新时不能做零拷贝,也不能和零拷贝节点内存进行复用 | 32 | // 地址不可刷新时不能做零拷贝,也不能和零拷贝节点内存进行复用 |
| 37 | // 和Data、Netoutput连接时用于判断是否可零拷贝,和其他节点连接是用于判断是否可以和零拷贝节点进行复用 | 33 | // 和Data、Netoutput连接时用于判断是否可零拷贝,和其他节点连接是用于判断是否可以和零拷贝节点进行复用 |
| 38 | bool IsNodeSupportZeroCopy(const ge::NodePtr &node) { | 34 | bool IsNodeSupportZeroCopy(const ge::NodePtr &node) { |
| @@ -40,9 +36,9 @@ bool IsNodeSupportZeroCopy(const ge::NodePtr &node) { | |||
| 40 | if (!is_support_zero_copy) { | 36 | if (!is_support_zero_copy) { |
| 41 | GELOGI("Op[%s] not support zero copy", node->GetName().c_str()); | 37 | GELOGI("Op[%s] not support zero copy", node->GetName().c_str()); |
| 42 | } else { | 38 | } else { |
| 43 | - // IsAddressRefreshable在动态shape静态子图场景认为hccl算子是可刷新的,实际上因为处理阶段有差异, | 39 | + // IsAddressRefreshable在动态shape静态子图场景认为hccl算子都是可刷新的,实际上因为处理阶段有差异, |
| 44 | - // 比如hccl判断时还未拆图,可能导致结果不一致,这里还是统一使用IsHcomNodeNotSupportAddrRefresh的结果 | 40 | + // 比如hccl判断时还未拆图,可能导致结果不一致,另外静态子图里hccl支持刷新会有性能劣化(hccl内部会做数据拷贝等额外处理) |
| 45 | - // 另外静态子图里hccl支持刷新会有性能劣化,hccl内部会做数据拷贝等额外处理 | 41 | + // 这里还是保持原有处理,统一使用IsHcomNodeNotSupportAddrRefresh的结果(不可刷新) |
| 46 | const auto root_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph()); | 42 | const auto root_graph = GraphUtils::FindRootGraph(node->GetOwnerComputeGraph()); |
| 47 | const bool is_dynamic_shape_sub_graph = (root_graph != nullptr) && root_graph->GetGraphUnknownFlag() && | 43 | const bool is_dynamic_shape_sub_graph = (root_graph != nullptr) && root_graph->GetGraphUnknownFlag() && |
| 48 | (!node->GetOwnerComputeGraph()->GetGraphUnknownFlag()); | 44 | (!node->GetOwnerComputeGraph()->GetGraphUnknownFlag()); |