Skip to content

Refactors tf_test_utils, creating tf_utils and simplifying module specification. - #2452

Merged
phoenix-meadowlark merged 9 commits into
iree-org:mainfrom
phoenix-meadowlark:tf-test-utils-refactor
Jul 10, 2020
Merged

phoenix-meadowlark merged 9 commits into
iree-org:mainfrom
phoenix-meadowlark:tf-test-utils-refactor

Conversation

@phoenix-meadowlark

@phoenix-meadowlark phoenix-meadowlark commented Jul 9, 2020 •

Copy link
Copy Markdown
Contributor
  • Factors set_random_seed and save_and_compile_tf_module out of tf_test_utils.py into the new tf_utils.py.
    • I set the default behavior of compile_tf_module to be that it doesn't keep the saved model, since it's for most purposes an implementation detail. The main exceptions to this are the cases of comparing IREE benchmarks to other frameworks, and providing debugging info for tests.
  • Simplifies the tf_test_utils.compile_module API by removing support for tests that have multiple modules.
    • This feature was unused internally and in OSS, and debugging wasn't fully supported in its implementation.
  • Simplifies the way that modules are referenced in test files.
    • Previously, a union of CompiledModules was referenced with self.modules.module_name.all, and is now referenced with self.get_module().
    • Specific CompiledModules can still be referenced using self.compiled_modules.backend_name.

Additionally, whether or not compilation artifacts were being saved was inconsistently controlled by FLAGS.debug_dir. Some compilation artifacts were being saved to --test_tempdir in FLAGS.debug_dirs absence, while other compilation artifacts and the results of the test invocations weren't.

I changed the behavior to here to always save all compilation artifacts and results in FLAGS.debug_dir/test_name if FLAGS.debug_dir is provided, and in --test_tempdir/test_name otherwise.

Incidental changes:

  • Deleted exported_names_test.py as it was redundant.
  • Fixed bug where iree_compiler_targets=["vulkan-*"] created artifact names like compiled__vulkan_.vmfb.

@phoenix-meadowlark phoenix-meadowlark added integrations/tensorflow TensorFlow model import and conversion integrations Relating to high-level frontend integrations labels Jul 9, 2020
@phoenix-meadowlark
phoenix-meadowlark force-pushed the tf-test-utils-refactor branch 2 times, most recently from c676ebb to 2de1654 Compare July 9, 2020 02:38
Comment thread integrations/tensorflow/e2e/BUILD Resolved
@phoenix-meadowlark
phoenix-meadowlark marked this pull request as ready for review July 9, 2020 17:56
Comment thread integrations/tensorflow/e2e/README.md Resolved
Comment thread integrations/tensorflow/e2e/README.md Resolved
@phoenix-meadowlark
phoenix-meadowlark force-pushed the tf-test-utils-refactor branch 2 times, most recently from e5b985b to de1c299 Compare July 10, 2020 16:58
@phoenix-meadowlark
phoenix-meadowlark merged commit c53ad00 into iree-org:main Jul 10, 2020
@phoenix-meadowlark
phoenix-meadowlark deleted the tf-test-utils-refactor branch July 10, 2020 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrations/tensorflow TensorFlow model import and conversion integrations Relating to high-level frontend integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants