Skip to content

Commit

Permalink
Remove skip of jit_compile=True when targeting TPUs; the underlying b…
Browse files Browse the repository at this point in the history
…ug is marked as fixed.

PiperOrigin-RevId: 546418777
  • Loading branch information
jkr26 authored and tensorflower-gardener committed Jul 10, 2023
1 parent f3b338a commit 4a92367
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions keras/engine/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -1351,15 +1351,7 @@ def run_step(data):
model._train_counter.assign_add(1)
return outputs

if self.jit_compile and not isinstance(
model.distribute_strategy,
(
tf.compat.v1.distribute.experimental.TPUStrategy,
tf.distribute.TPUStrategy,
),
):
# TODO(b/258249546): Explicit `jit_compile=True` on TPU causes
# unexpected behavior, so we skip TPU training now.
if self.jit_compile:
run_step = tf.function(
run_step, jit_compile=True, reduce_retracing=True
)
Expand Down

0 comments on commit 4a92367

Please sign in to comment.