Skip to content

Commit

Permalink
[Benchmarking-Py] Adding converter.save() before exiting with `TF_T…
Browse files Browse the repository at this point in the history
…RT_BENCHMARK_EARLY_QUIT=1`
  • Loading branch information
DEKHTIARJonathan committed Sep 22, 2022
1 parent 5622106 commit ccc606f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tftrt/benchmarking-python/benchmark_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ def engine_build_input_fn(num_batches, model_phase):
pass

if strtobool(os.environ.get("TF_TRT_BENCHMARK_EARLY_QUIT", "0")):
# Save the result if needed
converter.save(self._args.output_saved_model_dir)
logging.info(
f"Converted graph saved to "
f"`{self._args.output_saved_model_dir}`"
)
sys.exit(0)

if self._args.optimize_offline:
Expand Down

0 comments on commit ccc606f

Please sign in to comment.