Repository navigation
Adds a class for tracing module calls and example tests. - #2660
Merged
phoenix-meadowlark merged 14 commits intoJul 31, 2020
Merged
Conversation
phoenix-meadowlark
force-pushed
the
traced-module
branch
8 times, most recently
from
July 25, 2020 01:04
98a5929 to
3f4b115
Compare
phoenix-meadowlark
force-pushed
the
traced-module
branch
from
July 25, 2020 01:06
3f4b115 to
faa71e6
Compare
phoenix-meadowlark
marked this pull request as ready for review
July 25, 2020 01:12
silvasean
suggested changes
Jul 27, 2020
Contributor
Author
This has since been removed. |
hanhanW
added a commit
that referenced
this pull request
Jul 29, 2020
This is useful to debug with IREE's tool starting from command-line level, and speedup debugging process. #2660 dumps traces at python level, the traces are split by invoked functions, but we would like to have more traces with dispatch function level, since IREE splits the function into multiple dispatch functions.
silvasean
suggested changes
Jul 29, 2020
hanhanW
added a commit
to hanhanW/iree
that referenced
this pull request
Jul 30, 2020
This is useful to debug with IREE's tool starting from command-line level, and speedup debugging process. iree-org#2660 dumps traces at python level, the traces are split by invoked functions, but we would like to have more traces with dispatch function level, since IREE splits the function into multiple dispatch functions.
silvasean
approved these changes
Jul 30, 2020
silvasean
left a comment
Contributor
There was a problem hiding this comment.
This is fantastic! Thanks!
MaheshRavishankar
pushed a commit
to MaheshRavishankar/iree
that referenced
this pull request
Jul 30, 2020
This is useful to debug with IREE's tool starting from command-line level, and speedup debugging process. iree-org#2660 dumps traces at python level, the traces are split by invoked functions, but we would like to have more traces with dispatch function level, since IREE splits the function into multiple dispatch functions.
phoenix-meadowlark
added a commit
that referenced
this pull request
Jul 31, 2020
Follow up to #2660. - Removes old infra: - `CompiledModuleTestCase` - `_VirtualModuleInstance` - `_VirtualModuleFunctionWrapper` - `_collect_disagreements_recursively` - `_collect_disagreements` - `_make_multi_result_class` and `MultiResults` - `_instantiate_backends` - `explicit_backend_test.py` - Updates all tests in `integrations/tensorflow/e2e/` to use the `TracedModuleTestCase`. - Updates `iree_e2e_test_suite` and `iree_vision_test_suite` to use the new explicit `--reference_backend` flag. - Adds data generation helpers to `tf_utils`: - `uniform(shape, dtype=np.float32)` reduces verbosity of getting random `np.float32` data. - `ndarange(shape, dtype=np.float32)` reduces verbosity of generating high rank `np.arange` data. - Updates `tf.tensor --> np.array` conversion in `TfCompiledModule` to handle the following case: ```python a = np.array(31. dtype=np.float32) b = tf.convert_to_tensor(a) c = b.numpy() type(a) != type(c) # np.array != np.float32 ```
Merged
copybara-service Bot
pushed a commit
that referenced
this pull request
Jul 31, 2020
* 6c1869b Add license header to linker scripts (#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (#2627)" (#2735) * da48d03 Adds a class for tracing module calls and example tests. (#2660) * d66150d Enables `conv_test` on vulkan. (#2723) * a3b73bf Add .python-version to .gitignore (#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (#2725) * 763dc09 Fix ModelBuilder build (#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (#2709) * 91a05ff Merge google -> main (#2719) * f0307a8 Revert "Merge google -> main" (#2718) * 77d2f8b Merge google -> main (#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (#2536)" (#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (#2702) * 48efada Dump input values to a file. (#2683) * 0fd8a55 Mark shell scripts as executable (#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (#2687) * 64e2987 Merge google -> main (#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (#2696) * eec62a1 Remove dylib-llvm-aot tests (#2694) * 11bd7a0 Fix stdalign include in Android (#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (#2685) * f2d6649 Bump pybind11 to head. (#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (#2686) * 36abdfd [ModelBuilder] Revert spurious path change (#2684) * c96bbb1 Merge pull request #2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (#2577) * 1425737 Fix flatcc target name and binary path (#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc. COPYBARA_INTEGRATE_REVIEW=#2700 from hanhanW:fix-google c20d6f5 PiperOrigin-RevId: 324296127
copybara-service Bot
pushed a commit
that referenced
this pull request
Jul 31, 2020
* 6c1869b Add license header to linker scripts (#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (#2627)" (#2735) * da48d03 Adds a class for tracing module calls and example tests. (#2660) * d66150d Enables `conv_test` on vulkan. (#2723) * a3b73bf Add .python-version to .gitignore (#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (#2725) * 763dc09 Fix ModelBuilder build (#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (#2709) * 91a05ff Merge google -> main (#2719) * f0307a8 Revert "Merge google -> main" (#2718) * 77d2f8b Merge google -> main (#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (#2536)" (#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (#2702) * 48efada Dump input values to a file. (#2683) * 0fd8a55 Mark shell scripts as executable (#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (#2687) * 64e2987 Merge google -> main (#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (#2696) * eec62a1 Remove dylib-llvm-aot tests (#2694) * 11bd7a0 Fix stdalign include in Android (#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (#2685) * f2d6649 Bump pybind11 to head. (#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (#2686) * 36abdfd [ModelBuilder] Revert spurious path change (#2684) * c96bbb1 Merge pull request #2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (#2577) * 1425737 Fix flatcc target name and binary path (#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc. COPYBARA_INTEGRATE_REVIEW=#2700 from hanhanW:fix-google c20d6f5 PiperOrigin-RevId: 324296127
GMNGeoffrey
pushed a commit
to GMNGeoffrey/iree
that referenced
this pull request
Aug 3, 2020
* 6c1869b Add license header to linker scripts (iree-org#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (iree-org#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (iree-org#2627)" (iree-org#2735) * da48d03 Adds a class for tracing module calls and example tests. (iree-org#2660) * d66150d Enables `conv_test` on vulkan. (iree-org#2723) * a3b73bf Add .python-version to .gitignore (iree-org#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (iree-org#2725) * 763dc09 Fix ModelBuilder build (iree-org#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (iree-org#2709) * 91a05ff Merge google -> main (iree-org#2719) * f0307a8 Revert "Merge google -> main" (iree-org#2718) * 77d2f8b Merge google -> main (iree-org#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (iree-org#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (iree-org#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (iree-org#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (iree-org#2536)" (iree-org#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (iree-org#2702) * 48efada Dump input values to a file. (iree-org#2683) * 0fd8a55 Mark shell scripts as executable (iree-org#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (iree-org#2687) * 64e2987 Merge google -> main (iree-org#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (iree-org#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (iree-org#2696) * eec62a1 Remove dylib-llvm-aot tests (iree-org#2694) * 11bd7a0 Fix stdalign include in Android (iree-org#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (iree-org#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (iree-org#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (iree-org#2685) * f2d6649 Bump pybind11 to head. (iree-org#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (iree-org#2686) * 36abdfd [ModelBuilder] Revert spurious path change (iree-org#2684) * c96bbb1 Merge pull request iree-org#2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (iree-org#2577) * 1425737 Fix flatcc target name and binary path (iree-org#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc. PiperOrigin-RevId: 324296127
GMNGeoffrey
pushed a commit
to GMNGeoffrey/iree
that referenced
this pull request
Aug 3, 2020
* 6c1869b Add license header to linker scripts (iree-org#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (iree-org#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (iree-org#2627)" (iree-org#2735) * da48d03 Adds a class for tracing module calls and example tests. (iree-org#2660) * d66150d Enables `conv_test` on vulkan. (iree-org#2723) * a3b73bf Add .python-version to .gitignore (iree-org#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (iree-org#2725) * 763dc09 Fix ModelBuilder build (iree-org#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (iree-org#2709) * 91a05ff Merge google -> main (iree-org#2719) * f0307a8 Revert "Merge google -> main" (iree-org#2718) * 77d2f8b Merge google -> main (iree-org#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (iree-org#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (iree-org#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (iree-org#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (iree-org#2536)" (iree-org#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (iree-org#2702) * 48efada Dump input values to a file. (iree-org#2683) * 0fd8a55 Mark shell scripts as executable (iree-org#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (iree-org#2687) * 64e2987 Merge google -> main (iree-org#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (iree-org#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (iree-org#2696) * eec62a1 Remove dylib-llvm-aot tests (iree-org#2694) * 11bd7a0 Fix stdalign include in Android (iree-org#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (iree-org#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (iree-org#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (iree-org#2685) * f2d6649 Bump pybind11 to head. (iree-org#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (iree-org#2686) * 36abdfd [ModelBuilder] Revert spurious path change (iree-org#2684) * c96bbb1 Merge pull request iree-org#2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (iree-org#2577) * 1425737 Fix flatcc target name and binary path (iree-org#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc.
GMNGeoffrey
pushed a commit
to GMNGeoffrey/iree
that referenced
this pull request
Aug 3, 2020
* 6c1869b Add license header to linker scripts (iree-org#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (iree-org#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (iree-org#2627)" (iree-org#2735) * da48d03 Adds a class for tracing module calls and example tests. (iree-org#2660) * d66150d Enables `conv_test` on vulkan. (iree-org#2723) * a3b73bf Add .python-version to .gitignore (iree-org#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (iree-org#2725) * 763dc09 Fix ModelBuilder build (iree-org#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (iree-org#2709) * 91a05ff Merge google -> main (iree-org#2719) * f0307a8 Revert "Merge google -> main" (iree-org#2718) * 77d2f8b Merge google -> main (iree-org#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (iree-org#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (iree-org#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (iree-org#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (iree-org#2536)" (iree-org#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (iree-org#2702) * 48efada Dump input values to a file. (iree-org#2683) * 0fd8a55 Mark shell scripts as executable (iree-org#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (iree-org#2687) * 64e2987 Merge google -> main (iree-org#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (iree-org#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (iree-org#2696) * eec62a1 Remove dylib-llvm-aot tests (iree-org#2694) * 11bd7a0 Fix stdalign include in Android (iree-org#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (iree-org#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (iree-org#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (iree-org#2685) * f2d6649 Bump pybind11 to head. (iree-org#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (iree-org#2686) * 36abdfd [ModelBuilder] Revert spurious path change (iree-org#2684) * c96bbb1 Merge pull request iree-org#2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (iree-org#2577) * 1425737 Fix flatcc target name and binary path (iree-org#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc. PiperOriginRevId: 324296127
GMNGeoffrey
pushed a commit
to GMNGeoffrey/iree
that referenced
this pull request
Aug 3, 2020
* 6c1869b Add license header to linker scripts (iree-org#2724) * 6d32fe8 Updates all e2e tests to use TracedModuleTestCase (iree-org#2736) * 7fea2dd Revert "[android] Ignore adb push status for the executable (iree-org#2627)" (iree-org#2735) * da48d03 Adds a class for tracing module calls and example tests. (iree-org#2660) * d66150d Enables `conv_test` on vulkan. (iree-org#2723) * a3b73bf Add .python-version to .gitignore (iree-org#2727) * 6d2bfd3 Enables passing MobileNet and MobileNetV2 vision tests (iree-org#2725) * 763dc09 Fix ModelBuilder build (iree-org#2726) * 528a86a Update the codegen pipeline example snippets to better demonstrate (iree-org#2709) * 91a05ff Merge google -> main (iree-org#2719) * f0307a8 Revert "Merge google -> main" (iree-org#2718) * 77d2f8b Merge google -> main (iree-org#2711) * aafabbc Add linker scripts to cmake pyiree builds to hide symbols. (iree-org#2707) * 1918d5c Updated gather to run on LLVM and SPIRV (iree-org#2701) * ec38aa0 Add a VM to EmitC conversion and CModule Target (iree-org#2536) * 32fe2c9 Revert "Add a VM to EmitC conversion and CModule Target (iree-org#2536)" (iree-org#2703) * e7f90b6 Revert addition of DYLIB-LLVM-AOT as a default backend (iree-org#2702) * 48efada Dump input values to a file. (iree-org#2683) * 0fd8a55 Mark shell scripts as executable (iree-org#2699) * 966fe78 Add dep "//iree/base:localfile" to iree-run-mlir (iree-org#2687) * 64e2987 Merge google -> main (iree-org#2698) * ced7477 Update scripts for packaging wheels from bazel. * 1c05e0a Disable dylib driver for android build (iree-org#2692) * e00a85f Disable a few gcc warnings that are chatty. * 74af1f0 Add a config for gcc. (iree-org#2696) * eec62a1 Remove dylib-llvm-aot tests (iree-org#2694) * 11bd7a0 Fix stdalign include in Android (iree-org#2688) * b9026bd Enable dylib-llvm-aot backend e2e/xla_op tests (iree-org#2639) * 8ed9f73 Added Complex operation lowerings to pre-target conversion (iree-org#2662) * 8224247 Working around duplicate func->llvm.func rewrites. (iree-org#2685) * f2d6649 Bump pybind11 to head. (iree-org#2592) * 9ac5241 [NFC] Remove empty ArrayRef<NamedAttribute> arg in op creation (iree-org#2686) * 36abdfd [ModelBuilder] Revert spurious path change (iree-org#2684) * c96bbb1 Merge pull request iree-org#2568 from google/benvanik-flatcc-vm * f80864f [ModelBuilder] Add MemRefUtil helpers for padding. (iree-org#2577) * 1425737 Fix flatcc target name and binary path (iree-org#2599) * 8c18b8c Refactoring bytecode_module to use flatcc instead of flatbuffers C++. This imp.. * 3762c13 Linking in the flatcc bytecode_module_def files. This ensures they are correct.. * eb53de3 Building bytecode_module_def with flatcc. PiperOrigin-RevId: 324296127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a part of a larger shift toward integrating our testing infrastructure with generating artifacts for benchmarking. Part of how we are planning to doing this is by tracing the inputs and outputs to our
CompiledModulesduring our tests, and then using those traces as inputs toiree-benchmark-module. The aim is for these traces to tell the benchmark module which (series of) inputs to use, and what outputs to check for while the benchmark is warming up.This change focuses on prototyping what that shift will look like for our testing infra. A class
TracedModuleis added to capture the data described above, and only the functionality that the testing infra needs of it is developed here.Changes:
TracedModulewhich wraps aCompiledModuleto capture the inputs and outputs of its method calls.ModuleCallis used to record this information and cleanly display it.save_plaintextsaves a human readable copy of the trace to disk (example shown below).save_picklewhich saves pickled copies of the inputs and outputs to each call to this module (controlled byFLAGS.pickle_args).CompiledModuleit was passed.CompiledModuleTestCaseis temporarily duplicated asTracedModuleTestCaseto prototype testing usingTracedModules. Other notable differences include:--reference_backendto perform a one-to-many comparisons between backends._check_samethat automatically handles comparing outputs of multiple types.TracedModuleTestCase:simple_arithmetic_traced_test.pyshows generic functionalitystrings_traced_test.pyshows string comparison.lstm_static_traced_test.pyshows that comparison tolerances can be overridden for each call.Example string representations of
TracedModules.