Re: Candidate Linux ABI for Intel AMX and hypothetical new related features
From: Len Brown
Date: Fri Apr 16 2021 - 17:55:00 EST
On Thu, Apr 15, 2021 at 12:24 PM Andy Lutomirski <luto@xxxxxxxxxx> wrote:
> On Wed, Apr 14, 2021 at 2:48 PM Len Brown <lenb@xxxxxxxxxx> wrote:
> > > ... the transition penalty into and out of AMX code
The concept of 'transition' exists between AVX and SSE instructions
because it is possible to mix both instruction sets and touch different
parts of the same registers. The "unused" parts of those registers
need to be tracked to assure that data is not lost when mixing.
This concept is moot with AMX, which has its own dedicated registers.
> What is the actual impact of a trivial function that initializes the
> tile config, does one tiny math op, and then does TILERELEASE?
1. Task takes #NM on first touch of TILE registers
2. Kernel allocates 8KB for that task and dis-arms XFD
3. Kernel context switches XFD with task state
If the task takes a signal *before* TILERELEASE
4. XSAVE transfers AMX state to signal stack, XRESTOR the reverse.
If the task context switches *before* TILERELEASE
5. kernel context switch XSAVES the AMX state to 8KB context switch
buffer, XRESTORE the reverse.
If the task takes a signal *after* TILERELEASE
4. XSAVE does NOT transfer AMX state (or zeros) to signal stack, 8KB
is consumed on signal stack but not touched. XRESTOR, the reverse.
If the task context switches *after* TILERELEASE
5. kernel contexts switch ignores INIT=1 AMX state. 8KB buffer is quiescent.
As we discussed previously, there is no impact to frequency from
either INIT=0 or INIT=1 AMX state.
Frequency is impacted by *compute*, and since there isn't any compute
this scenario, there is no frequency impact.
As we discussed previously, for INIT=1 (which the kernel guarantees,
there is also no impact on power.
thanks,
Len Brown, Intel Open Source Technology Center