GPGPU Chess Engine for Stockfish!!!

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

abhishek0

GPGPU Chess Engine for Stockfish!!!

Post by abhishek0 »

Hello all,

I am a B-Tech student going to focus my efforts on making <stockfish> utilize GPGPU efficiency. Therefore its my humble question to all, IS this possible??

Does the stockfish code itself has an architecture that can help me "integrate" the opencl kernels for GPGPU optimization??

Do I have to change the entire code to have stockfish optimized for parallel computation or will the code structure allow me to insert the new code in the legacy one without changing the original one.

And finally is it even possible to make a chess engine GPGPU optimized??

Thanks!!!
Daniel Shawul
Posts: 4185
Joined: Tue Mar 14, 2006 11:34 am
Location: Ethiopia

Re: GPGPU Chess Engine for Stockfish!!!

Post by Daniel Shawul »

It is probably not a feasible project. Why not start with something very simple like devising an alpha-beta algorithm suitable for GPU computation?
There was a post here awhile back on this same problem and it is not something trivial .
Daniel
rbarreira
Posts: 900
Joined: Tue Apr 27, 2010 3:48 pm

Re: GPGPU Chess Engine for Stockfish!!!

Post by rbarreira »

Better start with something with simple rules like Tic-Tac-Toe or maybe Connect 4. Chess doesn't seem like the easiest game for trying out new ideas...

Just my 2 cents...
smatovic
Posts: 2645
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: GPGPU Chess Engine for Stockfish!!!

Post by smatovic »

Do I have to change the entire code to have stockfish optimized for parallel computation or will the code structure allow me to insert the new code in the legacy one without changing the original one.
Imo you have to redesign the complete code and architecture to perform well on a GPU. So it could be easier to develop a new engine from scratch. But the know-how in stockfish, move generation, evaluation, is valuable for sure.
And finally is it even possible to make a chess engine GPGPU optimized??
Afaik there are two active attempts for GPU Chess:

http://zeta-chess.blogspot.com/
http://blog.cudachess.org/

There are some main technical aspects in which a GPU differs from a CPU.
A GPU works in SIMD and SPMD matter with thousands of concurrent threads, each with a very little amount of local memory (32-512 Bytes).
Therefore a programer has to get at first a move generator running which performs well on a SIMD machine and at second has to design a parallel search algorithm which keeps thousands of threads busy. And this with ~128 Bytes of local memory per thread.

Just rewriting Stockfish in OpenCL won't work.
vb4
Posts: 165
Joined: Sat Mar 11, 2006 5:45 am
Location: NY

Re: GPGPU Chess Engine for Stockfish!!!

Post by vb4 »

Although my general understanding is that it will be a difficult task that doesnt mean you shouldnt try it. Many new ideas come from such explorations. As an incentive if it can be done I may have access to a very large number of GPU's that a company appears willing to dedicate for this purpose. Just a thought <S>.