Alder Lake and AVX-512

By: Linus Torvalds (torvalds.delete@this.linux-foundation.org),
Room: Moderated Discussions
Geoff Langdale (geoff.langdale.delete@this.gmail.com) on July 11, 2020 11:45 pm wrote:
>
> It's not clear to me whether you view AVX2 in the same light, btw - what do you think
> of AVX2 circa 2020?

No honestly, I'm not a huge fan of AVX2 either. But then. wasn't a huge fan of MMX or the original AVX. And no, before you ask, it's not like I hold up the original i387 FPU as some shining example either ;)

None of them are what you would call anything like remotely clean, and none of them were ever designed to be sanely extensible, nor were any of them ever designed to be able to be used independently of each other.

You get the worst of both worlds.

Just for an example of that "independently" issue: there are a ton of loads that could have used the original MMX instructions, but because it perturbs the state of the previous FPU side, you couldn't actually do that. It was an all-or-nothing change, and it hurt people. Badly.

It's not even about the mixed code case (although that famously happened too), it's about the "occasional use". There are lots of situations where you might want to have a small helper, and it would make sense to use a single vector register or two, and you do a couple of ops, and you save/restore only those registers.

And that fundamentally has never worked in the Intel world, because of the state dirtying. Using MME/SSE dirties the FPU state even if you're careful and try to save/restore things, so you were supposed to do a full state save and init and restore. So any "I could use this in a tiny" way helper functions were completely doomed.

(And by "completely doomed", I mean that some people did it anyway, and it mostly worked, I think).

Now, that said, do I hate MMX/SSE/AVX/AVX2 with the same burning passion as AVX512? No. Because there's a big difference between them.

MMX/SSE was a first-attempt (plus fixes). The i387 was a particularly nasty thing to be compatible with anyway, it's entirely understandable why it was done the way it was done. In hindsight, maybe it could have been done better, but a "in hindsight" argument is always complete BS. So that's not a valid argument. MMX/SSE was fine.

AVX/AVX2 were reasonable cleanups and honestly, I don't think 256 bits is a huge pain even as a baseline. And Intel has been good about keeping AVX always there. Afaik, new CPU's really have gotten AVX reliably. So it hasn't been a fragmentation issue, and while I think it has the same state dirtying issue ("helper function using MMX instructions and saves/restores the instructions it modifies will be clearing upper bits in AVX registers and trashing state"), I think it was a fairly reasonable extension.

So again, AVX/AVX2 was fine. Was it "lovely"? No. But I think it's a reasonable baseline.

So what's different with AVX512?

One fundamental difference is that fragmentation issue. It came up before AVX512 was even out, with the failed multi-core Knights atoms having a completely different versions. But it's really been obvious lately, with even today, in CPU's being sold, it being a "marketing feature".

But the other - and to me really annoying - fundamental issue is "by now, you should have damn well have learnt from your mistakes".

Here, look at the real competition for Intel and x86 long-term: ARM. They had an equally disgusting and horrendously bad FPU situation originally. Yes, their FPU situation was differently bad from the i387, but the whole soft-FP vs VFP vs random other implementations was arguably worse than Intel ever had, even if at the time, you would find the usual ARM fanbois that made excuses for just how horrendous the situation was.

But then ARM got their act together, and NEON happened. I'd say that was roughly the equivalent to SSE, because I'll call the original mess of nasty shit comparable to the nofp/i387/IBM-mis-wiring-the-exception-pin/MMX era. The timing may not line up, but with NEON, ARM at least had gotten rid of their messy lack of standards, and I think it's fair to compare it to Intel and SSE conceptually.

So ARM did SVE, and I'll call that their AVX/AVX2. But now you see signs of differences. Part of it is just the name. "S" for "Scalable". ARM is starting to do something interesting and fundamentally different from what AVX was for Intel.

And then ARM designed SVE2, and again, let's see how it actually plays out in real life, but I think it has the potential to be their "AVX512 done right". And they designed it to have a reasonable downgrade/upgrade path, to be extensible, to do that masking and memory accesses etc that is so important for compilers to auto-parallelize.

Honestly, if I were into HPC and vectorization, I'd be all in on the ARM bandwagon.

As it happens, I'm not into HPC and vectorization, and it's possible that exactly because I'm not into it, I'm missing why SVE2 has some horrible problems. And I realize that AVX512 does some things that a very very very small minority of people care deeply about (I don't know why, but some people really love the shuffle instructions and will put up with absolutely anything if they get them).

So just as a bystander, I'm looking at AVX512, and I'm looking at SVE2, and I'm going "AVX512 really is nasty, isn't it"?

And by now it's the third big generation, and the "it wasn't clear what the right answer was" is no longer an excuse for doing things wrong. People knew that scaling up and down the CPU stack was an issue. This wasn't something where Intel couldn't have seen it coming - when Intel was designing AVX512, Intel was still trying to also enter the smartphone and IoT area.

Have I sufficiently explained why I absolutely despise AVX512?

And yes, maybe in five years, AVX512 is there everywhere and my fragmentation argument goes away.

Buy maybe in five years, SVE2 is everywhere too, and is happily working in cellphones and in supercomputers, and I think I won't be the only person in the room that says "AVX512 is a butt-ugly disgrace".

We'll see, even if it might take years. I'm happy to be proven wrong.

And I'm here for the heated technical discussion anyway. Tell me why I'm a pinhead and a nincompoop, and why SVE2 is so bad, and why AVX512 is clearly better.

Because this forum is about architecture design and implementation, isn't it? So I think it's very fair to put down that gauntlet: AVX512 vs SVE2. "Gong plays" - FIGHT!

Linus
< Previous Post in ThreadNext Post in Thread >
Thread (327 posts)
TopicPosted ByPosted
Alder Lake and AVX-512me
  Alder Lake and AVX-512Linus Torvalds
    informative (NT)blue
    grumpyMichael S
      grumpyme
    area and power cost of AVX-512Michael S
      area and power cost of AVX-512Anon
        area and power cost of AVX-512Michael S
          area and power cost of AVX-512Travis Downs
      area and power cost of AVX-512Travis Downs
    Alder Lake and AVX-512Maynard Handley
      Alder Lake and AVX-512Ungo
        Alder Lake and AVX-512Maynard Handley
      Alder Lake and AVX-512Linus Torvalds
        Alder Lake and AVX-512
          Alder Lake and AVX-512Michael S
          HDRAnon3
            HDR10 in Kaby Lake?David Kanter
              HDR10 in Kaby Lake?Maynard Handley
                Thanks for the link (NT)David Kanter
              HDR10 in Kaby Lake?Anon3
        Alder Lake and AVX-512Dummond D. Slow
        AVX-512 with narrow ex units?m
          AVX-512 with narrow ex units?Anon
            AVX-512 with narrow ex units?Paul A. Clayton
              AVX-512 with narrow ex units?Anon
                AVX-512 with narrow ex units?Paul A. Clayton
                  AVX-512 with narrow ex units?Anon
                    AVX-512 with narrow ex units?Jukka Larja
                      AVX-512 with narrow ex units?Gabriele Svelto
                        AVX-512 with narrow ex units?Jouni Osmala
                          AVX-512 with narrow ex units?Jukka Larja
                      AVX-512 with narrow ex units?Eugene Nalimov
                        AVX-512 with narrow ex units?Jukka Larja
                        AVX-512 with narrow ex units?Gabriele Svelto
                          AVX-512 with narrow ex units?Jukka Larja
          AVX-512 with narrow ex units?-.-
            AVX-512 with narrow ex units?Travis Downs
    Alder Lake and AVX-512Jörn Engel
      Alder Lake and AVX-512Chester
        Alder Lake and AVX-512Jörn Engel
        Alder Lake and AVX-512Michael S
        Alder Lake and AVX-512Travis Downs
      Alder Lake and AVX-512Linus Torvalds
        Alder Lake and AVX-512Jörn Engel
          Alder Lake and AVX-512N Owen
            Alder Lake and AVX-512Michael S
            Alder Lake and AVX-512anon2
          Alder Lake and AVX-512Travis Downs
            Alder Lake and AVX-512Jörn Engel
      Alder Lake and AVX-512Doug S
        Alder Lake and AVX-512Michael S
    Alder Lake and AVX-512Travis Downs
      Alder Lake and AVX-512Veedrac
        Alder Lake and AVX-512anon2
          Alder Lake and AVX-512Veedrac
            Alder Lake and AVX-512anon2
              Alder Lake and AVX-512Anon3
                Alder Lake and AVX-512anon2
              Alder Lake and AVX-512Veedrac
                Alder Lake and AVX-512anon2
                  Alder Lake and AVX-512Veedrac
                    Alder Lake and AVX-512anon2
                  Alder Lake and AVX-512David Hess
                    Alder Lake and AVX-512anon2
                Alder Lake and AVX-512
                  Alder Lake and AVX-512anon2
                    PentiumMMX vs Transmeta's VLIW in hindsight
                      PentiumMMX vs Transmeta's VLIW in hindsightMaynard Handley
                      PentiumMMX vs Transmeta's VLIW in hindsightanon2
                      VLIW, OOO, Pairing, and FusionChester
                        Poulson was in-order (NT)anon2
                        VLIW, OOO, Pairing, and FusionMichael S
                        Itanium is NOT VLIWHeikki Kultala
                          Itanium is NOT VLIWAdrian
                            Itanium crappiness and EPIC - and could EPIC still have something good in it?Heikki Kultala
                              Itanium crappiness and EPIC - and could EPIC still have something good in it?anon2
                                Itanium crappiness and EPIC - and could EPIC still have something good in it?dmcq
                              Itanium crappiness and EPIC - and could EPIC still have something good in it?j
                                Itanium crappiness and EPIC - and could EPIC still have something good in it?Tim McCaffrey
                              Itanium crappiness and EPIC - and could EPIC still have something good in it?Linus Torvalds
                                Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureHeikki Kultala
                                  Turn that on its head?Ray
                                    Turn that on its head?Anon
                                    Turn that on its head?Maynard Handley
                                    Turn that on its head?anon2
                                    Turn that on its head?anon3
                                    Turn that on its head?Heikki Kultala
                                      Turn that on its head?Anon
                                        Turn that on its head?Heikki Kultala
                                          Turn that on its head?Brett
                                            Turn that on its head?Brett
                                      Bundling OOO entries does this implicitlyDavid Kanter
                                      Turn that on its head?anon
                                  Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureMaynard Handley
                                  Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architecturewumpus
                                    Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureDoug S
                                      what Intel would have doneMichael S
                                        what Intel would have doneDoug S
                                        what Intel would have doneAnon
                                          what Intel would have doneMichael S
                                            what Intel would have doneMontaray Jack
                                    Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureHeikki Kultala
                                      Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architecturewumpus
                                  Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureMichael S
                                    Itanium is not synomym of EPIC. Itanium is just the most common EPIC-style architectureHeikki Kultala
                          thanksChester
      Alder Lake and AVX-512Linus Torvalds
        Alder Lake and AVX-512never_released
          Alder Lake and AVX-512Michael S
        Alder Lake and AVX-512anon2
      Alder Lake and AVX-512Doug S
      Alder Lake and AVX-512Michael S
        Alder Lake and AVX-512rwessel
      Alder Lake and AVX-512-.-
        Alder Lake and AVX-512Travis Downs
    Alder Lake and AVX-512Geoff Langdale
      Alder Lake and AVX-512anon
      Alder Lake and AVX-512Jörn Engel
        Alder Lake and AVX-512Michael S
        Alder Lake and AVX-512Jukka Larja
          Alder Lake and AVX-512Maynard Handley
            Alder Lake and AVX-512Jukka Larja
              Alder Lake and AVX-512Montaray Jack
                Alder Lake and AVX-512Jukka Larja
          Alder Lake and AVX-512Jörn Engel
            Alder Lake and AVX-512Linus Torvalds
              Alder Lake and AVX-512Linus Torvalds
                Alder Lake and AVX-512anonymou5
                  Alder Lake and AVX-512Linus Torvalds
                    Alder Lake and AVX-512anonymou5
                      Alder Lake and AVX-512Linus Torvalds
                        Alder Lake and AVX-512anonymou5
                          Alder Lake and AVX-512Jose
                  Alder Lake and AVX-512gallier2
                Alder Lake and AVX-512gallier2
                  Alder Lake and AVX-512Linus Torvalds
                    Alder Lake and AVX-512Doug S
                      Alder Lake and AVX-512Brett
                        Alder Lake and AVX-512Linus Torvalds
                          Alder Lake and AVX-512Maynard Handley
                            Alder Lake and AVX-512Michael S
                            Alder Lake and AVX-512Linus Torvalds
                              OS X file names normalizationMichael S
                                OS X file names normalizationSimon Farnsworth
                                  OS X file names normalizationMichael S
                                    OS X file names normalizationSimon Farnsworth
                                OS X file names normalizationDoug S
                                  OS X file names normalizationMichael S
                                    OS X file names normalizationLinus Torvalds
                                      OS X file names normalizationLinus Torvalds
                                      OS X file names normalizationgallier2
                                    OS X file names normalizationgallier2
                                  OS X file names normalizationRob Thorpe
                                    OS X file names normalizationDoug S
                                      OS X file names normalizationMaynard Handley
                                        OS X file names normalizationLinus Torvalds
                                          OS X file names normalizationAnon3
                                            OS X file names normalizationDoug S
                                              OS X file names normalizationLinus Torvalds
                                                OS X file names normalizationAnon3
                                                  OS X file names normalizationJukka Larja
                                                OS X file names normalizationgallier2
                                                  OS X file names normalizationLinus Torvalds
                                                    OS X file names normalizationDummond D. Slow
                                                      OS X file names normalizationLinus Torvalds
                                                      OS X file names normalizationSimon Farnsworth
                                              OS X file names normalizationAnon3
                                                OS X file names normalizationDoug S
                              Alder Lake and AVX-512Maynard Handley
                            File Systems and VC ProblemsRob Thorpe
                    vectorization of utf8Robert David Graham
                      vectorization of utf8anon2
                        vectorization of utf8Robert David Graham
                          vectorization of utf8anon2
                        vectorization of utf8Maynard Handley
                      vectorization of utf8Gabriele Svelto
                    Alder Lake and AVX-512gallier2
              Alder Lake and AVX-512Jörn Engel
                Alder Lake and AVX-512Linus Torvalds
                  Alder Lake and AVX-512Jörn Engel
                    Alder Lake and AVX-512-.-
                      Alder Lake and AVX-512Jörn Engel
            Alder Lake and AVX-512Jukka Larja
              Alder Lake and AVX-512Jörn Engel
                Alder Lake and AVX-512Michael S
                  Alder Lake and AVX-512Jörn Engel
                    Alder Lake and AVX-512Michael S
                      Alder Lake and AVX-512Jörn Engel
                Alder Lake and AVX-512Jukka Larja
      Alder Lake and AVX-512Linus Torvalds
        Alder Lake and AVX-512Brett
          Alder Lake and AVX-512David Hess
            Alder Lake and AVX-512anonymou5
              Alder Lake and AVX-512Brett
        Alder Lake and AVX-512Geert
          AMD's FPUChester
            Is 3|5 lower than 4?Michael S
              Is 3|5 lower than 4?Chester
        Alder Lake and AVX-512Geoff Langdale
          Alder Lake and AVX-512me
          Alder Lake and AVX-512Michael S
          Alder Lake and AVX-512Linus Torvalds
            ~80% of details are wrong. So what one can expect from conclusions? :( (NT)Michael S
              ~80% of details are wrong. So what one can expect from conclusions? :(anonymous2
            Alder Lake and AVX-512nobody in particular
              Alder Lake and AVX-512Linus Torvalds
                Alder Lake and AVX-512nobody in particular
                  Alder Lake and AVX-512me
                    Alder Lake and AVX-512Maynard Handley
            Alder Lake and AVX-512UnmaskedUnderflow
            AVX-512 vs SVE2-.-
              AVX-512 vs SVE2noko
                AVX-512 vs SVE2-.-
            Alder Lake and AVX-512Geoff Langdale
              Could you please stop top-posting (NT)Jukka Larja
              Alder Lake and AVX-512Romain Dolbeau
            Alder Lake and AVX-512Spiteful Sprites
              Alder Lake and AVX-512nobody in particular
                Alder Lake and AVX-512Spiteful Sprites
                  Alder Lake and AVX-512Jouni Osmala
                  RISC-V & commercial support (was: Alder Lake and AVX-512)Romain Dolbeau
                    RISC-V & commercial support (was: Alder Lake and AVX-512)Romain Dolbeau
              Alder Lake and AVX-512Linus Torvalds
            AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Romain Dolbeau
              AVX-512/SVE & HPC (was: Alder Lake and AVX-512)anon
                AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Romain Dolbeau
                  AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Maynard Handley
                  AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Doug S
                  AVX-512/SVE & HPC (was: Alder Lake and AVX-512)anon
              AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Linus Torvalds
                AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Romain Dolbeau
                  Configurable cache line size?Doug S
                    Configurable cache line size?dmcq
                    Configurable cache line size?Romain Dolbeau
                    Configurable cache line size?NoSpammer
                    Configurable cache line size?Pixie
                      Configurable cache line size?Etienne
                        Configurable cache line size?Hugo Décharnes
                  Cache line sizeMark Roulo
                    Cache line sizeanon
                  AVX-512/SVE & HPC (was: Alder Lake and AVX-512)Gabriele Svelto
                    AVX-512/SVE & HPC (was: Alder Lake and AVX-512)dmcq
                      AVX-512/SVE & HPC (was: Alder Lake and AVX-512)zArchJon
            Macro-instructions to the rescue
              Some fundamentals haven't changedChester
                Some fundamentals haven't changed
                  Some fundamentals haven't changeddmcq
                    Some fundamentals haven't changed
                    Some fundamentals haven't changedBrett
                      Some fundamentals haven't changedBrett
                      What belt is.Heikki Kultala
                        What belt is.Michael S
                          What belt is.Brett
                            What belt is.Michael S
                              What belt is.Brett
                                What belt is.Doug S
                                  What belt is.Andrew Clough
                                    What belt is.dmcq
                                      Mill Compiler still MIA?Geoff Langdale
                                        If they release the compiler, how they will blame the still-in-development compiler for the lacklust (NT)Anon
                                          If they release the compiler, how they will blame the still-in-development compiler for the lacklustAnon
                                        Apparently they're busy writing a kernel...Anon
                                          Apparently they're busy writing a kernel...dmcq
                        What belt is.
                          What belt is.anonymous2
                            What belt is.Doug S
                              What belt is.
        gooduseruser
      Alder Lake and AVX-512-.-
        Alder Lake and AVX-512-.-
      Alder Lake and AVX-512j
        Alder Lake and AVX-512Michael S
          Alder Lake and AVX-512j
            Alder Lake and AVX-512dmcq
              Alder Lake and AVX-512Michael S
                Alder Lake and AVX-512Maynard Handley
                Alder Lake and AVX-512dmcq
                  Alder Lake and AVX-512dmcq
                    Alder Lake and AVX-512Michael S
                      Alder Lake and AVX-512dmcq
                        Alder Lake and AVX-512Michael S
                          Alder Lake and AVX-512dmcq
                            Alder Lake and AVX-512Michael S
                              Alder Lake and AVX-512dmcq
                                Alder Lake and AVX-512Michael S
                                  Alder Lake and AVX-512dmcq
                                    GV100 + POWER9Michael S
                                      GV100 + POWER9dmcq
                                        GV100 + POWER9dmcq
                        Alder Lake and AVX-512dmcq
    Alder Lake and AVX-512o
    Alder Lake and AVX-512
      Alder Lake and AVX-512
      Alder Lake and AVX-512Linus Torvalds
        Alder Lake and AVX-512
        Alder Lake and AVX-512Michael S
          x87 crapHeikki Kultala
            x87 crapMichael S
              x87 crapHeikki kultala
                x87 crapMichael S
                  Sparc and PA-RISC vs pentium FP performanceHeikki Kultala
                    Sparc and PA-RISC vs pentium FP performanceanonymous2
          Alder Lake and AVX-512Doug S
            Alder Lake and AVX-512Michael S
    Alder Lake and AVX-512David Kanter
      Alder Lake and AVX-512anon
      ~0% of users do much FP outside of GPUs for games (NT)anonymous2
        ~0% of users do much FP outside of GPUs for gamesMaynard Handley
        not trueChester
          not trueMichael S
            not trueChester
              not trueanonymous2
                not trueMaynard Handley
                  not trueChester
            not trueDoug S
              not trueAnon
                not trueMaynard Handley
              not trueMaynard Handley
          not trueLinus Torvalds
            not trueDummond D. Slow
              not trueMaynard Handley
                not trueDummond D. Slow
            not true (about FP, not avx-512)Chester
  Alder Lake and AVX-512Travis Downs
    Alder Lake and AVX-512-.-
      Alder Lake and AVX-512-.-