Add test runner page and associated scripting for the web. (#9238)

This adds a test runner webpage and associated scripting for building IREE's runtime tests with Emscripten.

<img src="https://user-images.githubusercontent.com/4010439/170773583-c2002dd9-de4f-459a-b1e8-68e9c1eaecd8.png" width="500">

How this works:
* Our tests (and benchmarks) generate binary files that when executed run tests then return an exit code
* When compiling for the web using Emscripten, each binary target produces a `.js` and a `.wasm` file (and optionally a `.wasm.debug.wasm` and other debugging artifacts)
* Running an Emscripten-produced binary on a webpage requires just defining the `Module` object and importing the `.js`

---

Up until this point, I've been building a very narrow list of targets with the Emscripten toolchain. Now that I'm building all runtime tests, I had to disable more targets that aren't compatible with Emscripten - namely `hal/local/elf/` and `executable_library_benchmark` (which uses the embedded elf loader). I'd prefer to not sprinkle branches into our CMake files, but that will need some deeper, and IMO overdue :), refactoring to how executable loaders are built and registered.

---

Ideas for future improvements:

* Test index page that lists all targets, sorted by package, and lets you run individual tests, package test suites, or all tests
  * `ctest --show-only=json-v1` can give useful metadata for generating such a page
* ctest integration ([here is a good reference](https://www.stevenengelhardt.com/2018/04/17/unit-testing-emscripten-library-in-browser-using-cmake-and-nightwatch-js/))
* Threading / event loop / other flag tweaks to get more tests passing and exercising browser features
14 files changed
tree: 7644474f90877d816ae2efc6a6c7c431bb2556e3
  1. .github/
  2. benchmarks/
  3. build_tools/
  4. compiler/
  5. docs/
  6. experimental/
  7. integrations/
  8. llvm-external-projects/
  9. runtime/
  10. samples/
  11. tests/
  12. third_party/
  13. tools/
  14. .bazelignore
  15. .bazelrc
  16. .bazelversion
  17. .clang-format
  18. .gitignore
  19. .gitmodules
  20. .pylintrc
  21. .style.yapf
  22. .yamllint.yml
  23. AUTHORS
  24. BUILD.bazel
  25. CMakeLists.txt
  26. configure_bazel.py
  27. CONTRIBUTING.md
  28. LICENSE
  29. README.md
  30. WORKSPACE
README.md

IREE: Intermediate Representation Execution Environment

IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.

See our website for project details, user guides, and instructions on building from source.

Project Status

IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!

Communication Channels

Related Project Channels

  • MLIR topic within LLVM Discourse: IREE is enabled by and heavily relies on MLIR. IREE sometimes is referred to in certain MLIR discussions. Useful if you are also interested in MLIR evolution.

Build Status

CI SystemBuild SystemPlatformArchitectureConfiguration / ComponentStatus
KokoroBazelLinuxx86-64kokoro status bazel/linux/x86-swiftshader/core
KokoroCMake & BazelLinuxx86-64 (swiftshader)Integrationskokoro status cmake-bazel/linux/x86-swiftshader
KokoroCMake & BazelLinuxx86-64 (turing)Integrationskokoro status cmake-bazel/linux/x86-turing
KokoroCMakeLinuxx86-64 (swiftshader)kokoro status cmake/linux/x86-swiftshader
KokoroCMakeLinuxx86-64 (swiftshader)asankokoro status cmake/linux/x86-swiftshader-asan
KokoroCMakeLinuxx86-64 (turing)kokoro status cmake/linux/x86-turing
KokoroCMakeAndroidarm64-v8aRuntime (build only)kokoro status cmake/android/arm64-v8a
KokoroCMakeBare Metalrisc-v-32Runtimekokoro status cmake/baremetal/riscv32
KokoroCMakeLinuxrisc-v-64Runtimekokoro status cmake/linux/riscv64
BuildkiteCMakeAndroidarm64-v8aRuntimebuildkite status iree-android-arm64-v8a
BuildKiteCMakeAndroidarm64-v8aRuntime Benchmarksbuildkite status iree-benchmark
BuildKiteCMakeLinuxx86-64Tracing + Standalone Runtimebuildkite status iree-build-configurations

Architecture Overview

IREE Architecture IREE Architecture

See our website for more information.

Presentations and Talks

  • 2021-06-09: IREE Runtime Design Tech Talk (recording and slides)
  • 2020-08-20: IREE CodeGen: MLIR Open Design Meeting Presentation (recording and slides)
  • 2020-03-18: Interactive HAL IR Walkthrough (recording)
  • 2020-01-31: End-to-end MLIR Workflow in IREE: MLIR Open Design Meeting Presentation (recording and slides)

License

IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.