Looking inside NNs

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Looking inside NNs

Post by Henk »

Is there a name for this illness spending too large amounts of money on useless hardware and software like we have a name for people eating too less (anorexia) or eating too much (obese).

Most efficient is buying old hardware and software working fine for almost no money and disable any updates.
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: Looking inside NNs

Post by brianr »

Dann Corbit wrote:Unplug your computer from the wall and there is no danger.
If you are nervous to do it, find a friend who will do it for you.
It is at two minute job.
Yes, the graphics card is a two minute job, if you know what you are doing. I suspect most of us are nonetheless quite anxious when powering up after changing cards hoping we did't break anything or drop a screw into who knows where.

BUT, installing all of the NN software is non-trivial. Moreover, many things are still easier (at least for me) on Ubuntu than on Windows in terms of NN software, and I'm a Linux noob. Tensorflow support on Windows a year ago was sketchy enough that I had started with Theano.

GCP's LeelaZero framework is astounding, particularly the automatic gpu support using OpenCL. This means it does not require Nvidia software, although once you get that working you are off to the races.

Finally, beware of frequent version churn and even broken backwards compatibility with Keras, Tensorflow-gpu, CUDA, cuDNN, and I still have nightmares over Python 2 to 3 pains.

PS:
Incidentally, my "new" PC is an 8-year-old i920, although it is OC'd to 4GHz (down from 4.4 when it was young), and I have added memory and a faster disk, and of course, a GTX-1070 that was on super sale ($379 IIRC).

I am enjoying tinkering (ahem) with NNs and currently fiddling with Zeta's chess-alpha-zero and some of its forks. I have added input generators from straight pgn files and feeding int8s so bigger steps can fit in memory.

GL's leela-chess is running on two of my other PCs adding some games for training. That project is very close to expanding like Fishtest. Crowd-sourcing 1,700 years of NN training (which was 9 hours for Google, IIRC) seems doable in some months (maybe even weeks).
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Looking inside NNs

Post by Henk »

I write all NN software myself from scratch. Debugging and misinterpreting is fun (not). But debugging and refactoring chess engine software was tough too.

Before I buy any new hardware I have too make sure all algorithms have been implemented as efficient as possible.
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: Looking inside NNs

Post by brianr »

Forgot to add the most important point: If the setup is such a pain, why bother? People say NNs on GPUs are faster, but you have to appreciate how much faster, like about 100 times! So, if you are spending any significant time on NNs GPUs are the only practical option, IMO.

PS: For non-GPU NNs you might look at something like this:
http://neural2d.net/?page_id=19
or
http://leenissen.dk/fann/wp/
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Looking inside NNs

Post by Joost Buijs »

Today I tried to run lczero on my i7-6950X which has just a very humble GT-720 card from nVidia, at best it generates about 5 games an hour.

On the attic still I have an old core i3 machine with 3x GTX-1070 which I used in the past for cryptocoin mining, when I look at the specs it is theoretically about 6o times faster as the GT-720, maybe 300 games an hour, but I don't know if lczero is capable of using multiple GPU yet.

In practice at least 2 million games (or more) are needed to train a network, that would take about a year or so. My feeling is that it is better to wait until there is better hardware available, I'm pretty sure that Intel and AMD are also working on this.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Looking inside NNs

Post by Henk »

Joost Buijs wrote: In practice at least 2 million games (or more) are needed to train a network, that would take about a year or so.
Yes I can only run a Snipper(tje) or a Sniffer
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Looking inside NNs

Post by Joost Buijs »

Henk wrote:
Joost Buijs wrote: In practice at least 2 million games (or more) are needed to train a network, that would take about a year or so.
Yes I can only run a Snipper(tje) or a Sniffer
In my opinion you can better keep working on Skipper, NN stuff is very much hyped since AlphaGo and AlphaZero, unfortunately for Chess it is not doable without access to hardware comparable to what Google is using.

And nobody knows how strong AlphaZero really is at chess, they show you some won games against an old version of Stockfish which seems wizardry to some people, but this actually means nothing at all.
brianr
Posts: 536
Joined: Thu Mar 09, 2006 3:01 pm

Re: Looking inside NNs

Post by brianr »

If only engine strength was my primary goal, I would have stopped working on Tinker many years ago. I just enjoy the process. And, I enjoy learning about NNs for chess even more. I can somewhat understand those that enjoy running engine tournaments, although I appreciate their efforts. Others focus on creating opening books. A few take on tablebases. Some craft in assembler, and others do Java. Some excel at parallel search and others work on shrinking things to run on phones, although new phones are or will be quite competitive with my old desktop. My son-in-law works at a quantum computing startup, and someday that may take things to another whole level.

That Alphazero Chess is even competitive with Stockfish is quite amazing. Moreover, it has sparked some renewed interest in computer chess, which was becoming somewhat torpid, IMO.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: Looking inside NNs

Post by Henk »

Joost Buijs wrote:
Henk wrote:
Joost Buijs wrote: In practice at least 2 million games (or more) are needed to train a network, that would take about a year or so.
Yes I can only run a Snipper(tje) or a Sniffer
In my opinion you can better keep working on Skipper, NN stuff is very much hyped since AlphaGo and AlphaZero, unfortunately for Chess it is not doable without access to hardware comparable to what Google is using.

And nobody knows how strong AlphaZero really is at chess, they show you some won games against an old version of Stockfish which seems wizardry to some people, but this actually means nothing at all.
Unclear. Maybe start with a mini chess variant and see if that performs better than alpha beta.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: Looking inside NNs

Post by Joost Buijs »

brianr wrote:If only engine strength was my primary goal, I would have stopped working on Tinker many years ago. I just enjoy the process. And, I enjoy learning about NNs for chess even more. I can somewhat understand those that enjoy running engine tournaments, although I appreciate their efforts. Others focus on creating opening books. A few take on tablebases. Some craft in assembler, and others do Java. Some excel at parallel search and others work on shrinking things to run on phones, although new phones are or will be quite competitive with my old desktop. My son-in-law works at a quantum computing startup, and someday that may take things to another whole level.

That Alphazero Chess is even competitive with Stockfish is quite amazing. Moreover, it has sparked some renewed interest in computer chess, which was becoming somewhat torpid, IMO.
Engine strenght is not my primary goal either, if this was the case I could have taken a lot of tricks from e.g. Stockfish or Ippolit derivatives and my engine would have been quite a lot stronger as it is right now. I also enjoy working on my engine, and trying all kinds of things to see how it works out in practice. Besides this I have several other hobbies which take up a lot of my time.

ANN's have my interest as well, back in the nineties I tried to use a ANN for some of the evaluation features in my chess program, unfortunately it slowed things down too much and was not feasible to use in practice. Recently I bought the book 'Deep Learning' by Ian Goodfellow, I must say that it takes quite some effort to master all the formula.

However, my feeling remains that current consumer hardware is not suitable yet to train large ANN's, basically it all comes down to trial and error, if you have been training your ANN for several months or so just to find out that the network topology is not optimal, it will all be very time consuming.