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

Commit cccc00e

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: 436262849
1 parent 39f4bd6 commit cccc00e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mesh_tensorflow/tpu_variables.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ 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+
# Using variable name as handle id.
86+
return tpu_context.get_replicated_var_handle(self._name, self._name,
87+
self._vars)
8688

8789
@contextlib.contextmanager
8890
def _assign_dependencies(self):

0 commit comments

Comments
 (0)