Live data from Hacker News

Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

lemire.me

51–60 of 70 posts

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#51
post #45
post #23

Earlier quoted context omitted.

> How much code is compiled with `-march=native` Any installation of Gentoo is, presumably. (Otherwise, what's the point of compiling it all yourself?) More interestingly, possibly all OEM firmware-installed copies of ChromeOS are -march=native builds as well, given that ChromeOS is based off of a Gentoo upstream.

True. I have never gone down the Gentoo rabbit hole. Might be fun to try sometime, but I'd seriously doubt that the time spent compiling would be won back from better performance. Clear Linux is probably a more practical alternative. I used it a couple years ago, and found that they had a lot of avx2 and avx512 versions of random libraries built, with the appropriate ones presumably being loaded based on the hardware…

When I ran Gentoo I just had the builds running in the background with a really high niceness.

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#52
post #2

I saw this once before, and both times, it's pretty shocking. Is this really something that needs to be inside the CPU itself? I don't want my CPU doing this. I would rather just take the performance hit and keep the CPU "dumb".

This is a dumb feature for a modern CPU, the really smart part is out-of-order execution and other optimizations that CPU's do behind the scenes

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#53

> However, we have two popular Unicode formats: UTF-8 and UTF-16 The fact we are still using UTF-16 still irks me to this day. UTF-16 (which is actually two different encodings, not one, hence the need for a BOM) is basically a way to salvage all those platforms that hurried on the UCS-2 (aka, the original "UNICODE") bandwagon in the '90s hoping that by just doing s/char/wchar_t/g all their internationalization probl…

UCS-32 is at least directly indexable, even though it's ludicrously space-inefficient.

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#54
post #53

> However, we have two popular Unicode formats: UTF-8 and UTF-16 The fact we are still using UTF-16 still irks me to this day. UTF-16 (which is actually two different encodings, not one, hence the need for a BOM) is basically a way to salvage all those platforms that hurried on the UCS-2 (aka, the original "UNICODE") bandwagon in the '90s hoping that by just doing s/char/wchar_t/g all their internationalization probl…

UCS-32 is at least directly indexable, even though it's ludicrously space-inefficient.

Only in codepoints, but it still has the problem GP mentions of ` + e = è being two codepoints (so two elements in UCS-32), but being logically one character

https://manishearth.github.io/blog/2017/01/14/stop-ascribing...

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#55
post #34
post #15

Earlier quoted context omitted.

The Ice Lake chips being benchmarked against are server chips, while the 7950X Zen 4 chip used is a consumer chip. So while Ice Lake has been out for a while, it’s also several times more expensive. It’s also worth noting that it took Intel several generations of trying AVX512 to get it working well, so AMD doing it first try really is impressive (even if they did cheat by just having AVX512 be double pumped AVX2).

Whether it's comparing latest gen architectures against old architectures or comparing consumer CPUs against enterprise CPUs (or an unholy combination of both), it's all insincere hogwash. Comparing apples to oranges is not how you determine how good a peach is.

Intel also decided to disable AVX-512 on their consumer CPUs going forward, presumably as long as their P+E core strategy remains in place.

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#56
post #42

Earlier quoted context omitted.

if you are targeting more than one specific platform, do you like, include the immintrin.h header and use #ifdef to conditionally use avx512 if it's available on someone's platform?

It would be simpler to use the portable intrinsics from github.com/google/highway (disclosure: I am the main author). You include a header, and use the same functions on all platforms; the library provides wrapper functions which boil down to the platform's intrinsics.

[dead]

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#57
post #2

I saw this once before, and both times, it's pretty shocking. Is this really something that needs to be inside the CPU itself? I don't want my CPU doing this. I would rather just take the performance hit and keep the CPU "dumb".

You can have "dumb" CPUs all you want, just stick with Z80, 6502, 6809. There's still plenty of fun using those and you can hold most of what they do in your head. Add 68000 and MIPS R2000 for some 32 bit fun if you wish. Anything past that level of tech uses brainy tricks to get the performance going.

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#58
post #17

Earlier quoted context omitted.

typically if it's available, compilers will use the avx512 register file. This means you'll see things like xmm25 and ymm25 (128 and 256 bit registers) and those are avx512 only. However, compilers using 512-wide instructions is kinda rare from what I've seen

so then, if i want my code to "explicitly" use avx512, i have to do something like this? ``` void myNotOptimizedThing(my_data* d){ _SPECIAL_CPU_MANUFACTURER_0X3D512(d); } ``` edit: and include some header from the manufacturer most likely?

without using intrinsics? `-O3 -march=skylake-avx512 -mprefer-vector-width=512`

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#59
post #34

Earlier quoted context omitted.

Whether it's comparing latest gen architectures against old architectures or comparing consumer CPUs against enterprise CPUs (or an unholy combination of both), it's all insincere hogwash. Comparing apples to oranges is not how you determine how good a peach is.

Intel also decided to disable AVX-512 on their consumer CPUs going forward, presumably as long as their P+E core strategy remains in place.

I'm of the understanding AVX-512 is available on Alder Lake and up with an appropriate BIOS and the E cores (if applicable) disabled.

I never looked into it in detail, so I could be mistaken.

Re: Transcoding Unicode with AVX-512: AMD Zen 4 vs. Intel Ice Lake

#60
post #59

Earlier quoted context omitted.

Intel also decided to disable AVX-512 on their consumer CPUs going forward, presumably as long as their P+E core strategy remains in place.

I'm of the understanding AVX-512 is available on Alder Lake and up with an appropriate BIOS and the E cores (if applicable) disabled. I never looked into it in detail, so I could be mistaken.

Only on older CPUs, they started fusing off AVX512 on newer silicon batches (even on 12th gen)
Post reply on HN