From 584e28bc63c2f0ded148b3db8201d3d720c22b2b Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Fri, 28 Aug 2020 16:12:46 +0200 Subject: [PATCH] [TensorFlow] Patch out bug in collective primitive --- ...0_fix-collective-all-reduce-strategy.patch | 22 +++++++++++++++++++ ...ensorFlow-2.2.0-foss-2019b-Python-3.7.4.eb | 3 +++ ...rFlow-2.2.0-fosscuda-2019b-Python-3.7.4.eb | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch new file mode 100644 index 00000000000..bc1b8a20f01 --- /dev/null +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch @@ -0,0 +1,22 @@ +Fix for AttributeError: 'CollectiveAllReduceExtended' object has no attribute '_cfer_fn_cache' +See https://github.com/tensorflow/tensorflow/issues/39417 + +Author: Alexander Grund +--- tensorflow-2.1.0-orig/tensorflow/python/distribute/collective_all_reduce_strategy.py 2020-05-11 18:14:03.682085572 +0200 ++++ tensorflow-2.1.0/tensorflow/python/distribute/collective_all_reduce_strategy.py 2020-05-11 18:15:41.623409641 +0200 +@@ -19,6 +19,7 @@ + from __future__ import print_function + + import copy ++import weakref + + from tensorflow.core.protobuf import config_pb2 + from tensorflow.core.protobuf import rewriter_config_pb2 +@@ -172,6 +173,7 @@ + cross_device_ops_lib.CollectiveCommunication) + self._communication = communication + self._initialize_strategy(cluster_resolver) ++ self._cfer_fn_cache = weakref.WeakKeyDictionary() + assert isinstance(self._get_cross_device_ops(), + cross_device_ops_lib.CollectiveAllReduce) + diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-foss-2019b-Python-3.7.4.eb b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-foss-2019b-Python-3.7.4.eb index 7c4e03c0c7d..d40a0ab6902 100644 --- a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-foss-2019b-Python-3.7.4.eb +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-foss-2019b-Python-3.7.4.eb @@ -129,6 +129,7 @@ exts_list = [ 'patches': [ 'TensorFlow-1.14.0_swig-env.patch', 'TensorFlow-2.1.0_fix-cuda-build.patch', + 'TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch', ], 'source_tmpl': 'v%(version)s.tar.gz', 'source_urls': ['https://github.com/tensorflow/tensorflow/archive/'], @@ -137,6 +138,8 @@ exts_list = [ '69cd836f87b8c53506c4f706f655d423270f5a563b76dc1cfa60fbc3184185a3', # v2.2.0.tar.gz 'b83cce6b91c7d19b8b320158ffc50fb4b2de454f5ac191c58d704234a1bf9005', # TensorFlow-1.14.0_swig-env.patch '78c20aeaa7784b8ceb46238a81e8c2461137d28e0b576deeba8357d23fbe1f5a', # TensorFlow-2.1.0_fix-cuda-build.patch + # TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch + '093f4dd3ec372a82d50dffe32eea6821025cd1c406911a746c4367a40bc38486', ], }), ] diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-fosscuda-2019b-Python-3.7.4.eb b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-fosscuda-2019b-Python-3.7.4.eb index fe727062968..a84d2cebb1f 100644 --- a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-fosscuda-2019b-Python-3.7.4.eb +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.2.0-fosscuda-2019b-Python-3.7.4.eb @@ -131,6 +131,7 @@ exts_list = [ 'patches': [ 'TensorFlow-1.14.0_swig-env.patch', 'TensorFlow-2.1.0_fix-cuda-build.patch', + 'TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch', ], 'source_tmpl': 'v%(version)s.tar.gz', 'source_urls': ['https://github.com/tensorflow/tensorflow/archive/'], @@ -139,6 +140,8 @@ exts_list = [ '69cd836f87b8c53506c4f706f655d423270f5a563b76dc1cfa60fbc3184185a3', # v2.2.0.tar.gz 'b83cce6b91c7d19b8b320158ffc50fb4b2de454f5ac191c58d704234a1bf9005', # TensorFlow-1.14.0_swig-env.patch '78c20aeaa7784b8ceb46238a81e8c2461137d28e0b576deeba8357d23fbe1f5a', # TensorFlow-2.1.0_fix-cuda-build.patch + # TensorFlow-2.1.0_fix-collective-all-reduce-strategy.patch + '093f4dd3ec372a82d50dffe32eea6821025cd1c406911a746c4367a40bc38486', ], }), ]