Engine settings - QueensGambit/CrazyAra GitHub Wiki

Engine settings Release 0.9.5.post0

  • General notice: All options with the prefix Centi are divided by 100 and express a floating number.
Parameter Description Type Default
Allow_Early_Stopping Allows to stop the search early during a match if a lot of nodes has been reused from the previous search. check true
Batch_Size Batch-Size which is used for neural network inference. spin 16
Centi_CPuct_Init Initial value for the CPuct exploration parameter. CPuct is used in the node selection formula. spin 250
Centi_Dirichlet_Epsilon Amount of Dirichlet noise which is applied to the policy distribution of the root node. A value 0 means that no Dirichlet noise is used. spin 0
Centi_Dirichlet_Alpha Alpha value for the Dirichlet noise which can be applied to the policy distribution of the root node. spin 20
Centi_Epsilon_Checks Percentage of how many random exploration simulations are performed. In this case unexplored checking moves are explored first. spin 1
Centi_Epsilon_Greedy Percentage of how many random exploration simulations are performed during the search. Random sampling starts after every node legal action has been visited at least once. spin 5
Centi_Node_Temperature Temperature scaling which is applied on to the policy distribution. A value < 100 sharpens the distribution in results in a deeper search, while a value > 100 flattens distributions and results in a broader search. A value of 100 applies no effect. spin 170
Centi_Q_Value_Weight Weighting parameter of using the Q-Value for move selection after the MCTS search has been performed. The Q-Values are only considered for the top 1 and top 2 candidate move. A value of 0 means that only simulation counts are used for final move selection. spin 100
Centi_Quantile_Clipping Sets the probability of the final search result for all moves with in the given lower quantil to 0. This option can be used to avoid sampling blunder moves on accident if Temperature_Moves != 0. A value of 0 has no effect. spin 25
Centi_Random_Move_Factor Adds a or substract a random amount of the pre-defined move time. This can be used to increase the diversity of games e.g. during RL. A value of 0 has no effect. spin 0
Centi_Temperature Temperature scaling applied on the move selection distribution after the search. A value of 100 has no effect. A value < 100 sharpens the distribution while a value > 100 falttens the distribution. spin 170
Centi_Temperature_Decay Exponential decay applied on the initial Centi_Temperature parameter. The decay is applied after every move by Black. A value of 100 applies no decay. spin 92
Centi_U_Init_Divisor Parameter used for dividing the U-Values in the node selection formula to avoid division by 0. spin 100
Centi_Virtual_Loss Amount of virtual losses applied while creating a batch during the search. spin 100
Context Computation context where the neural inference is performed. Only available for the MXNet mode with GPU enabled. (Options: "gpu", "cpu"). combo gpu
CPuct_Base Hyperparemeter for increasing the Cpuct search parameter during the search. spin 19652
First_Device_ID Used for Multi-GPU systems to select the first GPU. All GPUs with indices First_Device_ID >= Index >= Last_Device_ID will be used during the search. A value of 0 refers to the first GPU. ⚠️ Changing to a new GPU requires generating a new trt-file (#76). spin 0
Fixed_Movetime Can be used to enforce a fixed movetime per move. Note that Move_Overhead is still taken into effect. A value of 0 disables this Option. spin 0
Last_Device_ID Used for Multi-GPU systems to select the last GPU. All GPUs with indices First_Device_ID >= Index >= Last_Device_ID will be used during the search. A value of 0 refers to the first GPU. ⚠️ Changing to a new GPU requires generating a new trt-file (#76). spin 0
Log_File Log file where the UCI communcication can be stored. string
Max_Search_Depth Currently disabled. There is no limit of the search depth. spin 99
MCTS_Solver Enables or disables the terminal solver for finding forced mates, draws, or table base entry points. check true
Model_Directory Directory where the neural network is being searched. Note that the default path loads the neural network relative to the current working directory. string model/crazyhouse
Move_Overhead Assumed move overhead in ms for every move. spin 20
MultiPV Enables mulitiple principal variations during the search. The variations are ordered according to preference. spin 1
Nodes Can be used to enforce a fixed number of nodes per move. A value of 0 disables this Option. Note that multiple terminal simulations are not counted as additional nodes. spin 0
Nodes_Limit Defines a maximum number of nodes to remain in RAM limit. Compared to Nodes the given amount of nodes is not enforced to be reached. A value of 0 disables this Option. Note that multiple terminal simulations are not counted as additional nodes. spin 0
Precision Precision used for neural network inference. Float16 should result in faster inference time on all GPUs while resulting in almost no downside regarding the quality of inference result. Int8 results in faster inference time, especially on some GPUs as well on CPU only back-ends but comes with a noticeable quality decline of the inference result. ⚠️ Changing to a new precision requires generating a new trt-file on the TensorRT-backend. spin float16
Reuse_Tree Option to enable or disable reusing the search tree / search graph for future searches. check true
Temperature_Moves Number of moves where temperature scaling and random sampling on the move selection distribution after the search is performed. A value of 0 means that always the best move according to the search is chosen. spin 0
Use_NPS_Time_Manager Enable or disables the time manager which is based on measuring the rolling average of the nodes per seconds. check true
Search_Type Search algorithm which is used for the search. MCTS relates to Monte-Carlo Tree Search without transposition table usage. MCGS relates to Monte-Carlo graph search which uses transpositions to join nodes for different search paths. combo mcgs
Simulations Can be used to enforce a fixed number of simulations per move. A value of 0 disables this Option. Note that multiple terminal simulations are not counted as simulations. Can be used in combination with Nodes > 0. Note that the number of nodes is always greater or equal to the number of nodes in the tree / graph. spin 0
SyzygyPath Path where the Syzygy tablebases are located. There exists Syzygy tablebases for chess, chess960, atomic and antichess. spin <empty>
Threads Number of threads that are used to allocate the mini-batch for each inference device, i.e. if multiple devices are used at once, the number of active threads is increased and is at least as much as the number of devices. If the MXNet-Backend is used, you may want to set the environment variable OMP_NUM_THREADS (default 4) to change the number of threads that are used for NN inference (#35). spin 2
Threads_NN_Inference Maximum number of threads to be used for neural network inference. ⚠️ Only available for OpenVino backend. spin 8
Timeout_MS Can be used to define a given time-out in milli-seconds in which the engine has to reply with readyok. This can be used e.g. on Multi-GPU systems when loading the neural network on all GPUs may take longer than the expected time-out of the tournament software. If 0, this functionality is disabled. spin 0
UCI_Variant Selected chess variant. Currently ClassicAra only support standard chess, while CrazyAra only support crazyhouse. combo crazyhouse / chess
Use_Raw_Network If active, the engine performs only one network evaluation and plays the legal move which has the highest value in the policy distribution. Note that the value evaluation is fully disregarded for move selection in this case. check false

Engine settings CrazyAra <=0.5.1 (Python)

The Monte-Carlo-Tree-Search runs playouts also called simulations in the search tree and updates the node statistics. final move is chosen according to the visit count of each direct child node. One playout is defined as expanding one new node in the tree. In the case of chess this means evaluating a new board position.

If the evaluation for one move takes too long on your hardware you can decrease the value for:

nb_playouts_empty_pockets and nb_playouts_filled_pockets.

For more details and the mathematical equations please take a look at src/domain/agent/README.md as well as the official DeepMind-papers.

engine_settings

Parameter Description
threads Number of threads to evaluate the nodes in parallel
playouts_empty_pockets Number of playouts/simulations which will be done if the Crazyhouse-Pockets of both players are empty.
playouts_filled_pockets Number of playouts/simulations which will be done if at least one player has a piece in its pocket. The number of legal-moves is higher when drop moves are available.
nb_playouts_update Number of playouts to process for updating the statistics like current_search_depth, current_search_time_s.
cpuct CPUCT-value which weights the balance between the policy/action and value term. The playstyle depends strongly on this value.
dirichlet_epsilon Weigh value for the dirichlet noise. If 0. -> no noise. If 1. -> complete noise. The dirichlet noise ensures that unlikely nodes can be explored
dirichlet_alpha Alpha parameter of the dirichlet noise which is applied to the prior policy for the current root node: https://en.wikipedia.org/wiki/Dirichlet_process
max_search_time_s Maximum number of seconds for which the network will evaluate the given position.
max_search_depth Maximum search depth to reach in the current search tree. If the depth has been reached the evaluation stops.
temperature The temperature parameters is an exponential scaling factor which is applied to the posterior policy. Afterwards the chosen move to play is sampled from this policy. Range: [0.,1.]: If 0. -> Deterministic policy. The move is chosen with the highest probability If 1. -> Pure random sampling policy. The move is sampled from the posterior without any scaling being applied.
clip_quantil A quantil clipping parameter with range [0., 1.]. All cummulated low percentages for moves are set to 0. This makes sure that very unlikely moves (blunders) are clipped after the exponential scaling.
virtual_loss An artificial loss term which is applied to each node which is currently being visited. This term make it look like that the current visit of this node led to +X losses where X is the virtual loss. This prevents that every thread will evaluate the same node.
threshold_time_for_raw_net_ms Number of time left to play in milliseconds at which the MCTS will be replaced by the raw network predictions. This should ensure that CrazyAra doesn't loose on time. If the time left in ms is higher than the threshold again, the MCTS will be reactivated.
⚠️ **GitHub.com Fallback** ⚠️