Zen3 supports fast PEXT aka BMI2

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Alayan
Posts: 550
Joined: Tue Nov 19, 2019 8:48 pm
Full name: Alayan Feh

Zen3 supports fast PEXT aka BMI2

Post by Alayan »

PDEP/PEXT are now hardware-accelerated in Zen 3.

Some argued it was so niche that AMD wouldn't bother doing it, but AMD's design team thought it important enough.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Zen3 supports fast PEXT aka BMI2

Post by Joost Buijs »

Alayan wrote: Thu Nov 05, 2020 4:03 pm PDEP/PEXT are now hardware-accelerated in Zen 3.

Some argued it was so niche that AMD wouldn't bother doing it, but AMD's design team thought it important enough.
How do you know?

I thought tests will first arrive in 3 days.

If this is true I have to ditch my old 3970X and replace it with the new one (5970X ?) next year.
Alayan
Posts: 550
Joined: Tue Nov 19, 2019 8:48 pm
Full name: Alayan Feh

Re: Zen3 supports fast PEXT aka BMI2

Post by Alayan »

Reviews are out today.
JohnWoe
Posts: 491
Joined: Sat Mar 02, 2013 11:31 pm

Re: Zen3 supports fast PEXT aka BMI2

Post by JohnWoe »

Niche indeed.
I can't think any other application where PEXT is useful. Than chess engines where it will give a tiny movegen speed boost.
Or popcount. Or all the 1000 other ad-hoc chess algorithms.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Zen3 supports fast PEXT aka BMI2

Post by Joost Buijs »

Alayan wrote: Thu Nov 05, 2020 4:19 pm Reviews are out today.
Thanks I will take a look.
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Zen3 supports fast PEXT aka BMI2

Post by mvanthoor »

JohnWoe wrote: Thu Nov 05, 2020 4:20 pm Niche indeed.
I can't think any other application where PEXT is useful. Than chess engines where it will give a tiny movegen speed boost.
Or popcount. Or all the 1000 other ad-hoc chess algorithms.
That you can't think of a way where PEXT, BMI or PDEP is useful, doesn't mean there aren't any.

I've seen messages about a graphics program that either had to strip PEXT and BMI2-usage, or create an extra code path and compile for AMD, because BMI2 and PEXT were just too slow to leave in as they were. The creators of the Dolphin Emulator also had problems:

https://dolphin-emu.org/blog/2020/02/07 ... -jan-2020/

If these reports are true, and if AMD now has some nice higher end mainboards (670X ?) that don't have a fan, I *may* actually consider an AMD system for the first time in almost 20 years. I'm still reluctant to buy anything else but Intel and nVidia, because I can count the problems I had with that combination on one hand... and most of the major problems I encountered in the last 20 years were always on either an AMD computer, or one having an ATI / AMD graphics card.

But I am an n=1 person (I hope), so other people may have different experiences.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Zen3 supports fast PEXT aka BMI2

Post by Joost Buijs »

mvanthoor wrote: Thu Nov 05, 2020 4:52 pm
JohnWoe wrote: Thu Nov 05, 2020 4:20 pm Niche indeed.
I can't think any other application where PEXT is useful. Than chess engines where it will give a tiny movegen speed boost.
Or popcount. Or all the 1000 other ad-hoc chess algorithms.
That you can't think of a way where PEXT, BMI or PDEP is useful, doesn't mean there aren't any.

I've seen messages about a graphics program that either had to strip PEXT and BMI2-usage, or create an extra code path and compile for AMD, because BMI2 and PEXT were just too slow to leave in as they were. The creators of the Dolphin Emulator also had problems:

https://dolphin-emu.org/blog/2020/02/07 ... -jan-2020/

If these reports are true, and if AMD now has some nice higher end mainboards (670X ?) that don't have a fan, I *may* actually consider an AMD system for the first time in almost 20 years. I'm still reluctant to buy anything else but Intel and nVidia, because I can count the problems I had with that combination on one hand... and most of the major problems I encountered in the last 20 years were always on either an AMD computer, or one having an ATI / AMD graphics card.

But I am an n=1 person (I hope), so other people may have different experiences.
Indeed PEXT/PDEP is useful for many things, but replacing magic multiplication with PEXT in the move-generator is not one of them.

In the past I've had the same experience with AMD processors and AMD graphic cards, I used to have two dual Opteron systems with Tyan mainboards and both systems died within two years. I've never seen anything like this happening with Intel systems.

Amd graphic cards always had very bad drivers that were very difficult to remove like a virus, AMD used to have a driver cleanup tool that I used once, it completely destroyed my operating system, thank you AMD.

Since half a year I own an AMD 3970X system, up until now it runs without problems, so I'll keep my fingers crossed and hope that it will still work over a couple of years.
Dann Corbit
Posts: 12540
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Zen3 supports fast PEXT aka BMI2

Post by Dann Corbit »

I have purchased AMD commercial systems which were ten years old and they ran wonderful 24x7x365.
Drank electricity with a slurp and a burp, but I guess commercial Intel systems would do the same.
I really like my 3970x with two 2080 super cards.
It's a lean, mean chess machine and also burns rubber for my other interests like database programming.
But I would not hesitate to buy Intel if I thought I could get more performance per dollar.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
Geonerd
Posts: 79
Joined: Fri Mar 10, 2017 1:44 am

Re: Zen3 supports fast PEXT aka BMI2

Post by Geonerd »

IPMan has a few benchmarks up. The BMI2 compiles are fractionally faster than POP, and the 5xxx series are substantially faster than the corresponding 3xxx models. http://ipmanchess.yolasite.com/amd---in ... -bench.php
Alayan
Posts: 550
Joined: Tue Nov 19, 2019 8:48 pm
Full name: Alayan Feh

Re: Zen3 supports fast PEXT aka BMI2

Post by Alayan »

A 2.5% speedup from PEXT is not earth-shattering but is good to have. And a good boost beyond this.

The ipmanchess bench asmfish is quite different from current Stockfish however. Heavy AVX2 might mean an even bigger uplift.