Intel Posts Newest Advanced Matrix Extensions Patches For Linux (AMX Patches v7)
For over one year now since Advanced Matrix Extensions (AMX) was first disclosed as a future feature with Xeon "Sapphire Rapids", Intel engineers have been posting AMX patches for enabling the new support for changes needed from the kernel to code compiler stacks. The Linux kernel support for AMX hasn't yet landed but has now been revised its seventh time for public review.
Sent out on Saturday by Intel was their latest set of 26 patches for supporting Advanced Matrix Extensions in the kernel. Kernel changes for AMX are needed around the software stack management with on-demand expansion of per-task context switch buffers using XSAVE, ensuring AMX isn't running simultaneously on SMT siblings, and a new system call is introduced so applications can request access to AMX usage. The system call (an arch_prctl flag) for requesting AMX access is done to signal the application is responsible for using an alternative signal stack and that the stack is large enough, which can be easily accomplished using the modern Glibc ABI. Trying to make use of AMX on Linux without proper permissions from the system call will result in the process exiting.
This seventh spin of the Linux kernel patches for Intel AMX add a new state bitmap parameter to the system call as well as a new system call to return the permission 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 on the LKML. Given the timing it's too late to possibly see for the ongoing 5.14 merge window but we'll see if it manages to get squared away for the 5.15 cycle later this year... At least with Intel not ramping Sapphire Rapids until Q2'22 there still is more time to get the Linux support for AMX squared away before the processors are shipping.
Sent out on Saturday by Intel was their latest set of 26 patches for supporting Advanced Matrix Extensions in the kernel. Kernel changes for AMX are needed around the software stack management with on-demand expansion of per-task context switch buffers using XSAVE, ensuring AMX isn't running simultaneously on SMT siblings, and a new system call is introduced so applications can request access to AMX usage. The system call (an arch_prctl flag) for requesting AMX access is done to signal the application is responsible for using an alternative signal stack and that the stack is large enough, which can be easily accomplished using the modern Glibc ABI. Trying to make use of AMX on Linux without proper permissions from the system call will result in the process exiting.
This seventh spin of the Linux kernel patches for Intel AMX add a new state bitmap parameter to the system call as well as a new system call to return the permission 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 on the LKML. Given the timing it's too late to possibly see for the ongoing 5.14 merge window but we'll see if it manages to get squared away for the 5.15 cycle later this year... At least with Intel not ramping Sapphire Rapids until Q2'22 there still is more time to get the Linux support for AMX squared away before the processors are shipping.
6 Comments