Repository navigation
CTest support for integration tests - #5101
Conversation
|
Note that the BUILD files included here will actually be open-sourced from the google branch in approximately the same form. They're included with this PR for reference. |
| def _normalize_dictionary(dictionary): | ||
| """Wraps every value of dictionary in a list if it isn't one already.""" | ||
| for key, value in dictionary.items(): | ||
| if type(value) != type([]): |
There was a problem hiding this comment.
not isinstance(value, list)
There was a problem hiding this comment.
These are directly copied from Starlark, so have some Starlark-oddities. Since it was copy-paste, I figured it wasn't worth updating unless they would actually cause an issue.
|
If i were doing this, I probably would have done the expansion to individual tests in the bazel_to_cmake side vs materializing the cartesian product macro and then implementing it in cmake. It'd be less layering of weird list munging and less cmake code. |
Yeah I looked at that as well and it certainly would've been easier. Scott voted strongly against additional logic in Bazel->CMake so I tried to maintain that (although I was not ultimately totally successful at representing a list of dicts of lists in CMake...) |
I'm not going to push either way - what you have works. Maybe get Scott to look at how this turned out and see if he feels the balance is worth the extra complexity. I'd evaluate this as: let's say we dropped bazel compatibility tomorrow. Would what we emit to the cmake files be what we want to edit and own thing forward. I would argue that the discrete tests are what we want and not a super complicated macro. |
I don't disagree with any of that :-) Let's see how Scott feels. Edit: Although I also think "Bazel->CMake is purely mechanical" is also a good line to draw. I see it as similar to me preferring additional build system complexity to Copybara complexity. The build system is at least an established tool that has documentation and such whereas Bazel->CMake is just our special custom thing. And having to reason about what something would look like after being transformed means you have to apply the transformations in your head. That said, iterating on Bazel->CMake is about 1000 times easier than Copybara, so I wouldn't mind doing the matrix expansion there, where it would also be much easier to do. |
|
There are a few failing tests here that don't fail for me locally: My best guess would be that those are because of tf-nightly version (I just updated mine today to fix some other failing tests). My inclination would be to disable them for now and then go back and update tf-nightly. We need to do a pass through all the passing/failing configuration anyway as it hasn't been updated for months and more things should work now |
ScottTodd
left a comment
There was a problem hiding this comment.
If i were doing this, I probably would have done the expansion to individual tests in the bazel_to_cmake side vs materializing the cartesian product macro and then implementing it in cmake. It'd be less layering of weird list munging and less cmake code.
Yeah I looked at that as well and it certainly would've been easier. Scott voted strongly against additional logic in Bazel->CMake so I tried to maintain that (although I was not ultimately totally successful at representing a list of dicts of lists in CMake...)
I'm not going to push either way - what you have works. Maybe get Scott to look at how this turned out and see if he feels the balance is worth the extra complexity.
I'd evaluate this as: let's say we dropped bazel compatibility tomorrow. Would what we emit to the cmake files be what we want to edit and own thing forward. I would argue that the discrete tests are what we want and not a super complicated macro.I don't disagree with any of that :-) Let's see how Scott feels.
Edit: Although I also think "Bazel->CMake is purely mechanical" is also a good line to draw. I see it as similar to me preferring additional build system complexity to Copybara complexity. The build system is at least an established tool that has documentation and such whereas Bazel->CMake is just our special custom thing. And having to reason about what something would look like after being transformed means you have to apply the transformations in your head. That said, iterating on Bazel->CMake is about 1000 times easier than Copybara, so I wouldn't mind doing the matrix expansion there, where it would also be much easier to do.
+1 to "what you have works". I'm not particularly happy with either approach here, but agree that getting the test coverage back is a higher priority than designing and building out a setup we're all satisfied with.
I also like Stella's point about discrete tests over complicated macros. The question is then: how do we author (tool-assisted generation or by hand) those discrete tests? I have some nebulous thoughts about using python to expand from python, .txt, or .csv -> cmake targets (python + python -> cmake is basically what we have here with bazel+bazel_to_cmake->cmake). I think any approach we take needs to start with what we actually want to test, in the test files. Any complexity we let leak out into the build system is going to get messy.
| "guitar" | ||
| "manual" | ||
| "nokokoro" | ||
| "notap" |
There was a problem hiding this comment.
Any plans to run these sorts of large tests (including the non-hermetic ones) periodically on open source CI?
There was a problem hiding this comment.
especially as IREE gets faster this would probably be a good idea. since these tests (and especially the model tests) end up testing a lot of the same things, one of them not running due to a network or other non-hermetic failure tends to be okay. so we could get around the (rare) possibility of failure at expected flaky points by providing no status (or no status in cmake, and failure in bazel since bazel might re-run the test?).
There was a problem hiding this comment.
No specific plans, but it seems like a good idea.
There was a problem hiding this comment.
Yeah my main complaint is flakiness that causes spammy failure notifications. Don't want to add yet another source of flakiness to the things the build cop has to monitor.
| return _convert_string_list_block(list_name, targets, sort=True, quote=False) | ||
|
|
||
|
|
||
| # Copied from integrations/tensorflow/e2e/iree_e2e_cartesian_product_test_suite.bzl |
There was a problem hiding this comment.
I don't think this comment is useful to keep in bazel_to_cmake. The function stands on its own without that context (which isn't sufficient on its own to explain why it exists, and will be outdated if that file is moved/removed).
There was a problem hiding this comment.
Well except that the function has Starlark weirdness, as Stella commented on :-D. If the file is moved/removed, then someone should update references to it and it will still be in the git history.
There was a problem hiding this comment.
Yeah, just trying to keep the conversion as generic as possible. Something referencing tensorflow integration tests is particularly not generic :P
There was a problem hiding this comment.
The whole function implemented below is also defined in integrations/tensorflow/e2e/iree_e2e_cartesian_product_test_suite.bzl though...
There was a problem hiding this comment.
The following tests FAILED:
1300 - integrations/tensorflow/e2e/keras/layers/layers_full_api_tests__layers__tflite__layer__Conv2DTranspose (Failed)
1304 - integrations/tensorflow/e2e/keras/layers/layers_full_api_tests__layers__tflite__layer__MaxPool1D (Failed)
1485 - integrations/tensorflow/e2e/keras/layers/layers_dynamic_dims_tests__layers__iree_vmla__layer__BatchNormalization (Failed)
1547 - integrations/tensorflow/e2e/keras/layers/layers_training_tests__layers__iree_vmla__layer__BatchNormalization (Failed)
1548 - integrations/tensorflow/e2e/keras/layers/layers_training_tests__layers__iree_llvmaot__layer__BatchNormalization (Failed)
1549 - integrations/tensorflow/e2e/keras/layers/layers_training_tests__layers__iree_vulkan__layer__BatchNormalization (Failed)
1747 - integrations/tensorflow/e2e/math/math_tests__math__tflite__functions__xdivy (Failed)
1748 - integrations/tensorflow/e2e/math/math_tests__math__tflite__functions__xlogy (Failed)
(logs)
change which tests are enabled? (may need to sync the change, if google and main disagree on which tests pass where)
Yeah see my comment about this above. I'm guessing this has to do with the tf-nightly version. I'm waiting for google->main with the exported build files to merge in those and finalize this. |
In #5101 I accidentally removed bindings/python tests from the CI because I assumed that they would be covered not in the integrations build. It turns out that we have tests depending on the TF integrations living under bindings/python (gross. #5181). So when #5104 moved MHLO tuple and control flow legalization out of core, we didn't catch the test failure for JAX. This adds passes to convert from MHLO as produced by XLA->MHLO translation to the form accepted by IREE. As we move more towards making linalg on tensors our input and push more MHLO out of IREE core the pipeline here will likely grow.
Add CTest support for integration tests. This is our interim solution
for integration testing support while we find a long-term solution. It
results from tests that were previously Bazel-only (because TF) and now
are CMake-only (because maintaining support for Python in Bazel was
determined to be not worth the effort).
The approach is to open-source our internal BUILD files for Blaze
(Google's internal version of Bazel, which happens to do some rather
different things with Python). These rely on a Starlark rule for
expanding a test matrix that is pretty painful to implement in CMake.
The author apologizes.
This enables 1317 new test targets.
Incidentally, it makes the tests run in parallel, which should speed
things up quite a bit...