pack ukernel: optimized ARM64 code, benchmark,+refactorings (#11134)

Brings a decently optimized ARM64 implementation of the `iree_uk_pack`
microkernel.

It's not super optimized --- not even any assembly code. Just some C
with intrinsics, aiming at a trade-off with simplicity,
generalizability, code size. We even have a naive for loop
`iree_uk_memcpy`, which thanks to `restrict` the compiler is able to
lift to a true `memcpy` while preserving compile-time memcpy size, and
in some cases we just use that.

Another thought tilting us towards C is instrumentability: pack is the
kind of place that's potentially relevant to sanitize (asan, tsan...) so
it's kind of interesting to keep it in C.

The PR is made bigger because this was another instance where
generalizing from having 1 microkernel (mmt4d) to more than 1, required
some groundwork.

[Performance
charts](https://docs.google.com/spreadsheets/d/1hK39a9snA_P_e0nXKFyUw-hTtOmp3t2qdEUcK_kFZ64/edit?usp=sharing&resourcekey=0-hQznpmTatcIsl80mONdfmQ)
. Some cases are fairly close to memcpy, other cases are 1 order of
magnitude slower. Still probably good enough to not dominate profiles
(by contrast, naive for loops before optimization could be 2 to 3 orders
of magnitude slower than memcpy, and that was more clearly a problem).

Code size on ARM64, release: total 3104 bytes.

```
0000000000000924 t iree_uk_pack
0000000000000004 t iree_uk_pack_select_tile_func_arch
0000000000000220 t iree_uk_pack_select_tile_func_arm_64
0000000000000032 t iree_uk_pack_select_tile_func_generic
0000000000000260 t iree_uk_pack_tile_8x1_x32_arm_64_direct
0000000000000036 t iree_uk_pack_tile_8x1_x32_arm_64_transpose
0000000000000372 t iree_uk_pack_tile_8x1_x8_arm_64_direct
0000000000000136 t iree_uk_pack_tile_8x1_x8_arm_64_transpose
0000000000000248 t iree_uk_pack_tile_8x4_x8_arm_64_direct
0000000000000080 t iree_uk_pack_tile_8x4_x8_arm_64_transpose
0000000000000104 t iree_uk_pack_tile_8x8_x8_arm_64_direct
0000000000000196 t iree_uk_pack_tile_8x8_x8_arm_64_transpose
0000000000000212 t iree_uk_pack_tile_generic_direct
0000000000000280 t iree_uk_pack_tile_generic_transpose
```
35 files changed
tree: 275e3c1c3b323f39c1a292f750b6d7968f6bf513
  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. .dockerignore
  19. .gitignore
  20. .gitmodules
  21. .pylintrc
  22. .style.yapf
  23. .yamllint.yml
  24. AUTHORS
  25. BUILD.bazel
  26. CITATION.cff
  27. CMakeLists.txt
  28. configure_bazel.py
  29. CONTRIBUTING.md
  30. LICENSE
  31. README.md
  32. 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.

CI Status

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.

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.