Advanced Matrix Extensions


Advanced Matrix Extensions, also known as Intel Advanced Matrix Extensions, are extensions to the x86 instruction set architecture for microprocessors from Intel designed to work on matrices to accelerate artificial intelligence and machine learning workloads. Especially they perform matrix multiplication at the hardware level, making them apt for problems and algorithms that use matrix multiplication as their core.

Extensions

AMX was introduced by Intel in June 2020 and first supported by Intel with the Sapphire Rapids microarchitecture for Xeon servers, released in January 2023. It introduced 2-dimensional registers called tiles upon which accelerators can perform operations. It is intended as an extensible architecture; the first accelerator implemented is called tile matrix multiply unit.
In Intel Architecture Instruction Set Extensions and Future Features revision 46, published in September 2022, a new AMX-FP16 extension was documented. This extension adds support for half-precision floating-point numbers. In revision 48 from March 2023, AMX-COMPLEX was documented, adding support for half-precision floating-point complex numbers. Both extensions are available in the Granite Rapids set of server processors.

Tile matrix multiply unit

TMUL unit supports BF16 and INT8 input types. AMX-FP16 and AMX-COMPLEX also add support for real and complex FP16 numbers. The register file consists of 8 tiles, each with 16 rows of size of 64 bytes. The only supported operation is matrix multiply and accumulate, which is the extension of the fused multiply–add operation for scalar values as applied to matrix operands:
4th Gen Intel Xeon Scalable processor core can perform 2048 INT8 or 1024 BF16 operations per cycle: the maximal input sizes are for and for, where is 64 for INT8 and 32 for BF16. The matrix multiplication requires multiplication and additions, thus performing operations in 16 cycles.

Software support

  • Compiler and assembler support
  • * LLVM 13
  • * GCC 11
  • * GNU Assembler initial support committed on 25 June 2020
  • Operating system support
  • *glibc support for detecting AMX feature in CPUs committed on 25 June 2020
  • *Linux kernel support since version 5.16
  • *VMware vSphere support for AMX in virtual machines released in ESXi version 8.0u1 for VMs using Hardware Version 20