Skip to content

Enable running of check test files through iree-run-mlir/iree-run-module #1538

Closed

Description

@benvanik

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.

Activity

  1. added
    infrastructure
    on Apr 15, 2020
  2. benvanik commented on Apr 15, 2020

    @benvanik
    CollaboratorAuthor

    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).

  3. added this to the Infrastructure Fixit milestone on Apr 15, 2020
  4. GMNGeoffrey commented on Apr 20, 2020

    @GMNGeoffrey
    Member

    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).

  5. 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
  6. benvanik commented on Nov 22, 2020

    @benvanik
    CollaboratorAuthor

    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.

  7. benvanik commented on Nov 22, 2020

    @benvanik
    CollaboratorAuthor

    (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)

  8. self-assigned this
    on Nov 22, 2020
  9. added
    quality of life 😊
    on Nov 23, 2020
  10. ScottTodd commented on Apr 26, 2022

    @ScottTodd
    Member

    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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

infrastructurequality of life 😊

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions