Sayuri is a GTP-compliant Go engine built on Deep Convolutional Neural Networks and Monte Carlo Tree Search. It learns to play Go from scratch using an AlphaZero-style algorithm, without any handcrafted human strategies. Inspired heavily by Leela Zero and KataGo, Sayuri initially borrowed its board data structures, search algorithms, and network format from Leela Zero. In later versions, the engine follows KataGo's research and now supports variable rulesets, komi settings, and board sizes.
For development insights and reports, see:
To run the engine, you need a executable weights first. The released weights can be got from this page. Then launching the engine with GTP mode via the terminal/PowerShell, using 1 thread and 400 visits per move with optimistic policy. Please type
$ ./sayuri -w <weights file> -t 1 -p 400 --use-optimistic-policy
After executing the command, you'll see diagnostic output. If this output includes Network Version
, it indicates that the engine is successfully running in GPT mode. However, since GPT mode isn't designed for human interaction, you should use the graphical interface (GUI) instead. Please refer to the Graphical Interface section for more details.
For a list of additional command-line arguments, use the --help option. Please type:
$ ./sayuri --help
The default engine uses a Chinese-like rule, which has a tendency to keep playing to remove some dead stones, even when their ownership of an area is clear. This can lead to unwanted capturing moves. To prevent these unnecessary moves, you have two options. First, while using the Chinese-like rule, add the --friendly-pass
option. Second, switch to a Japanese-like rule by using the --scoring-rule territory
option.
You can utilize the pure Python engine with a checkpoint model. The released checkpoint models could be found from this page. Although the Python engine is significantly weaker than the C++ engine, it makes running the raw model much easier. More detail you may see here.
$ python3 train/torch/pysayuri.py -c model.pt --use-swa
Sayuri is not complete engine. You need a graphical interface for playing with her. She supports any GTP (version 2) interface application. Sabaki and GoGui are recommended because Sayuri supports some specific analysis commands.
- Sabaki analysis mode
- GoGui analysis commands
For instructions on building from source, please refer to this section. If you are using Windows, you can download a precompiled executable directly from the release page.
Sayuri is a highly efficient self-play learning system for the game of Go that focuses on computational efficiency. In her v0.7 release, Sayuri’s training cost (represented by the purple line) is notably lower than that of both KataGo and Leela Zero. Compared to ELF OpenGo, Sayuri requires approximately 250× less computation. The complete training run was conducted in three months using a single RTX 4080 GPU. By comparison, KataGo’s g104 version reports a reduction of around 50×, making Sayuri’s efficiency improvement considerably larger.
For details on how to run the self-play loop, please refer to this guide.
- Go Text Protocol, https://www.gnu.org/software/gnugo/gnugo_19.html
- Leela Zero, https://github.com/leela-zero/leela-zero
- KataGo methods, https://github.com/lightvector/KataGo/blob/master/docs/KataGoMethods.md
- YouTube, playing with Pachi.
- Supported analysis commands, analyze.
- AlphaZero 之加速演算法實作 (v0.4~v0.5), describe some methods for old version.
The code is released under the GPLv3, except for threadpool.h, cppattributes.h, Eigen and Fast Float, which have specific licenses mentioned in those files.
[email protected] (Hung-Tse Lin)