commit | 691ab414b2cfa19d45797e1ff7871d536b4e1bd0 | [log] [tgz] |
---|---|---|
author | bjacob <benoitjacob@google.com> | Mon Nov 14 17:11:52 2022 +0000 |
committer | GitHub <noreply@github.com> | Mon Nov 14 12:11:52 2022 -0500 |
tree | 275e3c1c3b323f39c1a292f750b6d7968f6bf513 | |
parent | c3d72e5d37a1de82b7a5c6a1a8ddd160cde68e3a [diff] |
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 ```
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.
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!
See our website for more information.
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.