It is currently Thu Sep 19, 2019 5:29 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
Offline
 Post subject: Compiling some engines for linux
Post #1 Posted: Fri Sep 07, 2018 8:59 pm 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
I've decided to try out a few of the latest go-playing engines, as well a a few golden oldies. I plan to do something along vaguely similar lines to the engine tournament viewtopic.php?f=18&t=13322 but using BayesElo for rankings. I'll post results in a separate thread, if I get that far.

Installing and configuring some of the engines has been a bit of an adventure in itself. I've learned a few things over the past few days, so I should write some of this down before I forget it all again.

I'm using Ubuntu 18.o4.

Gnugo

Installation was a piece of cake: it's in the official Ubuntu repositories, so it's as easy as typing "sudo apt install gnugo" on a command line (or finding it in the Ubuntu software centre if you prefer to do things graphically).

Configuration: It pretty much works out of the box. To use it via GTP (e.g. if you want to plug it into gogui or sabaki), use "gnugo --mode gtp". Add "--chinese-rules" for Chinese rules (recommended for engine vs engine games). It has ten levels of play via the --level argument, but my early experiments suggest that level doesn't make much of a difference. Also you can adjust the cache size (default 10Mb, puny by modern standards), but it doesn't seem to get stronger if you give it more cache.

Pachi

Installation: Compiling from source was mildly annoying because of all the dependencies, but not too bad. I got the source code from https://github.com/pasky/pachi, spent a bit of time trying to build it and getting messages about "lib whatever not found", googling for "Ubuntu package whatever", install whatever came up, try again. It worked after I'd installed caffe-cuda, libcaffe-cuda-dev, libgflags-dev, libgoogle-glog-dev, libprotobuf-dev, protobuf-compiler, libatlas-base-dev, libboost-system-dev.

Configuration: It took a little while to realise that "pachi" and "pachi DCNN" are actually the same software, just with different configurations. The DCNN version is quite a bit stronger. For DCNN, you need the network from http://physik.de/CNNlast.tar.gz Pachi also comes with some alternative engines: you can type things like "pachi -e montecarlo" or "pachi -e patternplay". The other engines seem to be very weak.

Michi

Installation: I think this is an older version of pachi. Source code at https://github.com/db3108/michi-c2/releases It was just as easy to compile, except for one trick. Michi needs the pattern files from http://pachi.or.cz/michi-pat/ Then it looks for the pattern files in the current working directory that it's launched from, and there's no configuration option to change that. If you want to install the pattern files somewhere else, then in the source code you need to open the file ui.c, find the string "patterns.prob", and add the pathname of where you're storing the files.

Configuration: Nothing to do here, just type "michi gtp" from the command line and you're good to go.

Fuego

Installation: This one was painful. I used subversion to get the source code, with the command line "svn checkout svn://svn.code.sf.net/p/fuego/code/trunk". Compilation gave a ton of error messages. Here are some links that helped:
http://fuego.sourceforge.net/mac-install.html
https://unixnme.blogspot.com/2016/01/ho ... -1404.html
https://stackoverflow.com/questions/199 ... mmand-line
https://www.reddit.com/r/cbaduk/comment ... uego_code/

Configuration: Not much to do. Make sure it can find its opening book, but I think the installer put the book in the right place (once I'd sorted out the compilation issues).

Oakfoam

Installation: Like pachi, this one can work with or without DCNN. Unlike pachi, it's pretty hopeless without, and you need to recompile it to work with. For the non-DCNN version, there's a prebuilt package at http://oakfoam.com/, and you can install it with the command line "dpkg -i oakfoam_0.1.3-1_amd64.deb". For DCNN, I got the newer version from https://bitbucket.org/dsmic/oakfoam There were a few issues with compiling it. In the Makefile, find the "aclocal" line and change the version number from 1.14 to 1.15. I needed to install the "nvidia-cuda-dev" package as a dependency. And you have to tell it to use the caffe libraries: run "./configure --with-caffe=/usr/include/caffe" before compiling.

Configuration: This one comes with a configuration file called "nicego-cnn-06.gtp" which contains some gtp commands. The file tells it where to load the pattern files and weights. You'll need to edit that file and put in the correct pathnames for your installation. Then run it with "oakfoam -c path/to/nicego-cnn-06.gtp"

Leela

This was easy, except for one trick. There's a Debian package with prebuilt binaries at https://sjeng.org/leela.html Use "leela_gtp" to run in gtp mode, or LeelaGUI to open a nice interface for analysis. The trick is: I couldn't figure out why it wasn't using my graphics gard. There didn't seem to be any options for turning GPU mode on or off. It turns out that the GPU version is a separate pair of executables: if you have a graphics card, then you should use leela_gtp_opencl and LeelaGUI_OpenCL.

Leela Zero

Installation: Source code from https://github.com/gcp/leela-zero/releases Dependencies (Ubuntu packages): libboost-dev libboost-program-options-dev libopenblas-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev zlib1g-dev. Compile just by running "make" (no ./configure step needed). Easy. If you want a cpu-only version though, you need to hack and recompile. Open the file config.h and add a new line that says "#define USE_CPU_ONLY" just before the line "#ifndef USE_CPU_ONLY", and then compile it again.

Configuration: You need a set of weights. There seems to be a gazillion weights files out there, and multiple teams making new ones every week. The Leela Zero weights are at https://zero.sjeng.org/ The file are gzipped, but there's no need to unzip them, Leela Zero can already read them in this format. The Facebook ELF weights are http://zero.sjeng.org/networks/62b5417b ... 97df4b9.gz The "Leela Master" weights (trained on some human games as well as self-play) are at https://github.com/pangafu/LeelaMasterWeight I think there's also Phoenix weights out there somewhere. Run "leelaz --gtp -w /path/to/weightsfile".

AQ

Installation: The .tar.gz file at https://github.com/ymgaq/AQ/releases is a prebuilt binary, just unpack it, and then run the executable called AQ. The bad news is that AQ requires the CUDA version 8 libraries (it needs to be exactly v8, not "v8 or newer", and Ubuntu 18 only has CUDA version 9. The good news is that the download includes the library files. The annoying news is that you have to tell Ubuntu where to find the libraries. You do this by creating a file called /etc/ld.so.conf.d/cuda8.conf which contains exactly one line, that line being the path where you unpacked AQ (e.g. "/opt/AQ"), and then you run "sudo ldconfig".

Configuration: I haven't got this to work yet. It keeps crashing when it gets GTP commands to change the time settings. I think you can set the time limits using a config file, but I don't know how to stop gogui-twogtp from sending time commands anyway.

Ray

Source code at https://github.com/zakki/Ray/ I gave up on this one. It depends on the CNTK libraries. CNTK is massive, and it looks like installing it in a clean way would be a week's work in itself. (Microsoft provide a binary installer, but it's packaged together with a whole lot of other stuff that I don't want.)

Darkgo

Work in progress. Home page at https://pjreddie.com/darknet/darkgo-go-in-darknet/ and source code at https://github.com/pjreddie/darknet It looks like I need the NVidia CUDA toolkit as a dependency, and that's another big install, but I'll probably get around to it at some stage.

Other things I might try over the next couple of weeks: Dream Go https://github.com/Chicoryn/dream-go , Facebook ELF https://github.com/pytorch/ELF , PhoenixGo https://github.com/Tencent/PhoenixGo, LZ dynamic komi version (for playing handicap games) https://github.com/alreadydone/lz/tree/komi , and I'm open to other suggestions.


This post by xela was liked by 6 people: Bill Spight, Drew, emeraldemon, ez4u, pnprog, Waylon
Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #2 Posted: Fri Sep 07, 2018 11:51 pm 
Lives with ko

Posts: 176
Liked others: 15
Was liked: 23
Rank: Beginner
xela wrote:
Fuego
Configuration: Not much to do. Make sure it can find its opening book, but I think the installer put the book in the right place (once I'd sorted out the compilation issues).


You can setup a config file for Fuego and load it by command line: fuego.exe –config fuego.cfg:

Code:
uct_param_search number_threads 1
uct_param_search lock_free 0
uct_max_memory 1024000000
uct_param_player reuse_subtree 1
uct_param_player ponder 0
uct_param_player early_pass 1

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #3 Posted: Sun Sep 09, 2018 6:49 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
xela wrote:
I've decided to try out a few of the latest go-playing engines, as well a a few golden oldies. I plan to do something along vaguely similar lines to the engine tournament https://www.lifein19x19.com/viewtopic.php?f=18&t=13322 but using BayesElo for rankings. I'll post results in a separate thread, if I get that far.

Installing and configuring some of the engines has been a bit of an adventure in itself. I've learned a few things over the past few days, so I should write some of this down before I forget it all again.

I'm using Ubuntu 18.o4.
Excellent work! thank you so much! :tmbup:

Especially for AQ, I will try as soon as possible :bow: :bow: :bow:

I suggest that you send patch/commit/PR to those projects on Github by adding those instructions in their README.md
In fact, I had figured out how to compile Pachi on Ubuntu a few weeks ago, then sent a PR that was accepted. Those developers are very happy to received such PR that help increase visibility for their projects.

xela wrote:
Ray

Source code at https://github.com/zakki/Ray/ I gave up on this one. It depends on the CNTK libraries. CNTK is massive, and it looks like installing it in a clean way would be a week's work in itself. (Microsoft provide a binary installer, but it's packaged together with a whole lot of other stuff that I don't want.)
I haven't been able to crack that one neither, but the latest version does not use CNTK/CUDA any more and now uses OpenCL. This was confirmed by the developer. The make file only needs to be updated apparently.

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #4 Posted: Tue Sep 11, 2018 5:34 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
as0770 wrote:
You can setup a config file for Fuego and load it by command line: fuego.exe –config fuego.cfg:


Thanks! I've found a little fuego manual at http://svn.code.sf.net/p/fuego/code/tru ... index.html

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #5 Posted: Tue Sep 11, 2018 5:42 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
pnprog wrote:
Ray
I haven't been able to crack that one neither, but the latest version does not use CNTK/CUDA any more and now uses OpenCL. This was confirmed by the developer. The make file only needs to be updated apparently.

Unfortunately that is not actually true. I've just downloaded the most recent version of the source code. The file UctSearch.cpp is full of references to CNTK. Changing the makefile isn't going to fix that. I don't understand the developer's comment.

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #6 Posted: Tue Sep 11, 2018 5:57 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
I've managed to compile DarkGo now, but I can't get it to play a good game. As black, it makes beginner moves. As white, it just passes all the time. In either case it causes my GPU to make an alarming whistling sound, which doesn't happen with any of the other engines.

Compiling was easy once I got the nvidia CUDA toolkit installed. But installing the toolkit was a bit interesting, as it's not officially supported in Ubuntu 18.04. I decided to use version 9.1, as this works with driver version 390 (the latest stable one); 9.2 is available but requires updating to a newer driver that I don't trust yet. The instructions at https://www.pugetsystems.com/labs/hpc/H ... 8-04-1184/ and https://devtalk.nvidia.com/default/topi ... tu-18-04/1 between them had everything I needed.

To run DarkGo as a GTP engine, you need a command line that looks like "/opt/darkgo/darknet/darknet go engine /opt/darkgo/darknet/cfg/go.test.cfg /opt/darkgo/go.weights" (change /opt/darkgo to a different path if needed). The trick is to use the "engine" keyword (as opposed to one of train, test or valid, which is what the documentation tells you to do).

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #7 Posted: Wed Sep 12, 2018 2:58 am 
Beginner

Posts: 11
Liked others: 0
Was liked: 3
xela wrote:
pnprog wrote:
Ray
I haven't been able to crack that one neither, but the latest version does not use CNTK/CUDA any more and now uses OpenCL. This was confirmed by the developer. The make file only needs to be updated apparently.

Unfortunately that is not actually true. I've just downloaded the most recent version of the source code. The file UctSearch.cpp is full of references to CNTK. Changing the makefile isn't going to fix that. I don't understand the developer's comment.


That is issue about lz branch.
But lz branch has no Makefile/CMakeFile now.


This post by zakki was liked by: pnprog
Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #8 Posted: Wed Sep 12, 2018 6:17 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
zakki wrote:
That is issue about lz branch.
But lz branch has no Makefile/CMakeFile now.


Hi, thanks for replying here! My mistake, I was still trying with the nn branch. I'm new to github, so it took a little while to figure out how I could download a specific branch. The command line
Code:
git clone https://github.com/zakki/Ray.git --branch lz --single-branch .
seemed to do what I wanted.

I've managed to compile the lz branch now, but I haven't tried playing a game with it yet. I'll test it later in the week. I've attached my Makefile to your github issue.


This post by xela was liked by: pnprog
Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #9 Posted: Wed Sep 12, 2018 7:52 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
xela wrote:
I've managed to compile the lz branch now, but I haven't tried playing a game with it yet. I'll test it later in the week. I've attached my Makefile to your github issue.
Excellent! :tmbup:

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #10 Posted: Sun Sep 16, 2018 6:40 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
OK, I can report that ray (lz branch) is happily reading LZ weight files and playing games.

@zakki, can you explain how using Ray with LZ weights is different from using LZ with the same weights?

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #11 Posted: Mon Sep 17, 2018 9:45 pm 
Beginner

Posts: 11
Liked others: 0
Was liked: 3
xela wrote:
@zakki, can you explain how using Ray with LZ weights is different from using LZ with the same weights?


RLO is experimental branch to understand how AlphaGo Zero style policy and value network behave, and to experiment integrating monte carlo playout to AGZ's dual network.

It has some advantage in end game and ladder, but LeelaZero plays better in most case.
Latest value network seems to much precise than Ray's playout and AlphaGo Fan style APV-MCTS doesn't work well. Maybe another algorithm or more tuning are needed.

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #12 Posted: Tue Sep 25, 2018 7:48 pm 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
DreamGo

Installation: Currently, the "released" versions don't support GTP time controls, so at https://github.com/Chicoryn/dream-go you should ignore the "releases" tab and check out the most recent version using Git. (This should change soon!) It's written in the Rust programming language, so the usual make/gcc tools won't compile it. Instead, here's what I did:

  1. Install CUDNN from https://developer.nvidia.com/rdp/cudnn-download You'll need to sign up for a free NVidia developer account. This is sometimes painful, because their web site doesn't always work (if you don't get a confirmation email within a few minutes of registering, then clear your browser cache and try again).
  2. Install the rust compiler (stable version) by following the instructions at https://www.rust-lang.org/en-US/install.html
  3. Install the rust compiler ("nightly" version) by typing the command line
    Code:
    rustup install nightly
  4. cd to the directory where you cloned the git repository
  5. Type
    Code:
    rustup override add nightly
    followed by
    Code:
    cargo build
    The executable will be in the target/debug subdirectory
  6. Download the weights file attached as dream_go.json.zip at https://github.com/Chicoryn/dream-go/is ... -421859306 and unzip it into the same directory as the executable.

Configuration: Just run the executable. It understands the usual gtp commands.

Facebook ELF

Installation: The instructions at https://github.com/pytorch/ELF are pretty detailed. If you follow them exactly then you shouldn't have any problems. If you want to use Ubuntu's default python/pip installation instead of conda though, it gets a little more complicated. First you'll need to install python3-pip from the Ubuntu repositories. Then, I've posted some instructions at https://github.com/pytorch/ELF/issues/98

Configuration: There's a bunch of options that you can specify on the command line, again listed at https://github.com/pytorch/ELF . I've had some trouble getting it to play at the same speed as other engines (so that I can do engine vs engine matches on a fair basis). On my machine, if I set mcts_rollout_per_thread to 80, then it plays about 280 moves per minute, just right for 1-minute games. So I thought that mcts_rollout_per_thread=400 would give me a five-minute game. No. It takes 2-3 seconds per move for the first 50 or 60 moves, then suddenly slows down a lot (between 7 and 30 seconds per move). I tried a few variations, then gave up because once in a while it crashes and hangs my machine. Maybe it's triggering a bug in my NVidia graphics driver? I might try again when the next stable driver version comes out.

Phoenix Go

I gave up on this one. I tried following the instructions at https://github.com/Tencent/PhoenixGo The problem is that it uses bazel as its build system, which is new to me, so I'm not well qualified to troubleshoot the problems. Bazel will download a few hundred megabytes of stuff, then try to build TensorFlow configured according to the selected PhoenixGo options, spit out a bunch of compiler warnings, then fail on one of the TensorFlow components. I didn't want to keep retrying it because it's downloading an awful lot of stuff each time. I did find some old forum posts saying that TensorFlow won't work with bazel version 12 or 13, so you should use bazel 11. I tried that, as well as the newest bazel (version 17), with the same results each time.

Leela Zero with Phoenix weights needs a modified version of LZ. Get it from https://github.com/yenw/LeelaZero_PhoenixGo Building it is just the same as building the regular LZ, easy.


This post by xela was liked by: pnprog
Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #13 Posted: Wed Sep 26, 2018 11:22 am 
Lives with ko
User avatar

Posts: 285
Location: Illinois
Liked others: 221
Was liked: 78
Rank: infant
Thank you for your hard work, xela.

Unless you're running into post length limits, please add your most recent post to your first post to keep it all summarized in the opener. I think that would be best.

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #14 Posted: Mon Oct 01, 2018 4:21 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
Hi!
xela wrote:
AQ

Installation: The .tar.gz file at https://github.com/ymgaq/AQ/releases is a prebuilt binary, just unpack it, and then run the executable called AQ. The bad news is that AQ requires the CUDA version 8 libraries (it needs to be exactly v8, not "v8 or newer", and Ubuntu 18 only has CUDA version 9. The good news is that the download includes the library files. The annoying news is that you have to tell Ubuntu where to find the libraries. You do this by creating a file called /etc/ld.so.conf.d/cuda8.conf which contains exactly one line, that line being the path where you unpacked AQ (e.g. "/opt/AQ"), and then you run "sudo ldconfig".

Configuration: I haven't got this to work yet. It keeps crashing when it gets GTP commands to change the time settings. I think you can set the time limits using a config file, but I don't know how to stop gogui-twogtp from sending time commands anyway.
I managed to compile AQ, but the executable crash (segmentation fault) when sending "genmove" GTP command. I guess this is more an issue with my old Nvidia GPU that does not handle CUDA very well :sad:

xela wrote:
zakki wrote:
That is issue about lz branch.
But lz branch has no Makefile/CMakeFile now.


Hi, thanks for replying here! My mistake, I was still trying with the nn branch. I'm new to github, so it took a little while to figure out how I could download a specific branch. The command line
Code:
git clone https://github.com/zakki/Ray.git --branch lz --single-branch .
seemed to do what I wanted.

I've managed to compile the lz branch now, but I haven't tried playing a game with it yet. I'll test it later in the week. I've attached my Makefile to your github issue.
I compiled and ran Ray successfully using your makefile.
Although through compiling LeelaZero, Pachi and AQ, I had installed various library, there was one still missing for Ray that took me some time to find, the error was something like:
Code:
/usr/bin/x86_64-linux-gnu-ld : cannot find -lcblas
collect2: error: ld returned 1 exit status
Makefile:21: recipe for target 'ray' failed
make: *** [ray] Error 1
And the remedy:
Code:
sudo apt install libatlas-base-dev

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #15 Posted: Mon Oct 01, 2018 5:42 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
pnprog wrote:
Hi!

Hello, thanks for replying!

pnprog wrote:
Although through compiling LeelaZero, Pachi and AQ, I had installed various library, there was one still missing for Ray that took me some time to find, the error was something like:
Code:
/usr/bin/x86_64-linux-gnu-ld : cannot find -lcblas
collect2: error: ld returned 1 exit status
Makefile:21: recipe for target 'ray' failed
make: *** [ray] Error 1
And the remedy:
Code:
sudo apt install libatlas-base-dev


Interesting: I didn't get that error for Ray because I'd previously installed libatlas-base-dev as a dependency for Pachi. I wonder how you managed to compile Pachi without it?

Also, I've recently changed Ray to add a command line option "--weights", so that you can easily switch between different weight files. My changes were merged into zakki's github repository just a couple of days ago, so if you don't have the --weights option then you might want to download the latest version of the lz branch and recompile.

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #16 Posted: Mon Oct 01, 2018 10:09 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
xela wrote:
Interesting: I didn't get that error for Ray because I'd previously installed libatlas-base-dev as a dependency for Pachi. I wonder how you managed to compile Pachi without it?
For Ray, the installation process for Ubuntu has been added to the readme.m:
Code:
sudo apt install git make gcc g++ libcaffe-cpu-dev libboost-all-dev libgflags-dev libgoogle-glog-dev libprotobuf-dev libopenblas-dev
git clone https://github.com/pasky/pachi.git
cd pachi
make
My guess is that libatlas-base-dev provides the cblas component for Ray, and some other components necessary for Pachi that can be also provided by libopenblas-dev. So libatlas-base-dev or libopenblas-dev are both working for Pachi, but only libatlas-base-dev works for Ray. I will take time to try AQ and Ray from fresh Ubuntu install to see what exactly are the minimal dependencies required.

xela wrote:
Also, I've recently changed Ray to add a command line option "--weights", so that you can easily switch between different weight files. My changes were merged into zakki's github repository just a couple of days ago, so if you don't have the --weights option then you might want to download the latest version of the lz branch and recompile.
Oh that's an useful option (and I have it on my current copy of Ray). With that, several profiles for Ray can be added to GTP programs while having only one copy of Ray. Thanks :salute:

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #17 Posted: Wed Oct 10, 2018 5:17 am 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
I've now managed to compile a non-crashing version of AQ! The trick, at least for me, was to change a few lines of the source code, as detailed at https://github.com/ymgaq/AQ/issues/73

Compiling this one was a pain, but all of the pain comes from TensorFlow, not from AQ itself. (I'm told that TensorFlow is actually pretty easy to set up if you want to call it from Python. It's the mix of TensorFlow and C++ that gets complicated.) The README file tells you to follow these instructions, but that's more a collection of hints than detailed instructions, and it's missing a detail that was essential for me (see note 3 below).

So let's say you've created ~/tensorflow, cloned the github repository in there as per the the instructions (all 400+ megabytes of it), making sure to do it recursively (git clone --recursive https://github.com/tensorflow/tensorflow), and unpacked the AQ source code to ~/tensorflow/tensorflow/AQ-2.1.1. And you've managed to install the latest bazel (currently version 17), and NVidia's CUDA, CUDNN and NCCL as dependencies. Now you need to do something like this:

Code:
cd ~/tensorflow
./configure # see note 1
cd tensorflow/AQ-2.1.1/src
bazel build --config=monolithic :AQ # see notes 2 and 3
mv prob/* . # the *.txt files need to be in the same directory as aq_config.txt
find ~/.cache/bazel -name AQ
mv the_long_pathname_that_contains_runfiles/AQ .

and then you should be able to run your executable ~/tensorflow/tensorflow/AQ-2.1.1/AQ Remember that you can change configuration options by editing the aq_config.txt file.

Note 1: the configure script will ask you a lot of annoying questions, including your CUDA version and where you installed the libraries. Where it's asking whether to support something you've never heard of, it seems that it's safe to say no, and most of the defaults worked OK.

Note 2: bazel will download a few hundred megabyes of dependencies without asking you, and will create about three gigabytes of files in a hidden cache directory. The download-build-and-leave-junk-behind process took about 20 minutes on my machine.

Note 3: I don't know what the "monolithic" bit actually does (the bazel documentation isn't very informative here), but without it I get a bunch of "symbol not defined" errors. I got the idea of including it from https://github.com/tensorflow/tensorflow/issues/18739


This post by xela was liked by: pnprog
Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #18 Posted: Wed Oct 10, 2018 8:13 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
xela wrote:
I've now managed to compile a non-crashing version of AQ!
The whole procedure seems pretty scarry :o
I will see if I can git it a try, but with the poor internet connection here, I am not confident I can make it.
Plus I am getting very low on disk free space.

But anyway, thanks for the (successful) effort, and sharing the methodology with us :salute:

By the way, keep in mind that AQ is trained for 6.5pt komi (and Japanese rules). For instance, in a 7.5pt komi game, AQ's value network might tell white is losing by 0.5pt while it is winning by 0.5pt in fact, and because of that, AQ may very forfeit the game (or start playing strange moves like AlphaGo VS LeeSedol game four). As black, AQ might very well happily let the opponent win by 0.5pt (believing black is wining) by loosing 0.5pt in a yose where it could have been avoided. It may select wrong jose move due to Japanese rules as well.

I just say that in case you intend to have AQ enter your tournament.

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #19 Posted: Fri Oct 12, 2018 9:36 pm 
Dies in gote

Posts: 39
Location: Adelaide, South Australia
Liked others: 4
Was liked: 32
Rank: Australian 2 dan
GD Posts: 200
pnprog wrote:
By the way, keep in mind that AQ is trained for 6.5pt komi (and Japanese rules).

Thanks for the heads up. It's strange that the default configuration has "japanese rule = off" and "komi = 7.5".

pnprog wrote:
I just say that in case you intend to have AQ enter your tournament.

I don't think I can do anything about it. I'll just enter it in the ranking list anyway. and unfortunately it will be at a slight disadvantage. I don't imagine it would make a huge difference, probably less than 100 rating points?

Top
 Profile  
 
Offline
 Post subject: Re: Compiling some engines for linux
Post #20 Posted: Sat Oct 13, 2018 3:36 am 
Lives with ko
User avatar

Posts: 282
Liked others: 93
Was liked: 148
Rank: OGS 7 kyu
xela wrote:
It's strange that the default configuration has "japanese rule = off" and "komi = 7.5".
Indeed it's strange.

xela wrote:
pnprog wrote:
I just say that in case you intend to have AQ enter your tournament.

I don't think I can do anything about it. I'll just enter it in the ranking list anyway. and unfortunately it will be at a slight disadvantage. I don't imagine it would make a huge difference, probably less than 100 rating points?
I cannot predict, but you can keep record of the number of games AQ looses by 0.5pt (normally AQ should resign before scoring). This is explained in the readme

_________________
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!


Last edited by pnprog on Sat Mar 16, 2019 9:46 am, edited 1 time in total.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group