Does LC0 get hardware advantage?

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
Uri Blass
Posts: 8611
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Does LC0 get hardware advantage?

Post by Uri Blass » Fri Oct 05, 2018 7:38 am

I think that energy consumption or price is not the way to test if an hardware is faster.
Hardware advantage simply means that you can do with that hardware things faster.

Now my question is the following:

Suppose that you write a new engine to calculate exact value of perft(number of legal games with n plies from a specific position) or to solve mates(tell the user what is the distance to mate and give all solutions).

What is better hardware to do it faster GPU that lc0 use in CCCC or CPU that stockfish use there?

brianr
Posts: 358
Joined: Thu Mar 09, 2006 2:01 pm

Re: Does LC0 get hardware advantage?

Post by brianr » Fri Oct 05, 2018 8:25 am

For perft it has already been done and it's not even close.
https://github.com/ankan-ban/perft_gpu

Of course, perft is only a small part of actual game performance.

smatovic
Posts: 966
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: Does LC0 get hardware advantage? Truck vs Race Car

Post by smatovic » Fri Oct 05, 2018 9:31 am

If you count only FLOPS or MIPS then of course GPUs have an hardware advantage.
The question is, how to make use of this horse power for chess.

The GPU is more like a truck, and the CPU like a race car.
The truck can play out his advantage only with a certain amount of payload,
when massive parallel work has to be done.

An example for payload are the batch sizes used in LC0.

Ankan showed with his perft_gpu that GPUs can be used for 64 bit chess move
generation with incredible speeds.

My own experiments with Zeta as chess playing engine were less successful,
as soon as i add more complex code which relies on branches and syncs
i loose a lot of compute cycles.

So the challenge is still open, to create an classic chess engine that makes
use of the horse power the GPU offers, good luck.

--
Srdja

Uri Blass
Posts: 8611
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: Does LC0 get hardware advantage? Truck vs Race Car

Post by Uri Blass » Fri Oct 05, 2018 5:13 pm

smatovic wrote:
Fri Oct 05, 2018 9:31 am
If you count only FLOPS or MIPS then of course GPUs have an hardware advantage.
The question is, how to make use of this horse power for chess.

The GPU is more like a truck, and the CPU like a race car.
The truck can play out his advantage only with a certain amount of payload,
when massive parallel work has to be done.

An example for payload are the batch sizes used in LC0.

Ankan showed with his perft_gpu that GPUs can be used for 64 bit chess move
generation with incredible speeds.

My own experiments with Zeta as chess playing engine were less successful,
as soon as i add more complex code which relies on branches and syncs
i loose a lot of compute cycles.

So the challenge is still open, to create an classic chess engine that makes
use of the horse power the GPU offers, good luck.

--
Srdja
I think that for playing chess you can use massive parallel work otherwise cpu chess engines could not earn much from having many cores
so I wonder if it is not possible with gpu to emulate stockfish with many thousands of cores.

smatovic
Posts: 966
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: Does LC0 get hardware advantage? Truck vs Race Car

Post by smatovic » Fri Oct 05, 2018 6:39 pm

Uri Blass wrote:
Fri Oct 05, 2018 5:13 pm

I think that for playing chess you can use massive parallel work otherwise cpu chess engines could not earn much from having many cores
so I wonder if it is not possible with gpu to emulate stockfish with many thousands of cores.
I tried to port my simple CPU engine Zeta Dva to OpenCL to run on a GPU,
with little success.

I tried various designs.

In the end i had the choice of running thousands of threads with ~10 Knps
each, or to couple 64 threads to one worker with up to ~100 Knps each and
hundreds of workers in total.

In both cases i was not able to outperform CPU engines,
but maybe some more skilled coder will find a solution.

--
Srdja

***edit***
here some numbers:

http://talkchess.com/forum3/viewtopic.php?f=7&t=63517

Dann Corbit
Posts: 10207
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Does LC0 get hardware advantage?

Post by Dann Corbit » Fri Oct 05, 2018 7:38 pm

I think that a far more interesting question than which type chess engine gets more NPS per MIP is which gets more Elo per dollar.
After all, that is the true goal.
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.

megamau
Posts: 37
Joined: Wed Feb 10, 2016 5:20 am
Location: Singapore

Re: Does LC0 get hardware advantage?

Post by megamau » Sat Oct 06, 2018 6:54 am

Dann Corbit wrote:
Fri Oct 05, 2018 7:38 pm
I think that a far more interesting question than which type chess engine gets more NPS per MIP is which gets more Elo per dollar.
After all, that is the true goal.
You are completely correct !
Very few people care about what is "fair" for some shaky definition of "fair". Many people care what performance (elo) they can get for their effort (dollars).

Post Reply