Skip to content

Commit e0fca38

Browse files
lingvo-botcopybara-github
authored andcommitted
Add input Reset in ExperimentalDecodeProgram at "end" of decoding infeed. This seems release some memory since currently after switching away from decode programs, some memories is still hold for their input pipeline in trainer host, which is not necessary for resettable case, but can cause OOM.
PiperOrigin-RevId: 489023208
1 parent 5e4b7fd commit e0fca38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lingvo/core/program.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,12 @@ def Run(self, sess=None, threadpool=None):
17981798
self.WaitThread([infeed_future, decode_future] + post_futures)
17991799
elapsed_secs = time.time() - start_time
18001800

1801+
# Reset again after decoding to release input generator memories for other
1802+
# programs.
1803+
if self._task.input.params.resettable:
1804+
tf.logging.info('Resetting input_generator after decoding.')
1805+
self._task.input.Reset(sess)
1806+
18011807
return_future = None
18021808
if threadpool:
18031809
return_future = self._ThreadCall(

0 commit comments

Comments
 (0)