Re: Candidate Linux ABI for Intel AMX and hypothetical new related features
From: Borislav Petkov
Date: Mon Apr 19 2021 - 17:58:20 EST
On Mon, Apr 19, 2021 at 05:33:03PM -0400, Len Brown wrote:
> For this to happen, every thread would not only have to include/link-with
> code that uses AMX, but that code would have to *run*.
It looks like either I'm not expressing myself clearly enough or you're
not reading my text: the *library* does that decision automatically!
Which means *every* possible thread on the system.
Which means, *every* thread has a fat 8K buffer attached to it because
the library uses AMX on its behalf by *default*.
> I'm sure that the AI guys are super excited about matrix multiplication,
> but I have a hard time imagining why grep(1) would find a use for it.
It doesn't matter if you're imagining it or not - what matters is if the
decision whether the thread uses AMX or not is put in the hands of the
thread and *NOT* in the hands of the library.
Which means, majority of the threads should not allow AMX and only a
handful who do, will have to explicitly state that. And the library will
have to comply. Not the library decides for every thread itself because
the feature's there.
> Indeed, if anyone expected AMX to be used by every task, we would have
> never gone to the trouble of inventing the XFD hardware to support the
> kernel's lazy 8KB buffer allocation.
If it gives me fat-buffers-off-by-default and on only for a handful
of threads which really want it and *request* it *explicitly*, sure,
whatever gets the job done.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette