You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable running of check test files through iree-run-mlir/iree-run-module #1538
Now that everything is in the check test framework it has become impossible to run the files through normal iree-run-mlir:
unable to resolve VM function 'check.expect_eq'
This should work, either by registering the check module or by turning the check ops into no-ops. Debugging is now much more difficult as two tools need to be run instead of one.
The easiest fix is to add a pass/or translation flag to strip check dialect ops entirely.
We also should allow the return of arbitrary values and print them out. Trying to adapt one of these tests right now to run under iree-run-mlir causes it then to not run under iree-check-test. Printing out things is useful in tests (like logging in a gunit test).
I'd like to understand a bit more about the use case here. What's better about iree-run-mlir foo vs iree-translate foo | iree-check-module - or just running the test through the build system? I've never really liked iree-run-mlir: it feels like a frankentool that's trying to do too many different things (and ends up containing a weird stitching together of absl and llvm as a consequence). Or is the complaint that for model examples you use iree-run-mlir (or iree-run-module) but now for unit tests you need a different tool?
Regarding returning from functions, I deliberately made all the test functions void. I think that's standard for test frameworks. At least the ones I've used (across languages) never have the test function returning anything and I'm worried about allowing it because it's not meaningful for the test itself. It seems like what you really want is the ability to print out values, right? Returning them from a function just causes iree-run-mlir to print them. What about just adding an op for it? I think an iree.print op wouldn't be hard to add as part of a custom module. I was expecting that that would be coming out of the strings module by this point, but I think maybe it's taking a more principled approach of actually having string types whereas we could easily take a shortcut and just hardcode how to print buffer views. That said, if you're running it through iree-check-module you should either know what the value is (because there's an expect) or it should be printing out the value (because the expect fails).
changed the title [-]Enable running of check test files through iree-run-mlir[/-][+]Enable running of check test files through iree-run-mlir/iree-run-module[/+]on Nov 22, 2020
Renamed - this isn't about iree-run-mlir specifically but also iree-run-module/iree-benchmark-module. Today the checked in models are unfortunately check tests, meaning that someone can't simply compile and run iree/test/e2e/models/ tests through iree-benchmark-module, for example.
(as part of packaging and deployment we want to be able to provide models that users can use for running, benchmarking, and correctness checking to isolate system issues from their models)
Sounds like #8916 fixed this by turning check ops into no-ops (via optional imports). We could still replace the check module with built-in support for comparisons and asserts though (that's tracked in #5854).
Activity
benvanik commentedon Apr 15, 2020
We also should allow the return of arbitrary values and print them out. Trying to adapt one of these tests right now to run under iree-run-mlir causes it then to not run under iree-check-test. Printing out things is useful in tests (like logging in a gunit test).
GMNGeoffrey commentedon Apr 20, 2020
I'd like to understand a bit more about the use case here. What's better about
iree-run-mlir foovsiree-translate foo | iree-check-module -or just running the test through the build system? I've never really liked iree-run-mlir: it feels like a frankentool that's trying to do too many different things (and ends up containing a weird stitching together of absl and llvm as a consequence). Or is the complaint that for model examples you use iree-run-mlir (or iree-run-module) but now for unit tests you need a different tool?Regarding returning from functions, I deliberately made all the test functions void. I think that's standard for test frameworks. At least the ones I've used (across languages) never have the test function returning anything and I'm worried about allowing it because it's not meaningful for the test itself. It seems like what you really want is the ability to print out values, right? Returning them from a function just causes iree-run-mlir to print them. What about just adding an op for it? I think an
iree.printop wouldn't be hard to add as part of a custom module. I was expecting that that would be coming out of the strings module by this point, but I think maybe it's taking a more principled approach of actually having string types whereas we could easily take a shortcut and just hardcode how to print buffer views. That said, if you're running it through iree-check-module you should either know what the value is (because there's an expect) or it should be printing out the value (because the expect fails).[-]Enable running of check test files through iree-run-mlir[/-][+]Enable running of check test files through iree-run-mlir/iree-run-module[/+]benvanik commentedon Nov 22, 2020
Renamed - this isn't about iree-run-mlir specifically but also iree-run-module/iree-benchmark-module. Today the checked in models are unfortunately check tests, meaning that someone can't simply compile and run iree/test/e2e/models/ tests through iree-benchmark-module, for example.
benvanik commentedon Nov 22, 2020
(as part of packaging and deployment we want to be able to provide models that users can use for running, benchmarking, and correctness checking to isolate system issues from their models)
ScottTodd commentedon Apr 26, 2022
Sounds like #8916 fixed this by turning check ops into no-ops (via optional imports). We could still replace the check module with built-in support for comparisons and asserts though (that's tracked in #5854).