Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lei Cao committed Feb 11, 2023
1 parent 69f1cbe commit 6ceb297
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions onnxruntime/core/framework/allocation_planner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,8 @@ class PlannerImpl {
#if !defined(ORT_MINIMAL_BUILD) && defined(ORT_MEMORY_PROFILE)
InplaceReuse(reused, current);
#endif
} else if (IsNonTensor(*node_output)) {
AllocPlan(current).alloc_kind = AllocKind::kAllocate;
} else if (!context_->IsParallelExecutionEnabled() &&
FindReusableTensor(*node_output, &reused)) {
// Reuse an available (dead) buffer for this output, this is only for sequential execution.
Expand Down
6 changes: 3 additions & 3 deletions onnxruntime/test/framework/allocation_planner_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1845,9 +1845,9 @@ TEST_F(PlannerTest, ParaPlanCreation) {
auto* exe_plan = const_cast<onnxruntime::SessionState&>(main_graph_session_state).GetExecutionPlan();
auto& per_value_plans = exe_plan->GetAllocationPlan();
InlinedHashMap<std::string, std::string> reuse_pairs;
reuse_pairs.emplace("conv_0_out", "maxpool_out");
reuse_pairs.emplace("conv_1_out", "conv_2_out");
reuse_pairs.emplace("relu_1_out", "relu_2_out");
reuse_pairs.emplace("conv_0_out", "relu_0_out"); // conv_0_out is reused by relu_0_out
reuse_pairs.emplace("conv_1_out", "relu_1_out"); // conv_1_out is reused by relu_1_out
reuse_pairs.emplace("conv_2_out", "relu_2_out"); // conv_2_out is reused by relu_2_out
for (size_t i = 0; i < per_value_plans.size(); ++i) {
auto& per_value_plan = per_value_plans[i];
if (per_value_plan.alloc_kind == AllocKind::kReuse) {
Expand Down

0 comments on commit 6ceb297

Please sign in to comment.