Skip to content

Commit

Permalink
[tfdbg] Exclude DestroyResourceOp from debugger's dumping of eager op…
Browse files Browse the repository at this point in the history
… execution

This removes a deadlock that happens in certain test configurations, e.g., DistributionStrategy / OneDeviceStrategy.

PiperOrigin-RevId: 284757549
Change-Id: I89f26718f4b3ec9c12ab867ef4ec1451c553f5d8
  • Loading branch information
caisq authored and tensorflower-gardener committed Dec 10, 2019
1 parent f4e5f11 commit d4ca02d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tensorflow/python/debug/lib/dumping_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,13 @@ def callback(self,
return self._instrument_symbolic_tensors(
outputs, op_type, op_name, context_id, output_tensor_ids)
else:
if compat.as_bytes(op_type) == b"DebugNumericSummaryV2":
op_type_bytes = compat.as_bytes(op_type)
if op_type_bytes == b"DebugNumericSummaryV2":
# TODO(b/140334369): Remove this special casing logic once op_callback.
# automatically prevents infinite recursion in eager mode.
return None
if op_type_bytes in op_callbacks_common.OP_CALLBACK_SKIP_OPS:
return None
context_id = self._func_graph_id_from_func_name(op_type)
input_ids = [t._id for t in inputs] # pylint:disable=protected-access
writer.WriteExecution(self._dump_eager_tensors(
Expand Down
2 changes: 2 additions & 0 deletions tensorflow/python/debug/lib/op_callbacks_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@
b"TPUCompilationResult",
b"TPUReplicatedOutput",
b"ConfigureDistributedTPU",
# Other special ops used by TensorFlow internally.
b"DestroyResourceOp",
)

0 comments on commit d4ca02d

Please sign in to comment.