Trim e2e matmul tests and share MLIR code across testcases (#7475)

When I wrote these tests, I put great care in ensuring low test run latency. But I didn't think about test compilation latency.

So this PR reduces these build times in two different ways:

1. By commenting out half of the shapes in get_test_shapes. I've retained ~ 50% of the shapes that I believe provide ~ 90% of the coverage. The remaining 10% coverage will only start to matter later when we start to make the matmul implementation do more complicated things, and we can uncomment those shapes then.

2. By ensuring that testcases that test the same exact code (differing only by runtime data) actually share that code already at the source level (without relying on CSE, which might kick in too late to recover the best compilation latency), by changing generate_function_name to generate the same exact name, so that we're sure that we insert only one. There are two sub-cases here:
a. Testcases that differ in dynamic shape dimensions. Before we could have functions foo_2x2(tensor<?x?xf32>) and foo_3x3(tensor<?x?xf32>) doing the same thing, only differing in the dynamic shapes that they are called on. Now it's foo_DYNxDYN(tensor<?x?xf32>).
b. Testcases that differ in the generator of matrix element that they are called with. Before we would have foo_identity(tensor<4x4xf32>) and foo_random(tensor<4x4xf32). Now it's just foo(tensor<4x4xf32>).
Before:

```
$ time cmake --build .
[0/2] Re-checking globbed directories...
[28/28] Generating e2e_matmul_direct_i8_small_dylib-llvm-aot_dylib.vmfb

real	0m56.333s
user	10m24.481s
sys	3m46.072s
```

After:

```
$ time cmake --build .
[0/2] Re-checking globbed directories...
[28/28] Generating e2e_matmul_mmt4d_i8_small_dylib-llvm-aot_dylib.vmfb

real	0m22.573s
user	3m34.928s
sys	1m23.833s
```
1 file changed
tree: 6196882a1d513f9f85f6b8548245b767cc4961e0
  1. .github/
  2. benchmarks/
  3. bindings/
  4. build_tools/
  5. colab/
  6. docs/
  7. experimental/
  8. integrations/
  9. iree/
  10. llvm-external-projects/
  11. scripts/
  12. third_party/
  13. .bazelignore
  14. .bazelrc
  15. .bazelversion
  16. .clang-format
  17. .gitignore
  18. .gitmodules
  19. .style.yapf
  20. .yamllint.yml
  21. AUTHORS
  22. BUILD.bazel
  23. CMakeLists.txt
  24. configure_bazel.py
  25. CONTRIBUTING.md
  26. LICENSE
  27. README.md
  28. SUBMODULE_VERSIONS.txt
  29. 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

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.