Live data from Hacker News

AVX-512, what’s useful for us

obe.tv

41–50 of 50 posts

Re: AVX-512, what’s useful for us

#41
post #38

Earlier quoted context omitted.

Define significant. I write software that couldn't exist without SIMD, as do all my competitors. (Note: it could exist but wouldn't offer nearly the same level of capability, i.e. it would be a different product) By specifying the last several generations of Intel hardware I can guarantee customers can run my software (AVX1 minimum) with consumer level desktops/laptops. AVX-512 hardware support hasn't reached the ave…

Have you looked at RISC-V Vector proposal yet? Same person who did AVX-512 for Intel.

https://riscv.org/wp-content/uploads/2015/06/riscv-vector-wo...

https://riscv.org/wp-content/uploads/2016/12/Wed0930-RISC-V-...

EDIT: This looks really nice after skimming a little.

Re: AVX-512, what’s useful for us

#42
post #21

I changed some Golang code to AVX in my last project. In isolation that code ran like 2-4x faster but as part of the full program, the program was 5% slower overall. Could never make a sense of it. Any thoughts on how to determine the cause?

Running AVX-512 on all cores will lower all core operating frequency, in order to maintain the TDP of the processor.

When you run it in isolation, there's more headroom since only one core can run at the higher freq. and use AVX512 registers.

Also the power license ensures the cores running AVX512 code runs at a lower frequency.

Make sure to guard your AVX512 code block with VZEROUPPER when exiting it

Re: AVX-512, what’s useful for us

#43
post #39

Earlier quoted context omitted.

You can either use lscpu, which is less accurate, or the best way is to check: cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq where instead of cpu0 you can write any core number, and it will give you the current frequency of that core in KHz.

I'll try that out. Thanks.

Note that with pstate /proc/cpuinfo is not reflective (not suggested here but, in the past, the MHz used to change to reflect the scaling speed). You could also look at 'powertop'

Re: AVX-512, what’s useful for us

#44
post #25
post #23

Earlier quoted context omitted.

AVX code is known to make the CPU run way hotter than usual. Perhaps that caused throttling that made general code running at the same time, or within a short span thereafter, perform worse?

That is one theory I had but i'm not sure how to determine if CPU is throttling (on Ubuntu Linux.)

One way I've found to isolate this is to turn off turbo boost and underclock the cpu, while making sure the avx offset is set to 100%. While you would never want to run a production system like this, it does help to eliminate any issues with cpu throttling. If the avx-512 version of the program still runs slower then something else is interfering besides cpu throttling.

Re: AVX-512, what’s useful for us

#45

If I'm understanding it correctly, they're not actually using the 512 bit (ZMM) registers, because using them can cause overall system slowdown. It seems to me they're only really useful if you're doing an AVX-512 intensive workload. And do those really exist? For something like bulk matrix multiplications, GPGPU is going to be much better, both in throughput and in operations per joule. I'm remaining to be convinced…

I work in an HPC lab (computational chemistry) and we have a hand-coded AVX-512 codepath. I can't give any specifics (because I don't know them) but I know there is a non-trivial speedup versus the standard codepath (or AVX2). However, GPUs blow it out of the water for much a lower price since we only need FP32. I think the main reason we invested time adding supports is for the Xeon Phi cards. I guess is could be wo…

If you look at Skylake-SP architecture vs. recent GPUs, the chip design at first glance doesn't seem so different anymore between these two, CPUs are just much less focused, which pays a 2x price in theoretical performance for the same die space, even using Intel's superior process technology. Now that being said, I think the GPU/SIMT model of vector computing is just much smarter. Why let me jump through all these hoops of masking and compiler optimizations if all I want is a branch and an early exit for a specific set of values? GPU schedulers and drivers make this easy to use and with somewhat predictable performance results. Furthermore (and probably more importantly), why is Intel putting this amount of compute power on a CPU without significantly upgrading memory bandwidth? A 28 core Skylake-SP using full vectorization now has 3x (!) the FLOP/Byte system balance compared to NVIDIA P100. Seriously? System balance was once an argument against GPUs, but not anymore apparently...

Re: AVX-512, what’s useful for us

#46
post #21

I changed some Golang code to AVX in my last project. In isolation that code ran like 2-4x faster but as part of the full program, the program was 5% slower overall. Could never make a sense of it. Any thoughts on how to determine the cause?

cache invalidation may be a reason

Re: AVX-512, what’s useful for us

#47

If I'm understanding it correctly, they're not actually using the 512 bit (ZMM) registers, because using them can cause overall system slowdown. It seems to me they're only really useful if you're doing an AVX-512 intensive workload. And do those really exist? For something like bulk matrix multiplications, GPGPU is going to be much better, both in throughput and in operations per joule. I'm remaining to be convinced…

I work in an HPC lab (computational chemistry) and we have a hand-coded AVX-512 codepath. I can't give any specifics (because I don't know them) but I know there is a non-trivial speedup versus the standard codepath (or AVX2). However, GPUs blow it out of the water for much a lower price since we only need FP32. I think the main reason we invested time adding supports is for the Xeon Phi cards. I guess is could be wo…

Fun fact: AVX-512 came from the design that is now known as Xeon Phi.

You can read Tom Forsyth's story on it on his ask.fm (https://ask.fm/tom_forsyth)

I paste it here because I couldn't figure out how to link to the ask.fm post:

"Q: How did you get involved in the development of Larrabee, and what concepts do you have to know to do such a thing? by Foo Bar

8 months ago

A: It was a rather convoluted process! * Michael Abrash and Mike Sartain at Rad Game Tools were working with Intel to make a new processor called Simple, Massive Array of Cores (SMAC) * I was also at Rad Game Tools working on Granny3D and was asked to be the DirectX expert, since I knew the details of the API very well. * As well as doing general coding on the whole software rendering stack, I helped capture a bunch of shader workloads from existing games, and then wrote a compiler for the SSE-based instruction set SMAC used at the time to prove it would be efficient at running these shaders. * It wasn't. * The compiler helped us add instructions to SSE to make it more efficient. * It still kinda sucked. * We threw SSE away and started again with a new vector instruction set we called "SMAC New Instructions" (SMACNI). Didn't really know what it had to be, except "not SSE". * All of us contributed ideas to the new instruction set, and then I'd make the compiler understand each idea, and we'd see how well it worked on these real shader workloads. * Feature by feature we created SMACNI, and bit by bit I became more of an instruction architect, less of a software coder. I learned a ton about hardware on the way, mainly by asking real architects stupid questions and trying to understand their answers. Hardware is nothing at all like software people imagine it is. * At some point, SMAC was given an official codename "Larrabee", SMACNI became Larrabee New Instructions (LRBNI), and I stopped working for Rad being a contractor for Intel, and instead became a full time Intel hardware architect - although I still sat at the same desk doing the same job with the same people. * We made Larrabee 1, aka Knights Ferry, and I started work on the next version of the instruction set and architecture. * We made Larrabee 2, aka Knights Corner, aka the first Xeon Phi. All exactly the same bit of silicon, just running slightly different software. * At this point there was a big push to make the next chip, Knights Landing, run all the existing MMX, SSE and AVX code (KNF and KNC didn't run any of those, it was just x86-64 and LRBNI), and conversely to push LRBNI onto the mainstream Intel cores. So I worked with all the rest of the architects at Intel in a massive board for a couple of years to hammer out how to merge these two instruction sets and encodings. The result was AVX512. * Those meetings were exhausting frustrating work and moved so agonizingly slowly, that once it was completed, it didn't take much persuading from Michael Abrash to go to Valve and work on virtual reality with him instead. * AVX512 has now shipped inside Knights Landing (the latest Xeon Phi chip), and inside the Skylake Xeon cores. Hopefully we'll see it in the mainstream desktop cores shortly. It's pretty cool seeing an instruction set I designed shipping in so many high-profile cores. "

Re: AVX-512, what’s useful for us

#48

Earlier quoted context omitted.

I work in an HPC lab (computational chemistry) and we have a hand-coded AVX-512 codepath. I can't give any specifics (because I don't know them) but I know there is a non-trivial speedup versus the standard codepath (or AVX2). However, GPUs blow it out of the water for much a lower price since we only need FP32. I think the main reason we invested time adding supports is for the Xeon Phi cards. I guess is could be wo…

If you look at Skylake-SP architecture vs. recent GPUs, the chip design at first glance doesn't seem so different anymore between these two, CPUs are just much less focused, which pays a 2x price in theoretical performance for the same die space, even using Intel's superior process technology. Now that being said, I think the GPU/SIMT model of vector computing is just much smarter. Why let me jump through all these h…

> Now that being said, I think the GPU/SIMT model of vector computing is just much smarter.

I'm not sure. For an argument in favor of vectors, see https://riscv.org/wp-content/uploads/2015/06/riscv-vector-wo...

> Why let me jump through all these hoops of masking and compiler optimizations if all I want is a branch and an early exit for a specific set of values? GPU schedulers and drivers make this easy to use and with somewhat predictable performance results.

If the underlying hw is SIMD (vectors) and not SIMT anyway, as Nvidia hw apparently is, why should I have to go through the effort of rewriting my code in CUDA, and hope that some opaque driver will manage to turn that into efficient vector code?

I mean, ideally I'd just like to write C/C++/Fortran/Julia/Haskell/whatever code, and the compiler would autovectorize it.

> Furthermore (and probably more importantly), why is Intel putting this amount of compute power on a CPU without significantly upgrading memory bandwidth?

Flops are cheap, bw expensive. But yeah, certainly the are many applications that would benefit from a much better bw/flops ratio.

Then again, with the latest Teslas you have 16 GB with awesome bw, after that you're trying to feed the firehose through the PCIe straw.

Re: AVX-512, what’s useful for us

#50

If I'm understanding it correctly, they're not actually using the 512 bit (ZMM) registers, because using them can cause overall system slowdown. It seems to me they're only really useful if you're doing an AVX-512 intensive workload. And do those really exist? For something like bulk matrix multiplications, GPGPU is going to be much better, both in throughput and in operations per joule. I'm remaining to be convinced…

> For something like bulk matrix multiplications, GPGPU is going to be much better, both in throughput and in operations per joule. But you have to get all of your matrix out onto the system bus, and over to the GPU, then start the kernel, and then copy it all the way back again, to use that. ZMM is just a register. You can operate on it immediately and stream data from memory while you do the multiply.

AMD's HSA is intended to enable memory sharing between the CPU and GPU.
Post reply on HN