multi batch

pull/300/head
wjm 5 years ago
parent 711bc700fc
commit 8e67c970b8

@ -880,6 +880,15 @@ MemoryBlock *BlockMemAssigner::ApplyMemory(size_t block_size, size_t real_size,
GELOGI("Unreusable block.");
continue;
}
std::string batch_label;
if (reusable_block->IsSameLabel(batch_label)) {
std::string op_label;
(void)ge::AttrUtils::GerStr(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
if (CanReuseBySize(reusable_block_counts_, *reusable_block, block_size, real_size, continuous)) {

@ -1025,6 +1025,13 @@ Status MultiBatchGraphCopyer::InsertIdentityAfterSwitchN() {
}
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;
if (!InitDynamicParams(shapes)) {
GELOGD("There is no multi-batch options, no need to process multi-batch copy");

Loading…
Cancel
Save