Releases: QueensGambit/CrazyAra
CrazyAra 0.7.0
Notes
This is the first release after applying reinforcement learning to crazyhouse.
The release is mainly intended to be able to reproduce CrazyAra's moves from the 100 games between Multi-Variant-Stockfish (2019-12-03) and CrazyAra 0.7.0. All UCI-options for all binaries are set to the same defaults as in:
The neural network (see available models) should be downloaded separately and be put in the model
directory.
Speed improvements
- TensorRT support was added and is currently supported in the Linux release.
TensorRT results in about 2x higher NPS for model RISEv2 compared to the default CUDA/cuDNN backend.
Known issues
-
Long start-up times
- Loading model RISEv2 results in a long (~15-20s) constant start-up time on GPU due to inference optimization (MXNet #16173). The start-up time increases for higher batch-sizes and when TensorRT is enabled. If the default maximum start-up time for external GUIs (e.g. cutechess) is not increased, it can happen that the GUI kills the CrazyAra process because of not responding in time.
-
High memory consumption
- The memory consumption linearly increases over time and becomes relatively high (> 20 GB RAM) for more than 1 million nodes because the chess board position is currently stored in every node. As an intermediate solution, the UCI-Option
Nodes
can be used to define a maximum number of nodes for your system combined withAllow_Early_Stopping=true
.
- The memory consumption linearly increases over time and becomes relatively high (> 20 GB RAM) for more than 1 million nodes because the chess board position is currently stored in every node. As an intermediate solution, the UCI-Option
Miscellaneous
- Reinforcement learning functionality was disabled for all binaries but can be enabled using cmake with
-DUSE_RL=1
. For convenient installation it is recommend to use the Dockerfile installation:- https://github.com/QueensGambit/CrazyAra/tree/master/engine/src/rl
Note: NVIDIA-docker only runs on Linux systems (nvidia-docker #665).
- https://github.com/QueensGambit/CrazyAra/tree/master/engine/src/rl
./
was added to theLIBRARY_RUN_PATH
for all Linux binaries. Therefore the all shared object files should be detected automaticity and theLD_LIBRARY_PATH
must not be changed.
Changes to MCTS search
Use_TensorRT
was added which is set to true by default if the binary supports TensorRT inference.Centi_Node_Temperature
was added which controls the temperature on every node's policy distribution as an alternative to Dirichlet noise in tournament games. For low NPS system or short time controls it is recommend to reduceCenti_Node_Temperature
to e.g. 130 or 150.Allow_Early_Stopping
was added: if this option is false thenNodes
acts as a fixed number of nodes to reach. IfAllow_Early_Stopping
is true thenNodes
is treated at a maximum limit for nodes.- U-Value exploration factor was temporarily removed.
- Enhancing checks and captures was temporarily removed.
Available models
This release includes the 45th model update index during reinforcement learning and ~1 million generated self-play games. The model model-os-45-risev2.zip
was used during the 100 games with Multi-Variant-Stockfish:
The reinforcement learning loop was afterwards continued until ~ 2.5 million self-play games:
Elo progression during RL over 1 million games (800 Nodes / move)
Rank Name Elo +/- Games Score Draws
1 CrazyAra-0.7.0-Model-OS-45 98 31 500 63.7% 5.0%
2 CrazyAra-0.7.0-Model-OS-40 83 31 500 61.7% 3.8%
3 CrazyAra-0.7.0-Model-OS-50 78 30 500 61.0% 4.8%
4 CrazyAra-0.7.0-Model-OS-30 63 30 500 59.0% 4.8%
5 CrazyAra-0.7.0-Model-OS-35 39 30 500 55.6% 4.0%
6 CrazyAra-0.7.0-Model-OS-25 36 30 500 55.1% 4.2%
7 CrazyAra-0.7.0-Model-OS-19 10 30 500 51.5% 5.0%
8 CrazyAra-0.7.0-Model-OS-15 -15 30 500 47.9% 5.0%
9 CrazyAra-0.7.0-Model-OS-10 -43 30 500 43.8% 3.6%
10 CrazyAra-0.7.0-Model-OS-5 -121 32 500 33.3% 2.6%
11 CrazyAra-0.7.0-Model-OS-SL -271 40 500 17.4% 0.8%
2750 of 2750 games finished.
The model was initialized by training on 569,537 lichess.org crazyhouse games and was included in release 0.6.0:
Strength comparison between model-os-96-risev2
and model-os-45-risev2
:
TC: 800 nodes / move, Move Temp: 0.4, Move decay: 0.93, Opening suite: zh-equal-long-78.pgn
Score of CrazyAra-0.7.0-Model-OS-96 vs CrazyAra-0.7.0-Model-OS-45: 287 - 191 - 22 [0.596]
Elo difference: +67.5 +/- 30.4, LOS: 0.0 %, DrawRatio: 4.4 %
Inference libraries
The following inference libraries are used in each package (same as in strength eval 0.7.0 for reproduce-ability):
CrazyAra_0.7.0_Linux_CUDA_TensorRT.zip
- CUDA 10.1
- cuDNN 7.5.1.10
- TensorRT-5.1.5.0
CrazyAra_0.7.0_Linux_MKL.zip
- Intel MKL 20190502
CrazyAra_0.7.0_Win_CUDA.zip
- CUDA 10.1
- cuDNN 7.5.1.10
CrazyAra_0.7.0_Win_MKL.zip
- Intel MKL 20190502
The dll files for Windows are the same as in release 0.6.0. You can use the same dlls when moving them into a custom directory and adding this directory to the PATH
environment variable.
CrazyAra 0.6.0
Note: This release has been imported from CrazyAra-Engine/releases
.
Speed Improvements
This version marks the first C++ release of the CrazyAra engine.
The evaluated nodes per second increased by a factor of 4-10 compared to the last python version on GPU
and a factor of 2 or more when running on CPUs.
Improvements for MCTS search
- scaling of Q-value-thresh with respect to number of nodes
- reduction of U-divisor with respect to number of nodes
- cleaner time management which is state dependent
- check enhancement can be enabled for all nodes at regardless the search depth
- RISEv2 model is working efficiently now for GPU usage
Available models
This release also includes all model weights mentioned in our paper.
The model directory should be move to the same directory as the CrazyAra binary.
For metric comparison of the differnet models visit the corresponding wiki-page.
Regression tests
- Regression test on GPU using model 4-value-8-policy:
[TimeControl "180+2"]
Score of CrazyAra-0.6.0 vs CrazyAra-0.5.1: 42 - 8 - 0 [0.840]
Elo difference: 288.06 +/- 151.10
50 of 50 games finished.
- Regression test on bullet with CPU (IntelMKL) using RISEv2 with no opening suite but temperature of 0.05 as reported by @Matuiss2
Score of CrazyAra 0.6.0 vs CrazyAra 0.5.0: 152 - 23 - 2 [0.920]
Elo difference: 323 +/-
177 of 177 games finished.
2019-08-27: Added additional shared object files to CrazyAra_0.6.0_Linux_CUDA.zip
2019-08-27: Added additional shared object files to CrazyAra_0.6.0_Linux_MKL.zip
CrazyAra 0.5.1
Changes
- Updated model RiseV2_mobile to be loadable in MXNet 1.5.0 without errors
- Softmax-activation is now consistently applied after model inference
Update 2019.11.05: Updated UCI_Variant specification in crazyara.py
and added shell script for XBoard integration on OSX and other unix based systems (#23)
CrazyAra 0.5.0
Note
This releases contains new improved network weights and architectures which can also be flexibly used for older client versions (except RiseV2_mobille needs version >= 0.4.1).
Choose one of the following networks depending on your needs:
-
CrazyAra_0.5.0_4_value_8_policy.zip
- only trained on human games from lichess.org
- best suited for GPU usage
- performance on validation set
+ move prediction accuracy: 60.0%
+ combined loss: 1.21119
-
CrazyAra_0.5.0_RiseV2_mobile.zip
- only trained on human games from lichess.org
- optimized for CPU usage
- performance on validation set
+ move prediction accuracy: 60.3%
+ combined loss: 1.19246
-
CrazyAraFish_0.5.0_RiseV1.zip
- trained on human games from lichess.org and later fine-tuned on Stockfish 10 self played games
- best suited for GPU usage
- overall strongest move prediction in terms of move quality
- can return strange results for first few opening moves because it was trained using an opening suite and Stockfish's playstyle is relatively deterministic with same number of nodes
- performance on Stockfish's validation set
+ move prediction accuracy: 56.6% (before finetuning: 46.29%)
+ combined loss: 1.32689
Improvements for MCTS search
- Updated usage of transposition table
Miscellaneous
Improvements for hardware compatibility
- automatic reduction for UCI option number of threads depending on number of CPU cores
Improvements for UCI client (e.g. when used with WinBoard)
- client doesn't crash when a position with no legal move is given (e.g. stalemates which are exceptionally in crazyhouse).
- client handles switched order of
btime
beforewtime
Results
- Score of same network weights 4_value_8_policy running on GeForce GTX 1080 Ti
Score of CrazyAra-0.5.0 vs CrazyAra-0.4.1: 28 - 22 - 0 [0.560] [3 min / 40 moves]
Elo difference: 41.89 +/- 99.63, LOS: 80.19 %, DrawRatio: 0.0 %
50 of 100 games finished.
Update 2019.07.19: Added missing /
in relative config-file paths in release files.
CrazyAra 0.4.1
Note
- Put a neural network architecture file
model-<validation-loss>-<validation-accuracy>-symbol.json
in the directoryCrazyAra_0.4.1/model/symbol/
. - Put a neural network parameter file
model-<validation-loss>-<validation-accuracy>-<k-number-steps>.params
in the directoryCrazyAra_0.4.1/model/params/
.
New neural network weights & architecture are available in Release 0.5.0
Improvements for MCTS search
- Fixed bug when reusing Q-values from the search tree
- Disabled any pruning and properly reuse the previous search tree
Updated UCI parameters
- use_pruning (default: True -> False)
Deleted UCI parameters
- use_oscillating_cpuct
- check_mate_in_one
New UCI parameters
- enhance_checks (default: False)
- enhance_captures (default: False)
- centi_u_init_divisor (default: 100)
- use_transposition_table (default: True)
Miscellaneous
Improvement for engine in analysis mode
- fixed bug for analysing fen
position fen <fen_description>.fen
without any move information go depth X
command is now properly supported, wheredepth
denotes the maximum depth reached during MCTS search- made the directory for the neural network a customizable UCI parameter
model_architecture_dir
,model_weights_dir
. When set to "default" the configuration inDeepCrazyhouse/configs/main.config
is used instead
Compability updates
- constant
chess.BB_VOID
was renamed tochess.BB_EMPTY
for python-chess version > 0.27.X.
Now the value 0 is used instead to avoid any future complications ininput_representation.py
- NeuralNetAPI uses
os.path.split()
instead of relying on/
when loading the neural network
Results
- Score of same network weights with same NPS (~250) running on GeForce GTX 1080 Ti
Score of CrazyAraFish-0.4.1 vs CrazyAraFish-0.4.0: 39 - 10 - 1 [0.790] [3 min / 40 moves]
Elo difference: 230.16 +/- 126.78
50 of 50 games finished.
- Different network weights running on Intel®Core™i5-8250U CPU @ 1.60GHz×8
Score of CrazyAra-0.4.1 (RiseV2-mobile, ~135 NPS) vs CrazyAra-0.4.0 (RiseV1, ~70 NPS): 42 - 6 - 2 [0.86] [3 min / 40 moves]
Elo difference: 315.35 +/- 155.42
50 of 50 games finished
CrazyAra 0.4.0
This version went live on 2019.02.13 on lichess.org: https://lichess.org/@/CrazyAra
Please put the file model-1.25948-0.589-0246.params
from release CrazyAra 0.3.1 in the directory CrazyAra_0.4.0/model/params/
.
The weight file of the neural network is uploaded separately to avoid additional upload cost when only changing source code.
Improvements for MCTS search
Added conservative, pessimistic check for q-values along search path by adding:
q_future, indices = self.get_last_q_values()
Score of CrazyAraFish-0.4.0 vs CrazyAraFish-0.3.1: 21 - 9 - 0 [3 min/40 moves]
Elo difference: 147.19 +/- 147.79
30 of 30 games finished.
Additionally, major refactoring thanks to @Matuiss2.
2019.03.28: Updated default MCTS search parameter to "context": "cpu", "threads": 8, "batch_size": 8, "neural_net_services": 1
for better initial settings on most hardware.
2019.05.30: CrazyAra_0.4.0.zip
; mcts_agent.py
: Removed unused import of library gevent
. Updated version id.
CrazyAra 0.3.1
Please put the file model-1.25948-0.589-0246.params
in the directory CrazyAra_0.3.1/model/params/
.
The weight file of the neural network is uploaded separately to avoid additional upload cost when only changing source code.
Improvements for MCTS search
Higher NPS: from 250 NPS to 300 NPS on GTX1080ti
Added Options:
- enabled transposition table by connecting nodes which lead to the same position in the search tree
- time management regime by spending less time on obvious moves
- opening guarded moves to avoid exploration of moves < 5% for a given number of moves in the opening
- increasing cpuct value as described by recent DeepMind publication
Strength evaluation:
v0.3.1 played JannLee and other crayzhouse engines.
CrazyAra 0.3.0
Improvements for MCTS search
- Higher NPS: from 70 NPS to 250 NPS on GTX1080ti
- Added Options:
- Q-Value factor for final move
- MCTS-Search Pruning
- New time-management system based on movetime
- Clipping of low visited nodes
- Oscillating CPUCT during search
Score of CrazyAra-0.3.0 vs CrazyAra-0.2.0: 10 - 0 - 0 [1.000] (3 min/40 moves)
CrazyAra 0.2.0
This release contains all needed source files as well as the model-weights for running CrazyAra as an UCI engine.
CrazyAra runs using a python environment. Please visit the installation instructions at:
- https://github.com/QueensGambit/CrazyAra/wiki/Installation-Guide
in order to setup the engine in a chess GUI.