From: @jiming6 Reviewed-by: @xchu42,@wqtshg Signed-off-by: @wqtshgtags/v1.1.0
@@ -880,6 +880,15 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size, | |||||
GELOGI("Unreusable block."); | GELOGI("Unreusable block."); | ||||
continue; | continue; | ||||
} | } | ||||
std::string batch_label; | |||||
if (reusable_block->IsSameLabel(batch_label)) { | |||||
std::string op_label; | |||||
(void)ge::AttrUtils::GetStr(node_op_desc, ATTR_NAME_BATCH_LABEL, op_label); | |||||
if (batch_label != op_label) { | |||||
GELOGI("label diff, op name %s", node_op_desc->GetName().c_str()); | |||||
continue; | |||||
} | |||||
} | |||||
// A node can reuse blocks of the same stream and preorder streams | // A node can reuse blocks of the same stream and preorder streams | ||||
if (CanReuseBySize(reusable_block_counts_, *reusable_block, block_size, real_size, continuous)) { | if (CanReuseBySize(reusable_block_counts_, *reusable_block, block_size, real_size, continuous)) { | ||||
@@ -1025,6 +1025,13 @@ Status MultiBatchGraphCopyer::InsertIdentityAfterSwitchN() { | |||||
} | } | ||||
Status ProcessMultiBatch(ComputeGraphPtr &graph) { | Status ProcessMultiBatch(ComputeGraphPtr &graph) { | ||||
const char *multi_batch_with_case = std::getenv("MULTI_BATCH_WITH_CASE"); | |||||
if (multi_batch_with_case != nullptr) { | |||||
PassManager pass_manager; | |||||
GE_CHK_STATUS_RET(pass_manager.AddPass("MultiBatchClonePass", new (std::nothrow) MultiBatchClonePass)); | |||||
return pass_manager.Run(graph); | |||||
} | |||||
std::vector<std::vector<int64_t>> shapes; | std::vector<std::vector<int64_t>> shapes; | ||||
if (!InitDynamicParams(shapes)) { | if (!InitDynamicParams(shapes)) { | ||||
GELOGD("There is no multi-batch options, no need to process multi-batch copy"); | GELOGD("There is no multi-batch options, no need to process multi-batch copy"); | ||||