Repository navigation
Add static, dynamic and training tests for all tf.keras.layers - #3753
Conversation
c563347 to
6aebfb9
Compare
| 'ZeroPadding3D': [CONV_3D_INPUT], | ||
| } | ||
|
|
||
| LAYER_TO_KWARGS = { |
There was a problem hiding this comment.
Maybe a default_dict to avoid having to list all these ones that just take an empty dict again?
There was a problem hiding this comment.
I decided to use dict() to explicitly document that we weren't modifying any of the layer's settings. It is pretty verbose though. Thoughts?
| if FLAGS.layer == 'MultiHeadAttention': | ||
| outputs = layer_class(**kwargs)(*inputs) |
There was a problem hiding this comment.
:-/ Special-casing this here seems not great
There was a problem hiding this comment.
Yeah, this is a bug in their API :/
There was a problem hiding this comment.
Can you add a link/TODO then? :-)
silvasean
left a comment
There was a problem hiding this comment.
Looks great! Thanks for systematizing this!
| outputs = layer_class(**kwargs)(*inputs) | ||
| else: | ||
| outputs = layer_class(**kwargs)(inputs) | ||
| self.m = tf.keras.Model(inputs, outputs) |
There was a problem hiding this comment.
it is better to create just a layer and then call it as layer.call(inputs, training)
There was a problem hiding this comment.
I tried that first and it was incompatible with IREE (and I think TFLite too).
| # Create a wrapped keras layer. | ||
| inputs = normalize([get_input(shape) for shape in input_shapes]) | ||
| if FLAGS.layer == 'MultiHeadAttention': | ||
| # TODO(meadowlark): Fix this if keras updates their API to be consistent. |
There was a problem hiding this comment.
I meant file a bug with Keras and link it here :-)
The "Tensorflow End to End Coverage" page has grown quite a bit over the past few months, and #3753 exasperated that significantly. This change splits the TensorFlow coverage into four groups: - TensorFlow Base APIs - TensorFlow Keras Layers - Language and Speech Models - Vision Models and stores them under a parent page like "Getting Started". The "tensorflow" column is also removed from the table to reduce visual clutter, as it passes by definition.
* 1ba69d9 Deduplicate flow.executable ops during Flow dialect transformation. (#3702) * 848b893 Seperate tensorflow coverage into multiple pages (#3758) * be8dd02 Merge pull request #3760 from google/benvanik-aot-windows-prework * 6d83db8 Adding support for embedding debug symbols (pdb/dwarf/etc) in dylibs. * 8a1347f Bumping tracy to disable vsync capture and expose the dbghelp lock. * 4dc7064 Improving error messages in iree-run-module with invalid function names. * 4d7805b Optimizations to reduce dispatch overhead. All of these will be fixed with the.. * d57efa3 Making IREE_CHECK_OK not double-evaluate. Prior to this it would run the expre.. * 10b400e Canonicalizing win32 paths prior to trying to open files. Useful in cases wher.. * f9c11f2 [spirv] Use addNestedPass<FuncOp>() for passes working on functions (#3745) * ab4cb7c Add static, dynamic and training tests for all tf.keras.layers (#3753) * aaf3377 Adopt pipeline-in-a-pass infra (#3741) * 43b1d76 Create template for Bug Reports (#3755) * d264a16 Remove unused deps from kws test (#3751) * 0601682 Add 'deep_copy' to bazel to allow variable reuse (#3750) * a70b1d1 Merge google -> main (#3749) COPYBARA_INTEGRATE_REVIEW=#3762 from ScottTodd:main-to-google 1ba69d9 PiperOrigin-RevId: 341484363
* 1ba69d9 Deduplicate flow.executable ops during Flow dialect transformation. (#3702) * 848b893 Seperate tensorflow coverage into multiple pages (#3758) * be8dd02 Merge pull request #3760 from google/benvanik-aot-windows-prework * 6d83db8 Adding support for embedding debug symbols (pdb/dwarf/etc) in dylibs. * 8a1347f Bumping tracy to disable vsync capture and expose the dbghelp lock. * 4dc7064 Improving error messages in iree-run-module with invalid function names. * 4d7805b Optimizations to reduce dispatch overhead. All of these will be fixed with the.. * d57efa3 Making IREE_CHECK_OK not double-evaluate. Prior to this it would run the expre.. * 10b400e Canonicalizing win32 paths prior to trying to open files. Useful in cases wher.. * f9c11f2 [spirv] Use addNestedPass<FuncOp>() for passes working on functions (#3745) * ab4cb7c Add static, dynamic and training tests for all tf.keras.layers (#3753) * aaf3377 Adopt pipeline-in-a-pass infra (#3741) * 43b1d76 Create template for Bug Reports (#3755) * d264a16 Remove unused deps from kws test (#3751) * 0601682 Add 'deep_copy' to bazel to allow variable reuse (#3750) * a70b1d1 Merge google -> main (#3749) COPYBARA_INTEGRATE_REVIEW=#3762 from ScottTodd:main-to-google 1ba69d9 PiperOrigin-RevId: 341484363
Additional changes:
_TfLiteFunctionWrapperlstm_test.pyandlstm_static_test.pyare deleted in favor oflayers_test.py.Currently only settings close to the default for each layer are tested. This could be expanded out in the future in the form of multiple unittests for each
bazeltest.This will clutter the coverage tabe page a fair bit, but I'm planning to restructure those pages soon to address this anyway. The coverage info is also interesting (e.g.
Conv3D/Transposeis failing oniree_vmla, but passing on other IREE backends).This change adds 850 test targets, 478 of which are passing and will run on the CI. They all complete in under 35 seconds on my machine, so the added time from the tests shouldn't be too large.