Intel AMX and feature detection

Daniel Lemire daniel at lemire.me
Wed Jun 26 13:05:25 UTC 2024


I have been using the rule of thumb that I only use AVX-512 on systems where AVX-512 VBMI2 is available. I think it would be quite reasonable for Java to adopt the same convention. If someone has a criticism for this rule, I'd really like to hear it.

I understand that you are not flat out disabling 512... you are just setting the 'preferred' setting... I cannot see people getting *too* upset.




On Tue, Jun 25, 2024, at 22:51, John Rose wrote:
> On 25 Jun 2024, at 19:18, Robert Muir wrote:
> 
> > On Tue, Jun 25, 2024 at 10:05 PM John Rose <john.r.rose at oracle.com> wrote:
> >>
> >> On 25 Jun 2024, at 18:51, Robert Muir wrote:
> >>
> >>> Java VM knows the cpu flags and cpu family, but won't give up the
> >>> goods to users like us :)
> >>
> >> I hear you on this, but is the VM really your only hope?
> >>
> >> If you were programming in C wouldn’t you grab some C header
> >> file and ask a function in there somewhere?  And if that’s the
> >> case surely there is a way to spin up a Panama FFM access to
> >> the same API.  Or is that already one of Uwe’s “too hacky”
> >> solutions?
> >
> > Or we could parse /proc/cpuinfo like some other java projects are
> > doing for these issues, but then it only works on linux, and Uwe won't
> > approve!
> >
> > I'm just trying to communicate the struggle to get good performance
> > and still try to be "portable", it is not easy.
> 
> It’s inherently hard given the vagaries of VPUs out there, even
> from a single vendor.  I’m encouraged, frankly amazed, that we have
> as much portability as we do.
> 
> > The vector API could theoretically solve it for us too, maybe by
> > making SPECIES_PREFERRED more fine-grained, rather than just set to
> > "512" for everything. On such machines, for some vector operations,
> > "512" is really not the "preferred" size because it causes bad
> > performance side effects.
> 
> I think we should consider setting the SPECIES_PREFERRED to 256 bits on
> machines that support 512 but are known (somehow) to down-clock when 512
> is used.  That might disappoint a different but smaller set of users.
> Any advice on this?
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20240626/dbe512d9/attachment.htm>


More information about the panama-dev mailing list