Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
5a5e0b7e
Commit
5a5e0b7e
authored
Apr 01, 2021
by
A. Unique TensorFlower
Browse files
enable XLA around model training step via jit_compile
PiperOrigin-RevId: 366330392
parent
7687b1d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
official/core/base_trainer.py
official/core/base_trainer.py
+5
-1
No files found.
official/core/base_trainer.py
View file @
5a5e0b7e
...
@@ -379,7 +379,11 @@ class Trainer(_AsyncTrainer):
...
@@ -379,7 +379,11 @@ class Trainer(_AsyncTrainer):
"""See base class."""
"""See base class."""
def
step_fn
(
inputs
):
def
step_fn
(
inputs
):
logs
=
self
.
task
.
train_step
(
if
self
.
config
.
runtime
.
enable_xla
and
(
self
.
config
.
runtime
.
num_gpus
>
0
):
task_train_step
=
tf
.
function
(
self
.
task
.
train_step
,
jit_compile
=
True
)
else
:
task_train_step
=
self
.
task
.
train_step
logs
=
task_train_step
(
inputs
,
inputs
,
model
=
self
.
model
,
model
=
self
.
model
,
optimizer
=
self
.
optimizer
,
optimizer
=
self
.
optimizer
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment