From 8d7e169932f45e3bf41a5c927aacf8b32a96e310 Mon Sep 17 00:00:00 2001 From: Xiaoyu Wang Date: Fri, 16 Aug 2019 11:32:55 -0700 Subject: [PATCH 1/3] fix resource leaking (#210) --- ngraph_bridge/ngraph_freshness_tracker.cc | 8 ++++---- ngraph_bridge/ngraph_freshness_tracker.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ngraph_bridge/ngraph_freshness_tracker.cc b/ngraph_bridge/ngraph_freshness_tracker.cc index c09e63b02..eeccd84bd 100644 --- a/ngraph_bridge/ngraph_freshness_tracker.cc +++ b/ngraph_bridge/ngraph_freshness_tracker.cc @@ -26,7 +26,7 @@ namespace ngraph_bridge { void NGraphFreshnessTracker::MarkFresh( const void* base_pointer, - std::shared_ptr user) { + const std::shared_ptr& user) { mutex_lock l(mu_); auto it = freshness_map_.find(base_pointer); if (it != freshness_map_.end()) { @@ -36,7 +36,7 @@ void NGraphFreshnessTracker::MarkFresh( bool NGraphFreshnessTracker::IsFresh( const void* base_pointer, - std::shared_ptr user) { + const std::shared_ptr& user) { mutex_lock l(mu_); auto it = freshness_map_.find(base_pointer); if (it == freshness_map_.end()) { @@ -69,9 +69,9 @@ void NGraphFreshnessTracker::RemoveTensor(const void* base_pointer) { } void NGraphFreshnessTracker::RemoveUser( - std::shared_ptr user) { + const std::shared_ptr& user) { mutex_lock l(mu_); - for (auto kv : freshness_map_) { + for (auto& kv : freshness_map_) { kv.second.erase(user); } } diff --git a/ngraph_bridge/ngraph_freshness_tracker.h b/ngraph_bridge/ngraph_freshness_tracker.h index e4f72a8d8..5a877105f 100644 --- a/ngraph_bridge/ngraph_freshness_tracker.h +++ b/ngraph_bridge/ngraph_freshness_tracker.h @@ -95,12 +95,12 @@ class NGraphFreshnessTracker : public ResourceBase { // If freshness_map_ has the base_pointer, then inserts the user function into // its set of user functions void MarkFresh(const void* base_pointer, - std::shared_ptr user); + const std::shared_ptr& user); // Checks if the freshness_map_ has the user function for base_pointer, else // returns false bool IsFresh(const void* base_pointer, - std::shared_ptr user); + const std::shared_ptr& user); // Removes all the functions for the base_pointer in the freshness_map_, i.e. // sets the set for base_pointer to empty @@ -114,7 +114,7 @@ class NGraphFreshnessTracker : public ResourceBase { void RemoveTensor(const void* base_pointer); // Removes the user function from the freshness_map_ - void RemoveUser(std::shared_ptr user); + void RemoveUser(const std::shared_ptr& user); private: // mutex protecting the freshness_map_ From 9f4a1e2d06cbe1757c23c8adc5b0c967b3b58caa Mon Sep 17 00:00:00 2001 From: avijit-nervana Date: Fri, 16 Aug 2019 14:38:25 -0700 Subject: [PATCH 2/3] Updated the version numbers --- README.md | 6 +++--- ngraph_bridge/version.cc | 4 ++-- python/setup.in.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index eba4972c9..286ffaf90 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ Once TensorFlow's dependencies are installed, clone the `ngraph-bridge` repo: git clone https://github.com/tensorflow/ngraph-bridge.git cd ngraph-bridge - git checkout v0.18.0 + git checkout v0.18.1-rc0 Run the following Python script to build TensorFlow, nGraph, and the bridge. Use Python 3.5: @@ -127,8 +127,8 @@ Verify that `ngraph-bridge` installed correctly: This will produce something like this: TensorFlow version: <1.14.0> - nGraph bridge version: - nGraph version used for this build: b'0.25.0+005c118' + nGraph bridge version: + nGraph version used for this build: b'Version nuymber' TensorFlow version used for this build: CXX11_ABI flag used for this build: 0 nGraph bridge built with Grappler: False diff --git a/ngraph_bridge/version.cc b/ngraph_bridge/version.cc index f93fc5c57..2cda4353d 100644 --- a/ngraph_bridge/version.cc +++ b/ngraph_bridge/version.cc @@ -25,14 +25,14 @@ #define NG_TF_MAJOR_VERSION 0 #define NG_TF_MINOR_VERSION 18 -#define NG_TF_PATCH_VERSION 0 +#define NG_TF_PATCH_VERSION 1 // The version suffix is used for pre-release version numbers // For example before v0.7.0 we may do a pre-release i.e., a release // candidate such as v0.7.0-rc0 // The code in master will always have the last released version number // with a suffix of '-master' -#define NG_TF_VERSION_SUFFIX "" +#define NG_TF_VERSION_SUFFIX "rc0" #define VERSION_STR_HELPER(x) #x #define VERSION_STR(x) VERSION_STR_HELPER(x) diff --git a/python/setup.in.py b/python/setup.in.py index 273020acc..3d8828dff 100644 --- a/python/setup.in.py +++ b/python/setup.in.py @@ -59,7 +59,7 @@ def get_tag(self): setup( name='ngraph_tensorflow_bridge', - version='0.18.0', + version='0.18.1rc0', description='Intel nGraph compiler and runtime for TensorFlow', long_description=long_description, long_description_content_type="text/markdown", From 407f5b1baabf65b73179f081038ecfc8a3254692 Mon Sep 17 00:00:00 2001 From: Avijit Date: Fri, 16 Aug 2019 16:10:54 -0700 Subject: [PATCH 3/3] Update README.md Co-Authored-By: Shrestha Malik --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 286ffaf90..fd0f7866a 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ Verify that `ngraph-bridge` installed correctly: TensorFlow version: <1.14.0> nGraph bridge version: - nGraph version used for this build: b'Version nuymber' + nGraph version used for this build: b'Version number' TensorFlow version used for this build: CXX11_ABI flag used for this build: 0 nGraph bridge built with Grappler: False