commit | d5004947b638d73e77f704efcace04d2ccb7aaf6 | [log] [tgz] |
---|---|---|
author | mariecwhite <mariewhite@google.com> | Fri Feb 23 12:12:51 2024 +1100 |
committer | GitHub <noreply@github.com> | Fri Feb 23 01:12:51 2024 +0000 |
tree | cba4918c722d8e71b0614a4a18058e7364bc845a | |
parent | fb1151a63a8d0c061f8710745aad21186ffce8c6 [diff] |
Add s8s4s32 dotprod microkernel (#16473) Adds `i8 * i4 -> i32` microkernel that uses the `+dotprod` ARM CPU feature. Supports tile sizes `M0xN0xK0`: `1x8x8`, `2x8x8`, `4x8x8`, `8x8x8`. We use `K0=8` since `+dotprod` requires 4 contiguous elements and 2 `i4s` are contained in a single byte (`2x4`). This ukernel significantly departs from the XNNPack [qd8-f32-qc4w-gemm-1x16c4-minmax-neondot.c](https://github.com/google/XNNPACK/blob/master/src/qd8-f32-qc4w-gemm/gen/qd8-f32-qc4w-gemm-1x16c4-minmax-neondot.c) kernel. The XNNPack version packs the LHS so that no de-interleaving is required on load. It also uses different shapes (`1x8 * 8x16 --> 1x16` vs `4x2 * 2x8 --> 4x8`). The int4 shift trick is re-used. Microbenchmark results on Pixel 8 Pro (last four rows): ``` ----------------------------------------------------------------------------------------------------------- Benchmark Time CPU Iterations UserCounters... ----------------------------------------------------------------------------------------------------------- BM_mmt4d_s8s4s32_tile_1x16x2/real_time 0.690 us 0.689 us 1048575 items_per_second=23.735G/s BM_mmt4d_s8s4s32_tile_2x16x2/real_time 0.803 us 0.801 us 1048575 items_per_second=40.8248G/s BM_mmt4d_s8s4s32_tile_4x16x2/real_time 1.68 us 1.68 us 524287 items_per_second=38.9081G/s BM_mmt4d_s8s4s32_tile_1x8x8_dotprod/real_time 0.640 us 0.638 us 1048575 items_per_second=51.185G/s BM_mmt4d_s8s4s32_tile_2x8x8_dotprod/real_time 0.369 us 0.368 us 2097151 items_per_second=177.561G/s BM_mmt4d_s8s4s32_tile_4x8x8_dotprod/real_time 0.540 us 0.539 us 1048575 items_per_second=242.718G/s BM_mmt4d_s8s4s32_tile_8x8x8_dotprod/real_time 0.934 us 0.932 us 1048575 items_per_second=280.543G/s ```
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.