Giraffe dissertation, and now open source

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Giraffe dissertation, and now open source

Post by matthewlai »

cdani wrote:Congratulations for your work and thanks for it!!
Thanks! :D
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.
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Giraffe dissertation, and now open source

Post by matthewlai »

JoshPettus wrote:Huge congratulations Matthew! :) And Thank-you so much for making it open source.

The windows 64bit version is a little tricky for me in wine (it's very limited right now), so I made an OSX compile. should be good for OSX 10.6 or newer.
https://dl.dropboxusercontent.com/u/504 ... iraffe.zip
Awesome! Is that with homebrew/MacPorts GCC? Did you have to change anything? I have been doing most of my testing with homebrew GCC 4.9.

Also, feel free to include eval.net and meval.net from the binary distribution as well. Without them Giraffe will use very weak built-in functions.
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.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Giraffe dissertation, and now open source

Post by JoshPettus »

macports gcc 4.9 with --static-libgcc and -mmacosx-version-min=10.6

I still had some trouble though. the assembler wanted clang in the same folder as gcc, so I made a softlink (not sure why to be honest). The linker couldn't find -ltcmalloc. I tried it without it, and seems to work.

I added both files
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Giraffe dissertation, and now open source

Post by matthewlai »

JoshPettus wrote:macports gcc 4.9 with --static-libgcc and -mmacosx-version-min=10.6

I still had some trouble though. the assembler wanted clang in the same folder as gcc, so I made a softlink (not sure why to be honest). It couldn't find -ltcmalloc. I tried it without it, and seems to work.
Ah! Good catch. I will mention it in the readme.

libtcmalloc is optional. It replaces malloc/free with another implementation with thread-local caching. It speeds up training on 10+ cores, but doesn't really matter for playing.

OSX's GNU as is a pain. It doesn't have AVX instructions. That's why there's "-Wa,-q" in the Makefile. Maybe it has something to do with that?

Also, the current Makefile includes "-march=native". If you want it to run on older CPUs, you'll probably want to change that.
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.
User avatar
Bloodbane
Posts: 154
Joined: Thu Oct 03, 2013 4:17 pm

Re: Giraffe dissertation, and now open source

Post by Bloodbane »

Now I just look stupid when I was worrying about the amount of mathematics :lol:.
Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.
https://github.com/mAarnos
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Giraffe dissertation, and now open source

Post by matthewlai »

Bloodbane wrote:Now I just look stupid when I was worrying about the amount of mathematics :lol:.
:D

There is actually quite a bit of math in Giraffe, but I didn't write about it in the thesis because that's just standard neural network stuff mostly.
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.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Giraffe dissertation, and now open source

Post by JoshPettus »

OSX's GNU is non existent :) it's actually a symlink to clang. Unfortunately clang doesn't like OpenMP and is completely missing the omp header. On google I found a project to implement it, but it's not in the main branch yet.
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Giraffe dissertation, and now open source

Post by matthewlai »

JoshPettus wrote:OSX's GNU is non existent :) it's actually a symlink to clang. Unfortunately clang doesn't like OpenMP and is completely missing the omp header. On google I found a project to implement it, but it's not in the main branch yet.
/usr/bin/as is GNU as. See "as -v". It's just a very old version. Though it may actually be a good idea to replace it with a script that calls clang.

Oh yeah I forgot Clang doesn't have OpenMP. That's unfortunate. Though OpenMP is designed for the code to still be correct if all the OMP pragmas are ignored. You would have to comment out the omp include though, if it's completely missing. The search is serial anyways, and when I parallelize it it probably won't be using OpenMP. OpenMP is only used to parallelize training.
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.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: Giraffe dissertation, and now open source

Post by JoshPettus »

Ah, you're right! forgot about the assembler. Regarding Omp, That said it's not hard to install gcc49 on macports.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: Giraffe dissertation, and now open source

Post by Robert Pope »

When you talk about having the correct distribution of positions for training, is that really a necessary condition? Or is it simply to avoid wasting time learning to handle things that won't likely occur?