From 3c49dd4af587931f0133a586a8c61549d121ba4b Mon Sep 17 00:00:00 2001 From: Kanvi Khanna Date: Tue, 7 Jan 2020 11:21:38 -0800 Subject: [PATCH 1/3] add the missing unref since a call to Lookup increases the refcount --- ngraph_bridge/ngraph_encapsulate_op_utils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/ngraph_bridge/ngraph_encapsulate_op_utils.cc b/ngraph_bridge/ngraph_encapsulate_op_utils.cc index d12494e45..d61f25e21 100644 --- a/ngraph_bridge/ngraph_encapsulate_op_utils.cc +++ b/ngraph_bridge/ngraph_encapsulate_op_utils.cc @@ -154,6 +154,7 @@ Status GetPipelinedIOTensorsReadyForExecution( NGRAPH_VLOG(2) << "[PREFETCH] COMPUTE: Using device tensors"; } shared_data->IncrSkipCount(); + shared_data->Unref(); } } From 3584524c23497c84ace5b761607813f03a3e1f9f Mon Sep 17 00:00:00 2001 From: Shrestha Malik Date: Thu, 9 Jan 2020 13:23:41 -0800 Subject: [PATCH 2/3] possible memory leak --- ngraph_bridge/ngraph_encapsulate_op_utils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/ngraph_bridge/ngraph_encapsulate_op_utils.cc b/ngraph_bridge/ngraph_encapsulate_op_utils.cc index d61f25e21..13fab1a3d 100644 --- a/ngraph_bridge/ngraph_encapsulate_op_utils.cc +++ b/ngraph_bridge/ngraph_encapsulate_op_utils.cc @@ -99,6 +99,7 @@ Status GetPipelinedIOTensorsReadyForExecution( get<2>(io_tensors_next_iter)}; if (current_iter_pipeline_depth != (!next_io_tensor_bundle.Id)) { + delete shared_data; return errors::Internal("Current Pipeline Depth is ", current_iter_pipeline_depth, " and next iter pipeline depth is also ", From 60d7faea9c052336d91f9bf8de3bfcc7fb4b3237 Mon Sep 17 00:00:00 2001 From: Shrestha Malik Date: Thu, 9 Jan 2020 14:24:36 -0800 Subject: [PATCH 3/3] minor --- ngraph_bridge/ngraph_encapsulate_op_utils.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ngraph_bridge/ngraph_encapsulate_op_utils.cc b/ngraph_bridge/ngraph_encapsulate_op_utils.cc index 13fab1a3d..ea893160b 100644 --- a/ngraph_bridge/ngraph_encapsulate_op_utils.cc +++ b/ngraph_bridge/ngraph_encapsulate_op_utils.cc @@ -100,10 +100,9 @@ Status GetPipelinedIOTensorsReadyForExecution( if (current_iter_pipeline_depth != (!next_io_tensor_bundle.Id)) { delete shared_data; - return errors::Internal("Current Pipeline Depth is ", - current_iter_pipeline_depth, - " and next iter pipeline depth is also ", - next_io_tensor_bundle.Id); + return errors::Internal( + "Current Pipeline Depth is ", current_iter_pipeline_depth, + " and next iter pipeline depth is also ", next_io_tensor_bundle.Id); } shared_data->AddNextIOTensorBundleForDeviceTransfer(