Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit 308687f

Browse files
chuanhaozhugeMesh TensorFlow Team
authored andcommitted
Make TPU variable name deterministic.
Only use the unique variable handle id as handle cache key, but not the variable handle's name. This resolves a graph non-determinism issue seen in an internal workload. PiperOrigin-RevId: 435903760
1 parent 39f4bd6 commit 308687f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mesh_tensorflow/tpu_variables.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def handle(self):
8282
if tpu_context is None:
8383
return self._primary_var.handle
8484

85-
return tpu_context.get_replicated_var_handle(self._name, self._vars)
85+
return tpu_context.get_replicated_var_handle(self._name, self._name,
86+
self._vars)
8687

8788
@contextlib.contextmanager
8889
def _assign_dependencies(self):

0 commit comments

Comments
 (0)