FPGA chess

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Rein Halbersma
Posts: 741
Joined: Tue May 22, 2007 11:13 am

Re: FPGA chess

Post by Rein Halbersma »

Joost Buijs wrote: When you want to do this professionally there are some solutions but this is way out of reach for hobbyists.
I was always very enthusiastic about computer chess, and in the 38 years that I have been busy with it I spent about 70k on hardware mainly for this purpose.
Now that I'm retired I have to be careful where to spend my money on. So I have to step back a little. :wink:
Recently I bought a new mainboard with a 5960x and I suppose I have to live with this for the next 5 years.
If you are spending that kind of money, why not go for the Xeon version (E5-1660-v3), which will unlock the 64G memory limitation that its i7 cousin has?
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: FPGA chess

Post by Joost Buijs »

Rein Halbersma wrote:
Joost Buijs wrote: When you want to do this professionally there are some solutions but this is way out of reach for hobbyists.
I was always very enthusiastic about computer chess, and in the 38 years that I have been busy with it I spent about 70k on hardware mainly for this purpose.
Now that I'm retired I have to be careful where to spend my money on. So I have to step back a little. :wink:
Recently I bought a new mainboard with a 5960x and I suppose I have to live with this for the next 5 years.
If you are spending that kind of money, why not go for the Xeon version (E5-1660-v3), which will unlock the 64G memory limitation that its i7 cousin has?
In practice I will never use more than 32G memory.
The 768G address space of the E5-1660-v3 looks nice but I haven't seen a mainboard yet that allows you to put this amount of memory on.
Anyway I'm very happy with the 5960x, it's performance is mind boggling.
If you want to spend less money a 5930k would be a nice alternative, it has almost the same performance at a much lower cost.

Another point is that the 5960x can be overclocked, on air cooling it easily runs at 4.4GHz., the e5-1660-v3 does not allow you to do that.
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: FPGA chess

Post by ernest »

Joost Buijs wrote:Anyway I'm very happy with the 5960x, it's performance is mind boggling.
Could you describe your new machine ?
Thanks !
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: FPGA chess

Post by Joost Buijs »

ernest wrote:
Joost Buijs wrote:Anyway I'm very happy with the 5960x, it's performance is mind boggling.
Could you describe your new machine ?
Thanks !
Hi, I really don't know what to describe.

It is an Asus X99 Deluxe mainboard with a core I7-5960x and 8 sticks Corsair Vengeance-LP DDR4 from 4GB each.
I just replaced the old mainboard which had an I7-3960x on it.
The case, PSU, hard disks and video card are reused from the old machine.

For chess the performance of the 5960x is about 1,5x the performance of the 3960x.
syzygy
Posts: 5566
Joined: Tue Feb 28, 2012 11:56 pm

Re: FPGA chess

Post by syzygy »

Joost Buijs wrote:For chess the performance of the 5960x is about 1,5x the performance of the 3960x.
Both clocked at 4.4 Ghz?

4.4 Ghz for the 8-core 5960x seems excellent.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: FPGA chess

Post by Joost Buijs »

syzygy wrote:
Joost Buijs wrote:For chess the performance of the 5960x is about 1,5x the performance of the 3960x.
Both clocked at 4.4 Ghz?

4.4 Ghz for the 8-core 5960x seems excellent.
When I compared them they were both clocked at 4.0 GHz. Of course 33% of the performance increase is due to the core count and the other 17% is probably due to improvement in architecture. With my own engine I measure an increase of roughly 50% in n/s. but this can be different for other engines.

I run the 5960x on 4.2 GHz. with air cooling (Noctua NH-D15), at full load the temperature stays below 60 deg. C. Above 4.2 GHz. it starts to warm up very rapidly. At 4.4 GHz. the temperature is already ~70 deg. C.
Idle it runs very cool, about 8 deg. C. above room temperature. The 3960x is getting much warmer when idle.
ernest
Posts: 2041
Joined: Wed Mar 08, 2006 8:30 pm

Re: FPGA chess

Post by ernest »

Joost Buijs wrote:It is an Asus X99 Deluxe mainboard with a core I7-5960x and 8 sticks Corsair Vengeance-LP DDR4 from 4GB each.
Thanks !
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: FPGA chess

Post by matthewlai »

Milos wrote:
matthewlai wrote:Just wondering if anyone is interested in creating custom hardware for chess.

Way back in the days of Deep Blue, there was a lot of custom hardware, but custom hardware at that time costed a lot of money.

Nowadays, thanks to FPGAs (can be thought of as "blank" chips that can be configured into different hardware designs), custom hardware is well within the budget of most hobbyists (a cheap FPGA board is less than $100).

A typical architecture is to synthesize a general purpose CPU to do most things, and modify the CPU to include custom instructions to accelerate inner loops.

For example, for chess, there could be an instruction for generating all moves for a piece, an instruction that applies or unapplies moves, or even an instruction that does eval().

The limiting factor would be chip space, and allocation of that space would be interesting. For example, given enough space, it's probably possible to do eval() in a few clock cycles thanks to how parallelizable most eval() functions are.

It's something I really want to look into, coming from an electrical engineering background, but I'm not sure if many people would be interested, and have the required hardware design knowledge.

Has anyone been working on something similar?

Custom/hybrid hardware is not prevalent in consumer computers yet, but Intel is developing CPUs with included FPGA fabric, so it will probably become a normal part of a CPU in 5-10 years time.

Hybrid hardware is already very popular in embedded space (eg. Xilinx Zynq), where the CPU is usually on fixed hardware (instead of synthesized on the custom fabric) for cost and performance reasons (fixed hardware can be clocked faster).
Before Intel comes with a chip there will be no cheep solutions. The only existing high performance solution today (and it is very recent) is IBM's POWER8 with CAPI.
Zynq boards are great tools for prototyping, but they have 2 big disadvantages for chess:
1) they are relatively expensive (~1000$)
2) CPUs are really not powerful (dual core A9 on 667-866MHz, low on cache, optimized for floating point)
3) maximum DDR3 memory is limited to 1GB
When the hybrid Xeon comes out, I'm sure it will be much more than $1000 with the motherboard and memory :).

There are low end Zynq boards for less than $200.
http://digilentinc.com/Products/Detail.cfm?Prod=ZYBO

Or you can get a higher end one for $264.
http://www.digikey.com/product-detail/e ... ND/5018663
This one also includes a GPU-style coprocessor, but I'm not sure if it will actually help.

The fact that the processor is optimized for floating point doesn't mean it's not optimized for integers. It just has a stronger FPU compared to lower end ARMs. It's still a 2.5 DMIPS/MHz/core CPU for integer computations.

The goal is not necessarily to produce the fastest chess computer. That just requires having a lot of money, no matter what route you decide to take. If I want access to a fast chess computer I would just run Stockfish on a 16-core Xeon Amazon EC2 instance.

The ZYBO board (650 MHz CPU, 512MB DDR3) is only $189, and I wouldn't be surprised if it's possible to create a chess computer on there that is faster than any $189 computer you can find/build (CPU + motherboard + RAM + power supply). And it will only draw a tiny fraction of the power consumption of any modern computer.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.