For over a year now that Advanced Matrix Extensions (AMX) was first leaked as a future feature with Xeon “Sapphire Rapids”, Intel engineers have released AMX patches to enable the new support necessary kernel changes to code compiler stacks. Linux kernel support for AMX has yet to land but has now been revised for the seventh time for public review.
Intel sent out its latest set of 26 patches for Advanced Matrix extension support in the kernel on Saturday. Kernel changes for AMX are needed around software stack management with on-demand extension of per-task context switching buffers using XSAVE, ensuring that AMX does not run concurrently on siblings and SMT siblings, and a new system call is introduced so applications can request access to AMX Usage. The system call (an arch_prctl flag) to request AMX access is made to signal that the application is responsible for using an alternate signal stack and that the stack is large enough, which can be easily accomplished using the modern Glibc ABI. Attempting to use AMX on Linux without the proper system call permissions will cause the process to terminate.
This seventh rotation of Linux kernel patches for Intel AMX adds a new state bitmap parameter to the system call as well as a new system call to return the authorization bitmap. There are also other permission updates, simplifying the XSTATE size calculation code, and updated code comments.
These latest AMX kernel patches can be found at the LKML. Given the timing, it’s too late to possibly see the 5.14 merge window in progress, but we’ll see if it manages to square up for the 5.15 cycle later this year… At least with Intel not will not increase Sapphire Rapids until Q2’22 there There is still more time to get Linux support for AMX squared before processors ship.