Skip to content

Commit 74dd484

Browse files
committed
Fix missing imports popdist_strategy
Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, frederikm Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, frederikm Maniphest Tasks: T67994 Differential Revision: https://phabricator.sourcevertex.net/D73661
1 parent c05d4ec commit 74dd484

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed

tensorflow/python/ipu/distributed/popdist_strategy.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from tensorflow.python.distribute import device_util
2222
from tensorflow.python.distribute import distribute_lib
2323
from tensorflow.python.distribute import distribute_utils
24+
from tensorflow.python.distribute import numpy_dataset
2425
from tensorflow.python.distribute import reduce_util
2526
from tensorflow.python.distribute import values
2627
from tensorflow.python.framework import device as device_lib
@@ -34,7 +35,6 @@
3435
from tensorflow.python.ops import variable_scope
3536
from tensorflow.python.training import server_lib
3637
from tensorflow.python.training.tracking import base as trackable
37-
from tensorflow.python.util import tf_contextlib
3838
from tensorflow.python.ipu.horovod import Sum, Average, \
3939
allreduce as hvd_allreduce, \
4040
broadcast as hvd_broadcast
@@ -106,25 +106,6 @@ def supports_loss_scaling(self):
106106
return True
107107

108108

109-
def _is_inside_compilation():
110-
graph = ops.get_default_graph()
111-
attrs = graph._attr_scope_map # pylint: disable=protected-access
112-
113-
is_in_xla_context = control_flow_util.GraphOrParentsInXlaContext(graph)
114-
is_outside_compilation = scopes.OUTSIDE_COMPILATION_NAME in attrs
115-
116-
return is_in_xla_context and not is_outside_compilation
117-
118-
119-
@tf_contextlib.contextmanager
120-
def _outside_compilation_scope_if_needed(name):
121-
if _is_inside_compilation():
122-
with scopes.outside_compilation_scope(name):
123-
yield
124-
else:
125-
yield
126-
127-
128109
def _ipu_device_for_host(ipu_device_string, host_device_string):
129110
ipu_device = device_lib.DeviceSpec.from_string(ipu_device_string)
130111
host_device = device_lib.DeviceSpec.from_string(host_device_string)
@@ -139,11 +120,6 @@ def _ipu_device_for_host(ipu_device_string, host_device_string):
139120
return ipu_for_host.to_string()
140121

141122

142-
def _make_identity_op(v):
143-
name = v.name.replace(":", "_")
144-
return array_ops.identity(v, name=name)
145-
146-
147123
class IPUDistributedVariable(values.DistributedVariable): # pylint: disable=abstract-method
148124
pass
149125

0 commit comments

Comments
 (0)