Skip to content

Commit

Permalink
[update] README descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ymgaq committed May 8, 2020
1 parent 3712df7 commit f5d6384
Showing 1 changed file with 127 additions and 58 deletions.
185 changes: 127 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,142 @@
# AQ

AQ is a program of Go game with level of top players.
[CGOS](http://www.yss-aya.com/cgos/19x19/standings.html) rating: 3952 ([BayesElo](http://www.yss-aya.com/cgos/19x19/bayes.html))

## Requirement
### Windows
#### AQ (with GPU)
- OS: 64-bit Windows 7 or later (NOT tested on 8.1/10)
- GPU: Nvidia GPU with [CUDA capability](https://developer.nvidia.com/cuda-gpus) of >=3.0
- CPU: CPU with SSE 4.2

#### AQ-mini (with CPU only)
- OS: 64-bit Windows 7 or later (NOT tested on 8.1/10)
- CPU: CPU with SSE 4.2

### Linux
- OS: 64-bit Linux
- GPU: Nvidia GPU with [CUDA capability](https://developer.nvidia.com/cuda-gpus) of >=3.0
- CPU: CPU with SSE 4.2

## Usage
### Pre-compiled executables
Get them [here](http://github.com/ymgaq/AQ/releases).

### AQ configuration
Set hardware and time control etc. in 'aq_config.txt.'
#### Time control on CGOS
First of all, it is not recommended that users connect the released version as it is to CGOS. The developer is well aware of the capabilities of the released versions and [tested it in advance](http://www.yss-aya.com/cgos/19x19/cross/AQ-2.1.1-4t1g.html) with `4thread/1GPU: i7-6700/GTX1080`.
Of course, if you made your own changes to the source code or pb files, that is welcome. Please check your AQ's rating and send pull request!

The recommended settings are as follows.
# GLOBIS-AQZ

GLOBIS-AQZ is a Go game engine that uses Deep Learning technology.
It features support for both the Japanese rule with Komi 6.5 and the Chinese rule with Komi 7.5.

This program utilizes the results of the GLOBIS-AQZ project.

> GLOBIS-AQZ is a joint project developed by GLOBIS Corporation, Mr. Yu Yamaguchi, and Triple Eyes Corporation, provided by the National Institute of Advanced Industrial Science and Technology (AIST), and cooperated by the Nihon Ki-in. The program leverages the estimates in GLOBIS-AQZ.
Since it is open source software, anyone can use it for free.
This program is for playing and analyzing games, so please set it to GUI software such as [Lizzie](https://github.com/featurecat/lizzie), [Sabaki](https://github.com/SabakiHQ/Sabaki) and [GoGui](https://sourceforge.net/projects/gogui/).

日本語の説明は[こちら](https://github.com/ymgaq/AQ/blob/master/README_JP.md)をご覧ください。
请看[这里的](https://github.com/ymgaq/AQ/blob/master/README_CN.md)中文解释.

## 1. Downloads
Download it from [Releases](https://github.com/ymgaq/AQ/releases).
The executable file built on Windows 10 and Linux (Ubuntu 18.04) is available.

If it does not work as it is in other environments, please consider building it for each environment (for developers)

## 2. Requirements
+ OS : Windows 10, Linux
+ GPU : Nvidia's GPU ([Compute Capability](https://developer.nvidia.com/cuda-gpus) >3.0)
+ [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) 10.0 or 10.2
+ [TensorRT 7.0.0](https://docs.nvidia.com/deeplearning/sdk/tensorrt-archived/tensorrt-700/tensorrt-install-guide/index.html)

It has been tested in the following environment.
+ Ubuntu 18.04 / RTX2080Ti / CUDA10.0 / TensorRT7.0.0
+ Windows 10 Pro (64bit) / RTX2080Ti / CUDA10.2 / TensorRT7.0.0

## 3. How to use
For example, if you want to start GTP mode in the case of Japanese rule and with time settings of 20 minutes and 30-seconds byoyomi:
```
$ ./AQ.exe --rule=1 --komi=6.5 --main_time=1200 --byoyomi=30
```
With Chinese rule and Komi 7.5 (default), the number of searches (playouts) is fixed at 800 without ponder:
```
$ ./AQ.exe --search_limit=800 --use_ponder=off
```

### 3-1. Setting environment variables
In the case of Windows, the following path must be registered in the PATH environment variable.
```
-main time[sec] =900
-byoyomi[sec] =0
-emergency time[sec] =15 #set 60 when connecting from outside Japan
{your_cuda_path}\NVIDIA GPU Computing Toolkit\CUDA\v10.{x}\bin
{your_tensorrt_path}\TensorRT-7.0.0.{xx}\lib
```

!!!Caution!!! This version was trained in Komi = 6.5 for the Japanese rule. So, AQ often loses 0.5 point at Black, but that is inevitable.
### 3-2. Generating engine files
The first time it starts up, it generates a network engine optimized for your environment from a file in UFF (Universal File Format) format.
It may take a few minutes to generate this engine.
The serialized engine files are saved in the `engine` folder, so it will start immediately the second time around.

### GoGui setting
[GoGui](https://sourceforge.net/projects/gogui/files/gogui/1.4.9/) is a graphical interface to Go-engines (programs without own GUI), which use the Go Text Protocol (GTP).
See the 'GTP Shell' console to know AQ's thinking log.
#### Linux
command: `(install directory)/AQ`
### 3-3. Register with Lizzie
For Windows, add `{your_aq_folder}/AQ.exe --lizzie` to the engine command.
For example, if you want to analyze by Japanese rules, please modify the config.txt file in the AQ folder to use various settings.

## 4. Options
Here's a description of the main options.
It can be specified as a command line argument, or it can be changed by editing config.txt.
For example, `--komi=6.5`.

### 4-1. Game options
| Option | default | description |
| :--- | :--- | :--- |
| --num_gpus | 1 | The number of GPUs to use. |
| --num_threads | 16 | The number of threads to be used for searching. |
| --main_time | 0.0 | Main time of search (in seconds). |
| --byoyomi | 3.0 | Byoyomi (in seconds). |
| --rule | 0 | The rule of the game. 0: Chinese rule 1: Japanese rule 2: Tromp-Traylor rule |
| --komi | 7.5 | Number of Komi. In the case of Japanese rule, please specify 6.5. |
| --batch_size | 8 | The number of batches for a single evaluation. |
| --search_limit | -1 | The number of searches (playouts). -1 means this option is disable. |
| --node_size | 65536 | Maximum number of nodes of the search. When this number of nodes is reached, the search is terminated. |
| --use_ponder | on | Whether or not to read ahead in the opponent's turn. You must turn it on when using it in Lizzie. |
| --resign_value | 0.05 | the winning rate to be given up. |
| --save_log | off | Whether or not to save the game's thought logs and sgf files. |

### 4-2. Launch modes
Mainly for debugging. Please do not use any other games other than `--lizzie` for normal games and analysis.
They are only recognized as a command line argument.

| Option | Launch mode |
| :--- | :--- |
| (not specified) | GTP communication mode |
| --lizzie | In addition to GTP communication, it outputs information for Lizzie. |
| --self | It starts a self game. Use it with `---save_log=on`. |
| --policy_self | It starts a self game with the best move in policy networks. |
| --test | Tests the consistency of the board data structure, etc. |
| --benchmark | It measures the computational speed of rollouts and neural networks. |

## 5. Compilation method
The following is an explanation for developers.
The source code is implemented only for games and analysis, and does not include any learning functions.

AQ is written so that it can be compiled with C++11/C++14, and the coding conventions are generally referred to the following page.
+ [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html)

### 5-1. Linux
Requirements
+ gcc
+ make
+ CUDA Toolkit 10.x
+ TensorRT 7.0.0

Check the include path and library path of CUDA and TensorRT in the Makefile and make it.

```
(Ex.)
/home/user/gogui-1.4.9/AQ/AQ
$ make
```

#### Windows
command: `(install directory)\AQ.exe`
### 5-2. Windows
Requirements
+ Visual Studio 2019 (MSVC v142)
+ CUDA Toolkit 10.x
+ TensorRT 7.0.0

Additional include directories:
```
{your_cuda_path}\NVIDIA GPU Computing Toolkit\CUDA\v10.x\include
{your_tensorrt_path}\TensorRT-7.0.0.xx\include
```

Additional library directories:
```
(Ex.)
C:\Users\user\gogui-1.4.9\AQ\AQ.exe
{your_cuda_path}\NVIDIA GPU Computing Toolkit\CUDA\v10.x\lib\x64
{your_tensorrt_path}\TensorRT-7.0.0.xx\lib
```

## Build from source code
### Linux
Build with [bazel](https://bazel.build/) and [TensorFlow](https://www.tensorflow.org/).
See [this instruction](https://medium.com/jim-fleming/loading-a-tensorflow-graph-with-the-c-api-4caaff88463f).
### Windows
Build with [cmake](https://cmake.org/) and [TensorFlow](https://www.tensorflow.org/).
See [this instruction](https://joe-antognini.github.io/machine-learning/windows-tf-project).
Additional library files:
```
cudart.lib
nvparsers.lib
nvonnxparser.lib
nvinfer.lib
```

## License
[MIT](https://github.com/ymgaq/AQ/blob/master/LICENSE.txt)
Add each of the above and build it.

## Author
[Yu Yamaguchi](https://twitter.com/ymg_aq)
## 6. License
[GPL-3.0](https://github.com/ymgaq/AQ/blob/master/LICENSE.txt)
Author: [Yu Yamaguchi](https://twitter.com/ymg_aq)

0 comments on commit f5d6384

Please sign in to comment.