feat: add examples test

main v1.3.8
NoahLan 11 months ago
parent 316653fa66
commit db6f47474e

@ -0,0 +1,3 @@
examples/katago/*.bin.gz
examples/katago/**/gtp_logs
examples/katago/**/analysis_logs

@ -0,0 +1,101 @@
KataGo v1.12.3
https://github.com/lightvector/KataGo
For neural nets from the latest run, download from here:
https://katagotraining.org/
For nets from earlier runs, see:
https://d3dndmfyhecmj0.cloudfront.net/g170/neuralnets/index.html
This version v1.12 also supports a new neural net architecture. This architecture will likely be added to the latest run once enough contributors switch.
One such neural net has already been trained, "b18c384nbt-uec" which is available at https://github.com/lightvector/KataGo/releases/ and which is similar to the 60-block nets in prediction quality but depending on hardware may be faster than the 60-block nets, in some cases close to the 40-block nets' speed.
-----------------------------------------------------
USAGE:
-----------------------------------------------------
KataGo is just an engine and does not have its own graphical interface. So generally you will want to use KataGo along with a GUI or analysis program.
(https://github.com/lightvector/KataGo#guis)
FIRST: Run a command like this to make sure KataGo is working, with the neural net file you downloaded. On OpenCL, it will also tune for your GPU.
./katago.exe benchmark # if you have default_gtp.cfg and default_model.bin.gz
./katago.exe benchmark -model <NEURALNET>.bin.gz # if you have default_gtp.cfg
./katago.exe benchmark -model <NEURALNET>.bin.gz -config gtp_custom.cfg # use this .bin.gz neural net and this .cfg file
It will tell you a good number of threads. Edit your .cfg file and set "numSearchThreads" to that many to get best performance.
OR: Run this command to have KataGo generate a custom gtp config for you based on answering some questions:
./katago.exe genconfig -model <NEURALNET>.bin.gz -output gtp_custom.cfg
NEXT: A command like this will run KataGo's engine. This is the command to give to your [GUI or analysis program](#guis) so that it can run KataGo.
./katago.exe gtp # if you have default_gtp.cfg and default_model.bin.gz
./katago.exe gtp -model <NEURALNET>.bin.gz # if you have default_gtp.cfg
./katago.exe gtp -model <NEURALNET>.bin.gz -config gtp_custom.cfg # use this .bin.gz neural net and this .cfg file
You may need to specify different paths when entering KataGo's command for a GUI program, e.g.:
path/to/katago.exe gtp -model path/to/<NEURALNET>.bin.gz
path/to/katago.exe gtp -model path/to/<NEURALNET>.bin.gz -config path/to/gtp_custom.cfg
KataGo should be able to work with any GUI program that supports GTP, as well as any analysis program that supports Leela Zero's `lz-analyze` command, such as Lizzie (https://github.com/featurecat/lizzie) or Sabaki (https://sabaki.yichuanshen.de/).
NOTE:
If you encounter errors due to a missing "msvcp140.dll" or "msvcp140_1.dll" or "msvcp140_2.dll" or "vcruntime140.dll" or similar, you need to download and install the Microsoft Visual C++ Redistributable, here:
https://www.microsoft.com/en-us/download/details.aspx?id=48145
If this is for a 64-bit Windows version of KataGo, these dll files have already been included for you, otherwise you will need to install them yourself. On a 64-bit Windows version, there is a rare chance that you may need to delete them if you already have it installed yourself separately and the pre-included files are actually causing problems running KataGo.
Other things you can do:
Run a JSON-based analysis engine (https://github.com/lightvector/KataGo/blob/master/docs/Analysis_Engine.md) that can do efficient batched evaluations for a backend Go service:
./katago analysis -model <NEURALNET>.gz -config <ANALYSIS_CONFIG>.cfg
Run a high-performance match engine that will play a pool of bots against each other sharing the same GPU batches and CPUs with each other:
./katago match -config <MATCH_CONFIG>.cfg -log-file match.log -sgf-output-dir <DIR TO WRITE THE SGFS>
Force OpenCL tuner to re-tune:
./katago tuner -config <GTP_CONFIG>.cfg
Print version:
./katago version
-----------------------------------------------------
OPENCL VS CUDA VS EIGEN:
-----------------------------------------------------
Explanation of the various versions available at https://github.com/lightvector/KataGo/releases
OpenCL - Use this if you have a modern GPU and want the easiest setup.
TensorRT, CUDA11 - Try one of these if you have a top-end NVIDIA GPU, are willing to do some more technical setup work, and care about getting every bit of performance. It MIGHT OR MIGHT NOT be faster than OpenCL! You have to test it on your specific GPU. TensorRT requires CUDA11 as well, and is likely to be the fastest.
Eigen AVX2 - Use this if you have no good GPU, but you have an Intel or AMD CPU from the last several years. This is a pure CPU version of KataGo.
Eigen - Use this if you don't have a GPU or your GPU is too old to work, and your CPU turns out not to support AVX2 or FMA. This is a pure CPU version for KataGo for
This is the pure CPU version of KataGo, with no special instructions, which should hopefully run just about anywhere.
-----------------------------------------------------
TUNING FOR PERFORMANCE:
-----------------------------------------------------
You will very likely want to tune some of the parameters in `default_gtp.cfg` for your system for good performance, including the number of threads, fp16 usage, NN cache size, pondering settings, and so on. You can also adjust things like KataGo's resign threshold or utility function. Most of the relevant parameters should be be reasonably well documented directly inline in that config.
There are other a few notes about usage and performance at : https://github.com/lightvector/KataGo
-----------------------------------------------------
TROUBLESHOOTING:
-----------------------------------------------------
Some common issues are described here:
https://github.com/lightvector/KataGo#common-causes-of-errors
Or, feel free to hop into the Leela Zero discord chat, which has become a general chatroom for a variety of computer Go hobbyists and users, and which you can often find people willing to help.
https://discord.gg/fhDHgfk

@ -0,0 +1,388 @@
# Config for KataGo C++ Analysis engine, i.e. "./katago.exe analysis"
# Example config for C++ (non-python) analysis engine
# SEE NOTES ABOUT PERFORMANCE AND MEMORY USAGE IN gtp_example.cfg
# SEE NOTES ABOUT numSearchThreads AND OTHER IMPORTANT PARAMS BELOW!
# Logs------------------------------------------------------------------------------------
# Where to output log?
logDir = analysis_logs # Each run of KataGo will log to a separate file in this dir
# logDirDated = analysis_logs # Use this instead of logDir to also write separate dated subdirs
# logFile = analysis.log # Use this instead of logDir to just specify a single file directly
# logToStderr = true # Echo everything output to log file to stderr as well
# logAllRequests = false # Log all input lines received to the analysis engine.
# logAllResponses = false # Log all lines output to stdout from the analysis engine.
# logErrorsAndWarnings = true # Log all lines output to stdout from the analysis engine that are errors and warnings
# logSearchInfo = false # Log debug info for every search performed
# Analysis------------------------------------------------------------------------------------
# Controls the number of moves after the first move in a variation.
# analysisPVLen = 15
# Report winrates for analysis as (BLACK|WHITE|SIDETOMOVE).
reportAnalysisWinratesAs = BLACK
# Larger values will make KataGo explore the top move(s) less deeply and accurately,
# but explore and give evaluations to a greater variety of moves.
# An extreme value like 1 will distribute many playouts across every move on the board, even very bad moves.
# NOTE: defaults to 0.04, under the presumption that the analysis engine will be used mainly for analysis.
# If you are intending to use the analysis engine to also play games and you want to maximize playing strength,
# set this to 0.0 either in this config or in the overrides.
# wideRootNoise = 0.04
# Bot behavior---------------------------------------------------------------------------------------
# Handicap -------------
# Assume that if black makes many moves in a row right at the start of the game, then the game is a handicap game.
# This is necessary on some servers and for some GUIs and also when initializing from many SGF files, which may
# set up a handicap game using repeated GTP "play" commands for black rather than GTP "place_free_handicap" commands.
# However, it may also lead to incorrect understanding of komi if whiteHandicapBonus is used and a server does NOT
# have such a practice.
# Defaults to true! Uncomment and set to false to disable this behavior.
# assumeMultipleStartingBlackMovesAreHandicap = true
# Passing and cleanup -------------
# Make the bot never assume that its pass will end the game, even if passing would end and "win" under Tromp-Taylor rules.
# Usually this is a good idea when using it for analysis or playing on servers where scoring may be implemented non-tromp-taylorly.
# Defaults to true! Uncomment and set to false to disable this.
# conservativePass = true
# When using territory scoring, self-play games continue beyond two passes with special cleanup
# rules that may be confusing for human players. This option prevents the special cleanup phases from being
# reachable when using the bot for GTP play.
# Defaults to true! Uncomment and set to false if you want KataGo to be able to enter special cleanup.
# For example, if you are testing it against itself, or against another bot that has precisely implemented the rules
# documented at https://lightvector.github.io/KataGo/rules.html
# preventCleanupPhase = true
# Search limits-----------------------------------------------------------------------------------
# By default, if NOT specified in an individual request, limit maximum number of root visits per search to this much
maxVisits = 500
# If provided, cap search time at this many seconds
# maxTime = 60
# Search threads, batching, GPUs--------------------------------------------------------------------------
# Try a configuration like this if you only expect the engine to be handling a few queries at a time and you want
# individual queries to return more quickly, and are okay with the results being a bit lower-quality and the overall
# peak throughput on queries to be lower.
numAnalysisThreads = 2
numSearchThreadsPerAnalysisThread = 16
# Try a configuration like this if you expect to be sending large numbers of queries at a time, and want to maximize
# total throughput and also the evaluation quality of all the queries and you never care about the response latency
# of the individual queries, only the throughput as a whole.
# numAnalysisThreads = 32
# numSearchThreadsPerAnalysisThread = 1
# You will want to increase one or both numbers if you have a powerful GPU, and possibly decrease one or both if you
# have a very weak GPU, and play with the balance between them depending on your use case.
# Read the explanation below to understand how to set these parameters:
# EXPLANATION:
# numAnalysisThreads: the number of POSITIONS to be able to search in parallel.
# numSearchThreadsPerAnalysisThread: the number of threads to use in the tree search for EACH position.
# (older analysis configs might just have 'numSearchThreads', this is an alias for 'numSearchThreadsPerAnalysisThread')
# Therefore, the total number of search threads that may be active at a given time could be as large as the product:
# numAnalysisThreads * numSearchThreadsPerAnalysisThread
# Searching more positions in parallel is more efficient since the different threads aren't conflicting with each
# other on the same MCTS search tree. Using multiple threads on the same search will both make things slower
# and weaken the search (holding playouts fixed) due to out of date statistics on nodes and suboptimal exploration,
# although the cost is minor for only 2,4,8 threads.
# So unlike in GTP, which only ever searches one position at a time and where therefore you might as well make
# numSearchThreads as large as possible, in the analysis engine you often want you often want to keep numSearchThreads small,
# and instead parallelize across positions, so you can reduce conflict between threads and improve the overall throughput
# and strength of the search.
# But obviously you only get the benefit of parallelization across positions when you actually have lots of positions
# that you are querying at once! For example, setting numAnalysisThreads = 8 is useless if you only ever send one or two
# queries at a time!
# Therefore:
# * If you plan to use the analysis engine only for batch processing large numbers of positions,
# it's preferable to numSearchThreadsPerAnalysisThread to only a small number (e.g. 1,2,4) and use a higher numAnalysisThreads.
# * But if you sometimes plan to query the analysis engine for single positions, or otherwise in smaller quantities
# than -num-analysis-threads, or if you plan to be user-interactive such that the response time on some individual
# analysis requests is important to keep low, then set numSearchThreadsPerAnalysisThread to a larger number and use
# a lower numAnalysisThreads. That way, individual searches complete faster due to having more threads on each one.
# For 19x19 boards, weaker GPUs probably want a TOTAL number of threads (numAnalysisThreads * numSearchThreadsPerAnalysisThread)
# between 4 and 32. Mid-tier GPUs probably between 16 and 64. Strong GPUs probably between 32 and 256.
# But there's no substitute for experimenting and seeing what's best for your hardware and your usage case.
# Keep in mind that the number of threads you want does NOT necessarily have much to do with how many cores you have on your
# system. The optimal may easily exceed the number of cores! GPU batching is (usually) the dominant consideration.
# -------------
# nnMaxBatchSize is the max number of positions to send to a single GPU at once. Generally, it should be the case that:
# (number of GPUs you will use * nnMaxBatchSize) >= (numSearchThreads * num-analysis-threads)
# That way, when each threads tries to request a GPU eval, your batch size summed across GPUs is large enough to handle them
# all at once. However, it can be sensible to set this a little smaller if you are limited on GPU memory,
# too large a number may fail if the GPU doesn't have enough memory.
nnMaxBatchSize = 64
# Uncomment and set these smaller if you are going to use the analysis engine EXCLUSIVELY for smaller boards (or plan to
# run multiple instances, with some instances only handling smaller boards). It should improve performance.
# It may also mean you can use more threads profitably.
# maxBoardXSizeForNNBuffer = 19
# maxBoardYSizeForNNBuffer = 19
# Uncomment and set this to true if you are going to use the analysis engine EXCLUSIVELY for exactly the board size
# specified by maxBoardXSizeForNNBuffer and maxBoardYSizeForNNBuffer. It may slightly improve performance on some GPUs.
# requireMaxBoardSize = true
# TO USE MULTIPLE GPUS:
# Uncomment and set this to the number of GPUs you have and/or would like to use...
# AND if it is more than 1, uncomment the appropriate CUDA or OpenCL section below.
# numNNServerThreadsPerModel = 1
# Other General GPU Settings-------------------------------------------------------------------------------
# Cache up to 2 ** this many neural net evaluations in case of transpositions in the tree.
nnCacheSizePowerOfTwo = 23
# Size of mutex pool for nnCache is 2 ** this
nnMutexPoolSizePowerOfTwo = 17
# Randomize board orientation when running neural net evals?
nnRandomize = true
# TENSORRT GPU settings--------------------------------------
# These only apply when using the TENSORRT version of KataGo.
# IF USING ONE GPU: optionally uncomment and change this if the GPU you want to use turns out to be not device 0
# trtDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# IF USING THREE GPUS: Uncomment these three lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# trtDeviceToUseThread2 = 2 # change this if the third GPU you want to use turns out to be not device 2
# You can probably guess the pattern if you have four, five, etc. GPUs.
# CUDA-specific GPU settings--------------------------------------
# These only apply when using the CUDA version of KataGo.
# IF USING ONE GPU: optionally uncomment and change this if the GPU you want to use turns out to be not device 0
# cudaDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines (AND set numNNServerThreadsPerModel above):
# cudaDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# cudaDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# IF USING THREE GPUS: Uncomment these three lines (AND set numNNServerThreadsPerModel above):
# cudaDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# cudaDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# cudaDeviceToUseThread2 = 2 # change this if the third GPU you want to use turns out to be not device 2
# You can probably guess the pattern if you have four, five, etc. GPUs.
# KataGo will automatically use FP16 or not based on the compute capability of your NVIDIA GPU. If you
# want to try to force a particular behavior though you can uncomment these lines and change them
# to "true" or "false". E.g. it's using FP16 but on your card that's giving an error, or it's not using
# FP16 but you think it should.
# cudaUseFP16 = auto
# cudaUseNHWC = auto
# OpenCL-specific GPU settings--------------------------------------
# These only apply when using the OpenCL version of KataGo.
# Uncomment to tune OpenCL for every board size separately, rather than only the largest possible size
# openclReTunePerBoardSize = true
# IF USING ONE GPU: optionally uncomment and change this if the best device to use is guessed incorrectly.
# The default behavior tries to guess the 'best' GPU or device on your system to use, usually it will be a good guess.
# openclDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines and replace X and Y with the device ids of the devices you want to use.
# It might NOT be 0 and 1, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# IF USING THREE GPUS: Uncomment these three lines and replace X and Y and Z with the device ids of the devices you want to use.
# It might NOT be 0 and 1 and 2, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# openclDeviceToUseThread2 = Z
# You can probably guess the pattern if you have four, five, etc. GPUs.
# KataGo will automatically use FP16 or not based on testing your GPU during tuning. If you
# want to try to force a particular behavior though you can uncomment this lines and change it
# to "true" or "false". This is a fairly blunt setting - more detailed settings are testable
# by rerunning the tuner with various arguments.
# openclUseFP16 = auto
# Eigen-specific settings--------------------------------------
# These only apply when using the Eigen (pure CPU) version of KataGo.
# This is the number of CPU threads for evaluating the neural net on the Eigen backend.
# It defaults to min(numAnalysisThreads * numSearchThreadsPerAnalysisThread, numCPUCores).
# numEigenThreadsPerModel = X
# Misc Behavior --------------------
# If the board is symmetric, search only one copy of each equivalent move. Attempts to also account for ko/superko, will not theoretically perfect for superko.
# Uncomment and set to false to disable this.
# rootSymmetryPruning = true
# Uncomment and set to true to make KataGo avoid a particular joseki that some KataGo nets misevaluate,
# and also to improve opening diversity versus some particular other bots that like to play it all the time.
# avoidMYTDaggerHack = false
# Have KataGo mildly prefer to avoid playing the same joseki in every corner of the board.
# Uncomment to set to a specific value. A small value like 0.005 should produce already a noticeable behavior change.
# avoidRepeatedPatternUtility = 0.0
# Root move selection and biases------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Not all of these parameters are applicable to analysis, some are only used for actual play
# Temperature for the early game, randomize between chosen moves with this temperature
# chosenMoveTemperatureEarly = 0.5
# Decay temperature for the early game by 0.5 every this many moves, scaled with board size.
# chosenMoveTemperatureHalflife = 19
# At the end of search after the early game, randomize between chosen moves with this temperature
# chosenMoveTemperature = 0.10
# Subtract this many visits from each move prior to applying chosenMoveTemperature
# (unless all moves have too few visits) to downweight unlikely moves
# chosenMoveSubtract = 0
# The same as chosenMoveSubtract but only prunes moves that fall below the threshold, does not affect moves above
# chosenMovePrune = 1
# Number of symmetries to sample (WITHOUT replacement) and average at the root
# rootNumSymmetriesToSample = 1
# Using LCB for move selection?
# useLcbForSelection = true
# How many stdevs a move needs to be better than another for LCB selection
# lcbStdevs = 5.0
# Only use LCB override when a move has this proportion of visits as the top move
# minVisitPropForLCB = 0.15
# Internal params------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Scales the utility of winning/losing
# winLossUtilityFactor = 1.0
# Scales the utility for trying to maximize score
# staticScoreUtilityFactor = 0.10
# dynamicScoreUtilityFactor = 0.30
# Adjust dynamic score center this proportion of the way towards zero, capped at a reasonable amount.
# dynamicScoreCenterZeroWeight = 0.20
# dynamicScoreCenterScale = 0.75
# The utility of getting a "no result" due to triple ko or other long cycle in non-superko rulesets (-1 to 1)
# noResultUtilityForWhite = 0.0
# The number of wins that a draw counts as, for white. (0 to 1)
# drawEquivalentWinsForWhite = 0.5
# Exploration constant for mcts
# cpuctExploration = 1.0
# cpuctExplorationLog = 0.45
# Parameters that control exploring more in volatile positions, exploring less in stable positions.
# cpuctUtilityStdevPrior = 0.40
# cpuctUtilityStdevPriorWeight = 2.0
# cpuctUtilityStdevScale = 0.85
# FPU reduction constant for mcts
# fpuReductionMax = 0.2
# rootFpuReductionMax = 0.1
# fpuParentWeightByVisitedPolicy = true
# Parameters that control weighting of evals based on the net's own self-reported uncertainty.
# useUncertainty = true
# uncertaintyExponent = 1.0
# uncertaintyCoeff = 0.25
# Amount to apply a downweighting of children with very bad values relative to good ones
# valueWeightExponent = 0.25
# Slight incentive for the bot to behave human-like with regard to passing at the end, filling the dame,
# not wasting time playing in its own territory, etc, and not play moves that are equivalent in terms of
# points but a bit more unfriendly to humans.
# rootEndingBonusPoints = 0.5
# Make the bot prune useless moves that are just prolonging the game to avoid losing yet
# rootPruneUselessMoves = true
# Apply bias correction based on local pattern keys
# subtreeValueBiasFactor = 0.45
# subtreeValueBiasWeightExponent = 0.85
# Use graph search rather than tree search - identify and share search for transpositions.
# useGraphSearch = true
# How much to shard the node table for search synchronization
# nodeTableShardsPowerOfTwo = 16
# How many virtual losses to add when a thread descends through a node
# numVirtualLossesPerThread = 1
# Improve the quality of evals under heavy multithreading
# useNoisePruning = true
# Avoid SGF Patterns ------------------------------------------------------------------------------
# The parameters in this section provide a powerful way to customize KataGo to avoid moves that follow specific patterns
# based on a set of provided SGF files loaded upon startup. Uncomment them to use this feature.
# Additionally, if the SGF file contains the string %SKIP% in a comment on a move, that move will be ignored for this purpose.
# Load sgf files from this directory when the engine is started (ONLY on startup, will not reload unless engine is restarted)
# avoidSgfPatternDirs = path/to/directory/with/sgfs/
# You can also surround the file path in double quotes if the file path contains trailing spaces or hash signs.
# Within double quotes, backslashes are escape characters.
# avoidSgfPatternDirs = "path/to/directory/with/sgfs/"
# Penalize this much utility per matching move.
# Set this negative if you instead want to make KataGo favor the SGF patterns instead of penalizing it!
# This number does not need to be large, even 0.001 will make a difference. Too-large values may lead to bad play.
# avoidSgfPatternUtility = 0.001
# Optional - load only the newest this many files
# avoidSgfPatternMaxFiles = 20
# Optional - Penalty is multiplied by this per each older SGF file, so that old sgf files matter less than newer ones.
# avoidSgfPatternLambda = 0.90
# Optional - pay attention only to moves that were made by players with this name.
# For example you can set it to the name that your bot's past games will show up as in the SGF, so that the bot will only avoid repeating
# moves that itself made in past games, not the moves that its opponents made.
# avoidSgfPatternAllowedNames = my-ogs-bot-name1,my-ogs-bot-name2
# Optional - Ignore any moves in SGF files that occurred before this turn number.
# avoidSgfPatternMinTurnNumber = 0
# For more avoid patterns:
# You can also specify a second set of parameters, and a third, fourth, etc by numbering 2,3,4,...
# avoidSgf2PatternDirs = ...
# avoidSgf2PatternUtility = ...
# avoidSgf2PatternMaxFiles = ...
# avoidSgf2PatternLambda = ...
# avoidSgf2PatternAllowedNames = ...
# avoidSgf2PatternMinTurnNumber = ...

@ -0,0 +1,211 @@
# Config for KataGo C++ GTP engine, i.e. "./katago.exe gtp"
# Logs and files--------------------------------------------------------------------------
# Where to output log?
logDir = gtp_logs # Each run of KataGo will log to a separate file in this dir
# logDirDated = gtp_logs # Use this instead of logDir to also write separate dated subdirs
# logFile = gtp.log # Use this instead of logDir to just specify a single file directly
# Logging options
logAllGTPCommunication = true
logSearchInfo = true
logToStderr = false
# Optionally override where KataGo will attempt to save things like openCLTuner files and other cached data.
# homeDataDir = DIRECTORY
# Analysis------------------------------------------------------------------------------------
# Configure the maximum length of analysis printed out by lz-analyze and other places.
# Controls the number of moves after the first move in a variation.
# analysisPVLen = 15
# Report winrates for chat and analysis as (BLACK|WHITE|SIDETOMOVE).
# Default is SIDETOMOVE, which is what tools that use LZ probably also expect
# reportAnalysisWinratesAs = SIDETOMOVE
# Larger values will make KataGo explore the top move(s) less deeply and accurately,
# but explore and give evaluations to a greater variety of moves, for analysis (does NOT affect play).
# Defaults to 0.04.
# An extreme value like 1 will distribute many playouts across every move on the board, even very bad moves.
# analysisWideRootNoise = 0.04
# Default rules------------------------------------------------------------------------------------
# See https://lightvector.github.io/KataGo/rules.html for a description of the rules.
# These rules are defaults and can be changed mid-run by several custom GTP commands.
# See https://github.com/lightvector/KataGo/blob/master/docs/GTP_Extensions.md for those commands.
koRule = SIMPLE # options: SIMPLE, POSITIONAL, SITUATIONAL
scoringRule = AREA # options: AREA, TERRITORY
taxRule = NONE # options: NONE, SEKI, ALL
multiStoneSuicideLegal = false
hasButton = false
whiteHandicapBonus = N # options: 0, N, N-1
friendlyPassOk = true
# Bot behavior---------------------------------------------------------------------------------------
# Resignation -------------
# Resignation occurs if for at least resignConsecTurns in a row,
# the winLossUtility (which is on a [-1,1] scale) is below resignThreshold.
allowResignation = true
resignThreshold = -0.90
resignConsecTurns = 3
# Uncomment to make katago not resign close games, behind by fewer than this many points
# resignMinScoreDifference = 10
# Handicap -------------
# Assume that if black makes many moves in a row right at the start of the game, then the game is a handicap game.
# This is necessary on some servers and for some GUIs and also when initializing from many SGF files, which may
# set up a handicap game using repeated GTP "play" commands for black rather than GTP "place_free_handicap" commands.
# However, it may also lead to incorrect understanding of komi if whiteHandicapBonus is used and a server does NOT
# have such a practice.
# Defaults to true! Uncomment and set to false to disable this behavior.
# assumeMultipleStartingBlackMovesAreHandicap = true
# Makes katago dynamically adjust in handicap or altered-komi games to assume based on those game settings that it
# must be stronger or weaker than the opponent and to play accordingly. Greatly improves handicap
# strength by biasing winrates and scores to favor appropriate safe/aggressive play.
# Does NOT affect analysis (lz-analyze, kata-analyze, used by programs like Lizzie) so analysis remains unbiased.
# Uncomment and set this to 0 to disable this and make KataGo play the same always.
# dynamicPlayoutDoublingAdvantageCapPerOppLead = 0.045
# Instead of a dynamic level, you can uncomment this and set this to a value from -3.0 to 3.0 to set KataGo's aggression to a FIXED level.
# DOES affect analysis tools (lz-analyze, kata-analyze, used by programs like Lizzie).
# Negative makes KataGo behave as if it is much weaker than the opponent, preferring to play defensively.
# Positive makes KataGo behave as if it is much stronger than the opponent, prefering to play aggressively or even overplay slightly.
# If this and "dynamicPlayoutDoublingAdvantageCapPerOppLead" are BOTH set then dynamic will be used for all games and this fixed
# value will be used for analysis tools.
# playoutDoublingAdvantage = 0.0
# Uncommenting one of these will enforce that the FIXED playoutDoublingAdvantage will only apply when KataGo plays the specified color
# and will be negated when playing the opposite color.
# playoutDoublingAdvantagePla = BLACK
# playoutDoublingAdvantagePla = WHITE
# Misc Behavior --------------------
# If the board is symmetric, search only one copy of each equivalent move. Attempts to also account for ko/superko, will not theoretically perfect for superko.
# Uncomment and set to false to disable this.
# rootSymmetryPruning = true
# Uncomment and set to true to make KataGo avoid a particular joseki that some KataGo nets misevaluate,
# and also to improve opening diversity versus some particular other bots that like to play it all the time.
# avoidMYTDaggerHack = false
# Have KataGo mildly prefer to avoid playing the same joseki in every corner of the board.
# Uncomment to set to a specific value. Otherwise, defaults to 0 in even games, and to 0.005 in handicap games.
# See also the Avoid SGF mechanism at the bottom of this config.
# avoidRepeatedPatternUtility = 0.0
# Experimental logic to make KataGo fight a bit against mirror Go even with unfavorable komi.
# Enabled by default for GTP play, disabled for GTP analysis (i.e lizzie) and analysis engine.
# Uncomment and set to true to enable it for analysis, or false to disable it fully.
# antiMirror = true
# Search limits-----------------------------------------------------------------------------------
# For all of "maxVisits", "maxPlayouts", "maxTime", search will still try to follow GTP time controls and may make a move
# faster than the specified max if GTP tells it that it is playing under a clock as well in the current game.
# If provided, limit maximum number of root visits per search to this much. (With tree reuse, visits do count earlier search)
# maxVisits = 500
# If provided, limit maximum number of new playouts per search to this much. (With tree reuse, playouts do not count earlier search)
# maxPlayouts = 300
# If provided, cap search time at this many seconds.
# maxTime = 10
# Ponder on the opponent's turn?
ponderingEnabled = false
# maxTimePondering = 60
# Note: you can set "maxVisitsPondering" or "maxPlayoutsPondering" too.
# Approx number of seconds to buffer for lag for GTP time controls - will move a bit faster assuming there is this much lag per move.
lagBuffer = 1.0
# Number of threads to use in search
numSearchThreads = 16
# Play a little faster if the opponent is passing, for friendliness
searchFactorAfterOnePass = 0.50
searchFactorAfterTwoPass = 0.25
# Play a little faster if super-winning, for friendliness
searchFactorWhenWinning = 0.40
searchFactorWhenWinningThreshold = 0.95
# GPU Settings-------------------------------------------------------------------------------
# Maximum number of positions to send to a single GPU at once.
# The default value here is roughly equal to numSearchThreads, but you can specify it manually
# if you are running out of memory, or if you are using multiple GPUs that expect to split
# up the work.
# nnMaxBatchSize = <integer>
# Cache up to (2 ** this) many neural net evaluations in case of transpositions in the tree.
# Uncomment and edit to change if you want to adjust a major component of KataGo's RAM usage.
nnCacheSizePowerOfTwo = 21
# Size of mutex pool for nnCache is (2 ** this).
nnMutexPoolSizePowerOfTwo = 17
numNNServerThreadsPerModel = 1
cudaDeviceToUseThread0 = 0
# Internal params------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Use graph search rather than tree search - identify and share search for transpositions.
# useGraphSearch = true
# How much to shard the node table for search synchronization
# nodeTableShardsPowerOfTwo = 16
# Avoid SGF Patterns ------------------------------------------------------------------------------
# The parameters in this section provide a powerful way to customize KataGo to avoid moves that follow specific patterns
# based on a set of provided SGF files loaded upon startup. Uncomment them to use this feature.
# Additionally, if the SGF file contains the string %SKIP% in a comment on a move, that move will be ignored for this purpose.
# Load sgf files from this directory when the engine is started (ONLY on startup, will not reload unless engine is restarted)
# avoidSgfPatternDirs = path/to/directory/with/sgfs/
# Penalize this much utility per matching move.
# Set this negative if you instead want to make KataGo favor the SGF patterns instead of penalizing it!
# This number does not need to be large, even 0.001 will make a difference. Too-large values may lead to bad play.
# avoidSgfPatternUtility = 0.001
# Optional - load only the newest this many files
# avoidSgfPatternMaxFiles = 20
# Optional - Penalty is multiplied by this per each older SGF file, so that old sgf files matter less than newer ones.
# avoidSgfPatternLambda = 0.90
# Optional - pay attention only to moves that were made by players with this name.
# For example you can set it to the name that your bot's past games will show up as in the SGF, so that the bot will only avoid repeating
# moves that itself made in past games, not the moves that its opponents made.
# avoidSgfPatternAllowedNames = my-ogs-bot-name1,my-ogs-bot-name2
# Optional - Ignore any moves in SGF files that occurred before this turn number.
# avoidSgfPatternMinTurnNumber = 0
# For more avoid patterns:
# You can also specify a second set of parameters, and a third, fourth, etc by numbering 2,3,4,...
# avoidSgf2PatternDirs = ...
# avoidSgf2PatternUtility = ...
# avoidSgf2PatternMaxFiles = ...
# avoidSgf2PatternLambda = ...
# avoidSgf2PatternAllowedNames = ...
# avoidSgf2PatternMinTurnNumber = ...

@ -0,0 +1,122 @@
serverUrl = https://katagotraining.org/
username = Fill in your username here
password = Fill in your password here
# If your password has hash signs or trailing spaces, you can also surround the password with double quotes, like this.
# Within double quotes, backslashes are escape characters.
# password = "Fill in your password here"
# How many games should KataGo play at once? For good GPUs, putting too small a number here will be *very* inefficient.
# For absolute-top-tier GPUs, try numbers like 32, 40, 64, etc.
# For modern good middle-tier GPUs, you can try numbers like 8 or 16.
# For very old or weak GPUs, or if you want KataGo to put less load on your system, try 4.
maxSimultaneousGames = Fill in a number here
# Set to true if you want one of KataGo's games to be streamed to a text file, so you can watch.
# Follow in a separate shell with a command like the following:
# Linux: "tail -f watchgame.txt"
# Windows Powershell: "Get-Content .\watchgame.txt -Tail 50 -Wait"
watchOngoingGameInFile = false
watchOngoingGameInFileName = watchgame.txt
# If you use an https proxy to connect to the internet, set these to the host and port of your proxy.
# proxyHost = HOSTNAME
# proxyPort = 1234
# Special-purpose options. Most users should not need to adjust these.
# onlyPlayRatingMatches = false
# maxRatingMatches = 1
# disablePredownloadLoop = false
# KataGo will only use one GPU by default. You can edit the below if you have multiple GPUs and want to use them all.
# TO USE MULTIPLE GPUS:
# Set this to the number of GPUs you have and/or would like to use.
# **AND** if it is more than 1, uncomment the appropriate CUDA or OpenCL section below.
# numNNServerThreadsPerModel = 1
# TENSORRT GPU settings--------------------------------------
# These only apply when using the TENSORRT version of KataGo.
# IF USING ONE GPU: optionally uncomment and change this if the GPU you want to use turns out to be not device 0
# trtDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# IF USING THREE GPUS: Uncomment these three lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# trtDeviceToUseThread2 = 2 # change this if the third GPU you want to use turns out to be not device 2
# You can probably guess the pattern if you have four, five, etc. GPUs.
# CUDA GPU settings--------------------------------------
# These only apply when using the CUDA version of KataGo.
# IF USING ONE GPU: optionally uncomment and change this if the GPU you want to use turns out to be not device 0
# cudaDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines (AND set numNNServerThreadsPerModel above):
# cudaDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# cudaDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# IF USING THREE GPUS: Uncomment these three lines (AND set numNNServerThreadsPerModel above):
# cudaDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# cudaDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# cudaDeviceToUseThread2 = 2 # change this if the third GPU you want to use turns out to be not device 2
# You can probably guess the pattern if you have four, five, etc. GPUs.
# KataGo will automatically use FP16 or not based on the compute capability of your NVIDIA GPU. If you
# want to try to force a particular behavior though you can uncomment these lines and change them
# to "true" or "false". E.g. it's using FP16 but on your card that's giving an error, or it's not using
# FP16 but you think it should.
# cudaUseFP16 = auto
# cudaUseNHWC = auto
# OpenCL GPU settings--------------------------------------
# These only apply when using the OpenCL version of KataGo.
# Uncomment to tune OpenCL for every board size separately, rather than only the largest possible size
# openclReTunePerBoardSize = true
# IF USING ONE GPU: optionally uncomment and change this if the best device to use is guessed incorrectly.
# The default behavior tries to guess the 'best' GPU or device on your system to use, usually it will be a good guess.
# openclDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines and replace X and Y with the device ids of the devices you want to use.
# It might NOT be 0 and 1, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# IF USING THREE GPUS: Uncomment these three lines and replace X and Y and Z with the device ids of the devices you want to use.
# It might NOT be 0 and 1 and 2, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# openclDeviceToUseThread2 = Z
# You can probably guess the pattern if you have four, five, etc. GPUs.
# KataGo will automatically use FP16 or not based on testing your GPU during tuning. If you
# want to try to force a particular behavior though you can uncomment this lines and change it
# to "true" or "false". This is a fairly blunt setting - more detailed settings are testable
# by rerunning the tuner with various arguments.
# openclUseFP16 = auto
# Eigen-specific settings--------------------------------------
# These only apply when using the Eigen (pure CPU) version of KataGo.
# This is the number of CPU threads for evaluating the neural net on the Eigen backend.
# It defaults to numSearchThreads.
# numEigenThreadsPerModel = X

@ -0,0 +1,211 @@
# Config for KataGo C++ GTP engine, i.e. "./katago.exe gtp"
# Logs and files--------------------------------------------------------------------------
# Where to output log?
logDir = gtp_logs # Each run of KataGo will log to a separate file in this dir
# logDirDated = gtp_logs # Use this instead of logDir to also write separate dated subdirs
# logFile = gtp.log # Use this instead of logDir to just specify a single file directly
# Logging options
logAllGTPCommunication = true
logSearchInfo = true
logToStderr = false
# Optionally override where KataGo will attempt to save things like openCLTuner files and other cached data.
# homeDataDir = DIRECTORY
# Analysis------------------------------------------------------------------------------------
# Configure the maximum length of analysis printed out by lz-analyze and other places.
# Controls the number of moves after the first move in a variation.
# analysisPVLen = 15
# Report winrates for chat and analysis as (BLACK|WHITE|SIDETOMOVE).
# Default is SIDETOMOVE, which is what tools that use LZ probably also expect
# reportAnalysisWinratesAs = SIDETOMOVE
# Larger values will make KataGo explore the top move(s) less deeply and accurately,
# but explore and give evaluations to a greater variety of moves, for analysis (does NOT affect play).
# Defaults to 0.04.
# An extreme value like 1 will distribute many playouts across every move on the board, even very bad moves.
# analysisWideRootNoise = 0.04
# Default rules------------------------------------------------------------------------------------
# See https://lightvector.github.io/KataGo/rules.html for a description of the rules.
# These rules are defaults and can be changed mid-run by several custom GTP commands.
# See https://github.com/lightvector/KataGo/blob/master/docs/GTP_Extensions.md for those commands.
koRule = SIMPLE # options: SIMPLE, POSITIONAL, SITUATIONAL
scoringRule = AREA # options: AREA, TERRITORY
taxRule = NONE # options: NONE, SEKI, ALL
multiStoneSuicideLegal = false
hasButton = false
whiteHandicapBonus = N # options: 0, N, N-1
friendlyPassOk = true
# Bot behavior---------------------------------------------------------------------------------------
# Resignation -------------
# Resignation occurs if for at least resignConsecTurns in a row,
# the winLossUtility (which is on a [-1,1] scale) is below resignThreshold.
allowResignation = true
resignThreshold = -0.90
resignConsecTurns = 10
# Uncomment to make katago not resign close games, behind by fewer than this many points
# resignMinScoreDifference = 10
# Handicap -------------
# Assume that if black makes many moves in a row right at the start of the game, then the game is a handicap game.
# This is necessary on some servers and for some GUIs and also when initializing from many SGF files, which may
# set up a handicap game using repeated GTP "play" commands for black rather than GTP "place_free_handicap" commands.
# However, it may also lead to incorrect understanding of komi if whiteHandicapBonus is used and a server does NOT
# have such a practice.
# Defaults to true! Uncomment and set to false to disable this behavior.
# assumeMultipleStartingBlackMovesAreHandicap = true
# Makes katago dynamically adjust in handicap or altered-komi games to assume based on those game settings that it
# must be stronger or weaker than the opponent and to play accordingly. Greatly improves handicap
# strength by biasing winrates and scores to favor appropriate safe/aggressive play.
# Does NOT affect analysis (lz-analyze, kata-analyze, used by programs like Lizzie) so analysis remains unbiased.
# Uncomment and set this to 0 to disable this and make KataGo play the same always.
# dynamicPlayoutDoublingAdvantageCapPerOppLead = 0.045
# Instead of a dynamic level, you can uncomment this and set this to a value from -3.0 to 3.0 to set KataGo's aggression to a FIXED level.
# DOES affect analysis tools (lz-analyze, kata-analyze, used by programs like Lizzie).
# Negative makes KataGo behave as if it is much weaker than the opponent, preferring to play defensively.
# Positive makes KataGo behave as if it is much stronger than the opponent, prefering to play aggressively or even overplay slightly.
# If this and "dynamicPlayoutDoublingAdvantageCapPerOppLead" are BOTH set then dynamic will be used for all games and this fixed
# value will be used for analysis tools.
# playoutDoublingAdvantage = 0.0
# Uncommenting one of these will enforce that the FIXED playoutDoublingAdvantage will only apply when KataGo plays the specified color
# and will be negated when playing the opposite color.
# playoutDoublingAdvantagePla = BLACK
# playoutDoublingAdvantagePla = WHITE
# Misc Behavior --------------------
# If the board is symmetric, search only one copy of each equivalent move. Attempts to also account for ko/superko, will not theoretically perfect for superko.
# Uncomment and set to false to disable this.
# rootSymmetryPruning = true
# Uncomment and set to true to make KataGo avoid a particular joseki that some KataGo nets misevaluate,
# and also to improve opening diversity versus some particular other bots that like to play it all the time.
# avoidMYTDaggerHack = false
# Have KataGo mildly prefer to avoid playing the same joseki in every corner of the board.
# Uncomment to set to a specific value. Otherwise, defaults to 0 in even games, and to 0.005 in handicap games.
# See also the Avoid SGF mechanism at the bottom of this config.
# avoidRepeatedPatternUtility = 0.0
# Experimental logic to make KataGo fight a bit against mirror Go even with unfavorable komi.
# Enabled by default for GTP play, disabled for GTP analysis (i.e lizzie) and analysis engine.
# Uncomment and set to true to enable it for analysis, or false to disable it fully.
# antiMirror = true
# Search limits-----------------------------------------------------------------------------------
# For all of "maxVisits", "maxPlayouts", "maxTime", search will still try to follow GTP time controls and may make a move
# faster than the specified max if GTP tells it that it is playing under a clock as well in the current game.
# If provided, limit maximum number of root visits per search to this much. (With tree reuse, visits do count earlier search)
# maxVisits = 500
# If provided, limit maximum number of new playouts per search to this much. (With tree reuse, playouts do not count earlier search)
# maxPlayouts = 300
# If provided, cap search time at this many seconds.
# maxTime = 10
# Ponder on the opponent's turn?
ponderingEnabled = false
# maxTimePondering = 60
# Note: you can set "maxVisitsPondering" or "maxPlayoutsPondering" too.
# Approx number of seconds to buffer for lag for GTP time controls - will move a bit faster assuming there is this much lag per move.
lagBuffer = 1.0
# Number of threads to use in search
numSearchThreads = 16
# Play a little faster if the opponent is passing, for friendliness
searchFactorAfterOnePass = 0.50
searchFactorAfterTwoPass = 0.25
# Play a little faster if super-winning, for friendliness
searchFactorWhenWinning = 0.40
searchFactorWhenWinningThreshold = 0.95
# GPU Settings-------------------------------------------------------------------------------
# Maximum number of positions to send to a single GPU at once.
# The default value here is roughly equal to numSearchThreads, but you can specify it manually
# if you are running out of memory, or if you are using multiple GPUs that expect to split
# up the work.
# nnMaxBatchSize = <integer>
# Cache up to (2 ** this) many neural net evaluations in case of transpositions in the tree.
# Uncomment and edit to change if you want to adjust a major component of KataGo's RAM usage.
nnCacheSizePowerOfTwo = 20
# Size of mutex pool for nnCache is (2 ** this).
nnMutexPoolSizePowerOfTwo = 16
numNNServerThreadsPerModel = 1
cudaDeviceToUseThread0 = 0
# Internal params------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Use graph search rather than tree search - identify and share search for transpositions.
# useGraphSearch = true
# How much to shard the node table for search synchronization
# nodeTableShardsPowerOfTwo = 16
# Avoid SGF Patterns ------------------------------------------------------------------------------
# The parameters in this section provide a powerful way to customize KataGo to avoid moves that follow specific patterns
# based on a set of provided SGF files loaded upon startup. Uncomment them to use this feature.
# Additionally, if the SGF file contains the string %SKIP% in a comment on a move, that move will be ignored for this purpose.
# Load sgf files from this directory when the engine is started (ONLY on startup, will not reload unless engine is restarted)
# avoidSgfPatternDirs = path/to/directory/with/sgfs/
# Penalize this much utility per matching move.
# Set this negative if you instead want to make KataGo favor the SGF patterns instead of penalizing it!
# This number does not need to be large, even 0.001 will make a difference. Too-large values may lead to bad play.
# avoidSgfPatternUtility = 0.001
# Optional - load only the newest this many files
# avoidSgfPatternMaxFiles = 20
# Optional - Penalty is multiplied by this per each older SGF file, so that old sgf files matter less than newer ones.
# avoidSgfPatternLambda = 0.90
# Optional - pay attention only to moves that were made by players with this name.
# For example you can set it to the name that your bot's past games will show up as in the SGF, so that the bot will only avoid repeating
# moves that itself made in past games, not the moves that its opponents made.
# avoidSgfPatternAllowedNames = my-ogs-bot-name1,my-ogs-bot-name2
# Optional - Ignore any moves in SGF files that occurred before this turn number.
# avoidSgfPatternMinTurnNumber = 0
# For more avoid patterns:
# You can also specify a second set of parameters, and a third, fourth, etc by numbering 2,3,4,...
# avoidSgf2PatternDirs = ...
# avoidSgf2PatternUtility = ...
# avoidSgf2PatternMaxFiles = ...
# avoidSgf2PatternLambda = ...
# avoidSgf2PatternAllowedNames = ...
# avoidSgf2PatternMinTurnNumber = ...

@ -0,0 +1,632 @@
# Configuration for KataGo C++ GTP engine
# Run the program using: `./katago.exe gtp`
# In this example config, when a parameter is given as a commented out value,
# that value also is the default value, unless described otherwise. You can
# uncomment it (remove the pound sign) and change it if you want.
# ===========================================================================
# Running on an online server or in a real tournament or match
# ===========================================================================
# If you plan to run online or in a tournament, read through the "Rules"
# section below for proper handling of komi, handicaps, end-of-game cleanup,
# and other details.
# ===========================================================================
# Notes about performance and memory usage
# ===========================================================================
# Important: For good performance, you will very likely want to tune the
# "numSearchThreads" parameter in the Search limits section below! Run
# "./katago benchmark" to test KataGo and to suggest a reasonable value
# of this parameter.
# For multi-GPU systems, read "OpenCL GPU settings" or "CUDA GPU settings".
#
# When using OpenCL, verify that KataGo picks the correct device! Some systems
# may have both an Intel CPU OpenCL and GPU OpenCL. If # KataGo picks the wrong
# one, correct this by specifying "openclGpuToUse".
#
# Consider adjusting "maxVisits", "ponderingEnabled", "resignThreshold", and
# other parameters depending on your intended usage.
# ===========================================================================
# Command-line usage
# ===========================================================================
# All of the below values may be set or overridden via command-line arguments:
#
# -override-config KEY=VALUE,KEY=VALUE,...
# ===========================================================================
# Logs and files
# ===========================================================================
# This section defines where and what logging information is produced.
# Each run of KataGo will log to a separate file in this dir.
# This is the default.
logDir = gtp_logs
# Uncomment and specify this instead of logDir to write separate dated subdirs
# logDirDated = gtp_logs
# Uncomment and specify this instead of logDir to log to only a single file
# logFile = gtp.log
# Logging options
logAllGTPCommunication = true
logSearchInfo = true
logToStderr = false
# KataGo will display some info to stderr on GTP startup
# Uncomment the next line and set it to false to suppress that and remain silent
# startupPrintMessageToStderr = true
# Write information to stderr, for use in things like malkovich chat to OGS.
# ogsChatToStderr = false
# Uncomment and set this to a directory to override where openCLTuner files
# and other cached data is written. By default it saves into a subdir of the
# current directory on windows, and a subdir of ~/.katago on Linux.
# homeDataDir = PATH_TO_DIRECTORY
# ===========================================================================
# Analysis
# ===========================================================================
# This section configures analysis settings.
#
# The maximum number of moves after the first move displayed in variations
# from analysis commands like kata-analyze or lz-analyze.
# analysisPVLen = 15
# Report winrates for chat and analysis as (BLACK|WHITE|SIDETOMOVE).
# Most GUIs and analysis tools will expect SIDETOMOVE.
# reportAnalysisWinratesAs = SIDETOMOVE
# Extra noise for wider exploration. Large values will force KataGo to
# analyze a greater variety of moves than it normally would.
# An extreme value like 1 distributes playouts across every move on the board,
# even very bad moves.
# Affects analysis only, does not affect play.
# analysisWideRootNoise = 0.04
# ===========================================================================
# Rules
# ===========================================================================
# This section configures the scoring and playing rules. Rules can also be
# changed mid-run by issuing custom GTP commands.
#
# See https://lightvector.github.io/KataGo/rules.html for rules details.
#
# See https://github.com/lightvector/KataGo/blob/master/docs/GTP_Extensions.md
# for GTP commands.
# Specify the rules as a string.
# Some legal values include:
# chinese, japanese, korean, aga, chinese-ogs, new-zealand, stone-scoring,
# ancient-territory, bga, aga-button
#
# For some human rulesets that require complex adjudication in tricky cases
# (e.g. japanese, korean) KataGo may not precisely match the ruleset in such
# cases but will do its best.
rules = tromp-taylor
# By default, the "rules" parameter is used, but if you comment it out and
# uncomment one option in each of the sections below, you can specify an
# arbitrary combination of individual rules.
# koRule = SIMPLE # Simple ko rules (triple ko = no result)
# koRule = POSITIONAL # Positional superko
# koRule = SITUATIONAL # Situational superko
# scoringRule = AREA # Area scoring
# scoringRule = TERRITORY # Territory scoring (special computer-friendly territory rules)
# taxRule = NONE # All surrounded empty points are scored
# taxRule = SEKI # Eyes in seki do NOT count as points
# taxRule = ALL # All groups are taxed up to 2 points for the two eyes needed to live
# Is multiple-stone suicide legal? (Single-stone suicide is always illegal).
# multiStoneSuicideLegal = false
# multiStoneSuicideLegal = true
# "Button go" - the first pass when area scoring awards 0.5 points and does
# not count for ending the game.
# Allows area scoring rulesets that have far simpler rules to achieve the same
# final scoring precision and reward for precise play as territory scoring.
# hasButton = false
# hasButton = true
# Is this a human ruleset where it's okay to pass before having physically
# captured and removed all dead stones?
# friendlyPassOk = false
# friendlyPassOk = true
# How handicap stones in handicap games are compensated
# whiteHandicapBonus = 0 # White gets no compensation for black's handicap stones (Tromp-taylor, NZ, JP)
# whiteHandicapBonus = N-1 # White gets N-1 points for black's N handicap stones (AGA)
# whiteHandicapBonus = N # White gets N points for black's N handicap stones (Chinese)
# ------------------------------
# Other rules hacks
# ------------------------------
# Uncomment and change to adjust what board size KataGo uses upon startup
# by default when GTP doesn't specify.
# defaultBoardSize = 19
# By default, Katago will use the komi that the GUI or GTP controller tries to set.
# Uncomment and set this to have KataGo ignore the controller and always use this komi.
# ignoreGTPAndForceKomi = 7
# ===========================================================================
# Bot behavior
# ===========================================================================
# ------------------------------
# Resignation
# ------------------------------
# Resignation occurs if for at least resignConsecTurns in a row, the
# winLossUtility (on a [-1,1] scale) is below resignThreshold.
allowResignation = true
resignThreshold = -0.90
resignConsecTurns = 3
# By default, KataGo may resign games that it is confidently losing even if they
# are very close in score. Uncomment and set this to avoid resigning games
# if the estimated difference is points is less than or equal to this.
# resignMinScoreDifference = 10
# ------------------------------
# Handicap
# ------------------------------
# Assume that if black makes many moves in a row right at the start of the
# game, then the game is a handicap game. This is necessary on some servers
# and for some GUIs and also when initializing from many SGF files, which may
# set up a handicap game using repeated GTP "play" commands for black rather
# than GTP "place_free_handicap" commands; however, it may also lead to
# incorrect understanding of komi if whiteHandicapBonus is used and a server
# does not have such a practice. Uncomment and set to false to disable.
# assumeMultipleStartingBlackMovesAreHandicap = true
# Makes katago dynamically adjust in handicap or altered-komi games to assume
# based on those game settings that it must be stronger or weaker than the
# opponent and to play accordingly. Greatly improves handicap strength by
# biasing winrates and scores to favor appropriate safe/aggressive play.
# Does not affect analysis (lz-analyze, kata-analyze, used by programs like
# Lizzie) so analysis remains unbiased. Uncomment and set this to 0 to disable
# this and make KataGo play the same always.
# dynamicPlayoutDoublingAdvantageCapPerOppLead = 0.045
# Instead of "dynamicPlayoutDoublingAdvantageCapPerOppLead", you can comment
# that out and uncomment and set "playoutDoublingAdvantage" to a value between
# from -3.0 to 3.0 to set KataGo's aggression to a FIXED level. This affects
# analysis tools (lz-analyze, kata-analyze, used by programs like Lizzie).
# Negative makes KataGo behave as if it is much weaker than the opponent,
# preferring to play defensively. Positive makes KataGo behave as if it is
# much stronger than the opponent, prefering to play aggressively or even
# overplay slightly.
#
# If this and "dynamicPlayoutDoublingAdvantageCapPerOppLead" are both set
# then dynamic will be used for all games and this fixed value will be used
# for analysis tools.
# playoutDoublingAdvantage = 0.0
# Uncomment one of these when using "playoutDoublingAdvantage" to enforce
# that it will only apply when KataGo plays as the specified color and will be
# negated when playing as the opposite color.
# playoutDoublingAdvantagePla = BLACK
# playoutDoublingAdvantagePla = WHITE
# ------------------------------
# Passing and cleanup
# ------------------------------
# Make the bot never assume that its pass will end the game, even if passing
# would end and "win" under Tromp-Taylor rules. Usually this is a good idea
# when using it for analysis or playing on servers where scoring may be
# implemented non-tromp-taylorly. Uncomment and set to false to disable.
# conservativePass = true
# When using territory scoring, self-play games continue beyond two passes
# with special cleanup rules that may be confusing for human players. This
# option prevents the special cleanup phases from being reachable when using
# the bot for GTP play. Uncomment and set to false to enable entering special
# cleanup. For example, if you are testing it against itself, or against
# another bot that has precisely implemented the rules documented at
# https://lightvector.github.io/KataGo/rules.html
# preventCleanupPhase = true
# ------------------------------
# Miscellaneous behavior
# ------------------------------
# If the board is symmetric, search only one copy of each equivalent move.
# Attempts to also account for ko/superko, will not theoretically perfect for
# superko. Uncomment and set to false to disable.
# rootSymmetryPruning = true
# Uncomment and set to true to avoid a particular joseki that some networks
# misevaluate, and also to improve opening diversity versus some particular
# other bots that like to play it all the time.
# avoidMYTDaggerHack = false
# Prefer to avoid playing the same joseki in every corner of the board.
# Uncomment to set to a specific value. See "Avoid SGF patterns" section.
# By default: 0 (even games), 0.005 (handicap games)
# avoidRepeatedPatternUtility = 0.0
# Experimental logic to fight against mirror Go even with unfavorable komi.
# Uncomment to set to a specific value to use for both playing and analysis.
# By default: true when playing via GTP, but false when analyzing.
# antiMirror = true
# ===========================================================================
# Search limits
# ===========================================================================
# Terminology:
# "Playouts" is the number of new playouts of search performed each turn.
# "Visits" is the same as "Playouts" but also counts search performed on
# previous turns that is still applicable to this turn.
# "Time" is the time in seconds.
# For example, if KataGo searched 200 nodes on the previous turn, and then
# after the opponent's reply, 50 nodes of its search tree was still valid,
# then a visit limit of 200 would allow KataGo to search 150 new nodes
# (for a final tree size of 200 nodes), whereas a playout limit of of 200
# would allow KataGo to search 200 nodes (for a final tree size of 250 nodes).
# Additionally, KataGo may also move before than the limit in order to
# obey time controls (e.g. byo-yomi, etc) if the GTP controller has
# told KataGo that the game has is being played with a given time control.
# Limits for search on the current turn.
# If commented out or unspecified, the default is to have no limit.
maxVisits = 500
# maxPlayouts = 300
# maxTime = 10.0
# Ponder on the opponent's turn?
ponderingEnabled = false
# Limits for search when pondering on the opponent's turn.
# If commented out or unspecified, the default is to have no limit.
# Limiting the maximum time is recommended so that KataGo won't burn CPU/GPU
# forever and/or run out of RAM if left unattended while pondering is enabled.
# maxVisitsPondering = 5000
# maxPlayoutsPondering = 3000
maxTimePondering = 60.0
# ------------------------------
# Other search limits and behavior
# ------------------------------
# Approx number of seconds to buffer for lag for GTP time controls - will
# move a bit faster assuming there is this much lag per move.
lagBuffer = 1.0
# YOU PROBABLY WANT TO TUNE THIS PARAMETER!
# The number of threads to use when searching. On powerful GPUs the optimal
# threads may be much higher than the number of CPU cores you have because
# many threads are needed to feed efficient large batches to the GPU.
#
# Run "./katago benchmark" to tune this parameter and test the effect
# of changes to any of other parameters.
numSearchThreads = 6
# Play a little faster if the opponent is passing, for human-friendliness.
# Comment these out to disable them, such as if running a controlled match
# where you are testing KataGo with fixed compute per move vs other bots.
searchFactorAfterOnePass = 0.50
searchFactorAfterTwoPass = 0.25
# Play a little faster if super-winning, for human-friendliness.
# Comment these out to disable them, such as if running a controlled match
# where you are testing KataGo with fixed compute per move vs other bots.
searchFactorWhenWinning = 0.40
searchFactorWhenWinningThreshold = 0.95
# ===========================================================================
# GPU settings
# ===========================================================================
# This section configures GPU settings.
#
# Maximum number of positions to send to a single GPU at once. The default
# value is roughly equal to numSearchThreads, but can be specified manually
# if running out of memory, or using multiple GPUs that expect to share work.
# nnMaxBatchSize = <integer>
# Controls the neural network cache size, which is the primary RAM/memory use.
# KataGo will cache up to (2 ** nnCacheSizePowerOfTwo) many neural net
# evaluations in case of transpositions in the tree.
# Increase this to improve performance for searches with tens of thousands
# of visits or more. Decrease this to limit memory usage.
# If you're happy to do some math - each neural net entry takes roughly
# 1.5KB, except when using whole-board ownership/territory
# visualizations, where each entry will take roughly 3KB. The number of
# entries is (2 ** nnCacheSizePowerOfTwo). (E.g. 2 ** 18 = 262144.)
# You can compute roughly how much memory the cache will use based on this.
# nnCacheSizePowerOfTwo = 20
# Size of mutex pool for nnCache is (2 ** this).
# nnMutexPoolSizePowerOfTwo = 16
# Randomize board orientation when running neural net evals? Uncomment and
# set to false to disable.
# nnRandomize = true
# If provided, force usage of a specific seed for nnRandomize.
# The default is to use a randomly generated seed.
# nnRandSeed = abcdefg
# ------------------------------
# Multiple GPUs
# ------------------------------
# Set this to the number of GPUs to use or that are available.
# IMPORTANT: If more than 1, also uncomment the appropriate TensorRT
# or CUDA or OpenCL section.
# numNNServerThreadsPerModel = 1
# ------------------------------
# TENSORRT GPU settings
# ------------------------------
# These only apply when using the TENSORRT version of KataGo.
# For one GPU: optionally uncomment this option and change if the GPU to
# use is not device 0.
# trtDeviceToUse = 0
# For two GPUs: Uncomment these options, AND set numNNServerThreadsPerModel above.
# Also, change their values if the devices you want to use are not 0 and 1.
# trtDeviceToUseThread0 = 0
# trtDeviceToUseThread1 = 1
# For three GPUs: Uncomment these options, AND set numNNServerThreadsPerModel above.
# Also, change their values if the devices you want to use are not 0 and 1 and 2.
# trtDeviceToUseThread0 = 0
# trtDeviceToUseThread1 = 1
# trtDeviceToUseThread2 = 2
# The pattern continues for additional GPUs.
# ------------------------------
# CUDA GPU settings
# ------------------------------
# These only apply when using the CUDA version of KataGo.
# For one GPU: optionally uncomment and change this if the GPU you want to
# use is not device 0
# cudaDeviceToUse = 0
# For two GPUs: Uncomment these options, AND set numNNServerThreadsPerModel above.
# Also, change their values if the devices you want to use are not 0 and 1.
# cudaDeviceToUseThread0 = 0
# cudaDeviceToUseThread1 = 1
# For three GPUs: Uncomment these options, AND set numNNServerThreadsPerModel above.
# Also, change their values if the devices you want to use are not 0 and 1 and 2.
# cudaDeviceToUseThread0 = 0
# cudaDeviceToUseThread1 = 1
# cudaDeviceToUseThread2 = 2
# The pattern continues for additional GPUs.
# KataGo will automatically use FP16 or not based on the compute capability
# of your NVIDIA GPU. If you want to try to force a particular behavior
# you can uncomment these lines and change them to "true" or "false".
# cudaUseFP16 = auto
# cudaUseNHWC = auto
# ------------------------------
# OpenCL GPU settings
# ------------------------------
# These only apply when using the OpenCL version of KataGo.
# Uncomment and set to true to tune OpenCL for every board size separately,
# rather than only the largest possible size.
# openclReTunePerBoardSize = false
# For one GPU: optionally uncomment and change this if the best device to use is guessed incorrectly.
# The default behavior tries to guess the 'best' GPU or device on your system to use, usually it will be a good guess.
# openclDeviceToUse = 0
# For two GPUs: Uncomment these two lines and replace X and Y with the device ids of the devices you want to use.
# It might NOT be 0 and 1, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# For three GPUs: Uncomment these three lines and replace X and Y and Z with the device ids of the devices you want to use.
# It might NOT be 0 and 1 and 2, some computers will have many OpenCL devices. You can see what the devices are when
# KataGo starts up - it should print or log all the devices it finds.
# (AND also set numNNServerThreadsPerModel above)
# openclDeviceToUseThread0 = X
# openclDeviceToUseThread1 = Y
# openclDeviceToUseThread2 = Z
# The pattern continues for additional GPUs.
# KataGo will automatically use FP16 or not based on testing your GPU during
# tuning. If you want to try to force a particular behavior though you can
# uncomment this option and change it to "true" or "false". This is a fairly
# blunt setting - more detailed settings are testable by rerunning the tuner
# with various arguments (./katago tuner).
# openclUseFP16 = auto
# ------------------------------
# Eigen-specific settings
# ------------------------------
# These only apply when using the Eigen (pure CPU) version of KataGo.
# Number of CPU threads for evaluating the neural net on the Eigen backend.
#
# Default: numSearchThreads
# numEigenThreadsPerModel = X
# ===========================================================================
# Root move selection and biases
# ===========================================================================
# Uncomment and edit any of the below values to change them from their default.
# If provided, force usage of a specific seed for various random things in
# the search. The default is to use a random seed.
# searchRandSeed = hijklmn
# Temperature for the early game, randomize between chosen moves with
# this temperature
# chosenMoveTemperatureEarly = 0.5
# Decay temperature for the early game by 0.5 every this many moves,
# scaled with board size.
# chosenMoveTemperatureHalflife = 19
# At the end of search after the early game, randomize between chosen
# moves with this temperature
# chosenMoveTemperature = 0.10
# Subtract this many visits from each move prior to applying
# chosenMoveTemperature (unless all moves have too few visits) to downweight
# unlikely moves
# chosenMoveSubtract = 0
# The same as chosenMoveSubtract but only prunes moves that fall below
# the threshold. This setting does not affect chosenMoveSubtract.
# chosenMovePrune = 1
# Number of symmetries to sample (without replacement) and average at the root
# rootNumSymmetriesToSample = 1
# Using LCB for move selection?
# useLcbForSelection = true
# How many stdevs a move needs to be better than another for LCB selection
# lcbStdevs = 5.0
# Only use LCB override when a move has this proportion of visits as the
# top move.
# minVisitPropForLCB = 0.15
# ===========================================================================
# Internal params
# ===========================================================================
# Uncomment and edit any of the below values to change them from their default.
# Scales the utility of winning/losing
# winLossUtilityFactor = 1.0
# Scales the utility for trying to maximize score
# staticScoreUtilityFactor = 0.10
# dynamicScoreUtilityFactor = 0.30
# Adjust dynamic score center this proportion of the way towards zero,
# capped at a reasonable amount.
# dynamicScoreCenterZeroWeight = 0.20
# dynamicScoreCenterScale = 0.75
# The utility of getting a "no result" due to triple ko or other long cycle
# in non-superko rulesets (-1 to 1)
# noResultUtilityForWhite = 0.0
# The number of wins that a draw counts as, for white. (0 to 1)
# drawEquivalentWinsForWhite = 0.5
# Exploration constant for mcts
# cpuctExploration = 1.0
# cpuctExplorationLog = 0.45
# Parameters that control exploring more in volatile positions, exploring
# less in stable positions.
# cpuctUtilityStdevPrior = 0.40
# cpuctUtilityStdevPriorWeight = 2.0
# cpuctUtilityStdevScale = 0.85
# FPU reduction constant for mcts
# fpuReductionMax = 0.2
# rootFpuReductionMax = 0.1
# fpuParentWeightByVisitedPolicy = true
# Parameters that control weighting of evals based on the net's own
# self-reported uncertainty.
# useUncertainty = true
# uncertaintyExponent = 1.0
# uncertaintyCoeff = 0.25
# Amount to apply a downweighting of children with very bad values relative
# to good ones.
# valueWeightExponent = 0.25
# Slight incentive for the bot to behave human-like with regard to passing at
# the end, filling the dame, not wasting time playing in its own territory,
# etc., and not play moves that are equivalent in terms of points but a bit
# more unfriendly to humans.
# rootEndingBonusPoints = 0.5
# Make the bot prune useless moves that are just prolonging the game to
# avoid losing yet.
# rootPruneUselessMoves = true
# Apply bias correction based on local pattern keys
# subtreeValueBiasFactor = 0.45
# subtreeValueBiasWeightExponent = 0.85
# Use graph search rather than tree search - identify and share search for
# transpositions.
# useGraphSearch = true
# How much to shard the node table for search synchronization
# nodeTableShardsPowerOfTwo = 16
# How many virtual losses to add when a thread descends through a node
# numVirtualLossesPerThread = 1
# Improve the quality of evals under heavy multithreading
# useNoisePruning = true
# ===========================================================================
# Avoid SGF patterns
# ===========================================================================
# The parameters in this section provide a way to avoid moves that follow
# specific patterns based on a set of SGF files loaded upon startup.
# Uncomment them to use this feature. Additionally, if the SGF file
# contains the string %SKIP% in a comment on a move, that move will be
# ignored for this purpose.
# Load SGF files from this directory when the engine is started
# (only on startup, will not reload unless engine is restarted)
# avoidSgfPatternDirs = path/to/directory/with/sgfs/
# You can also surround the file path in double quotes if the file path contains trailing spaces or hash signs.
# Within double quotes, backslashes are escape characters.
# avoidSgfPatternDirs = "path/to/directory/with/sgfs/"
# Penalize this much utility per matching move.
# Set this negative if you instead want to favor SGF patterns instead of
# penalizing them. This number does not need to be large, even 0.001 will
# make a difference. Values that are too large may lead to bad play.
# avoidSgfPatternUtility = 0.001
# Optional - load only the newest this many files
# avoidSgfPatternMaxFiles = 20
# Optional - Penalty is multiplied by this per each older SGF file, so that
# old SGF files matter less than newer ones.
# avoidSgfPatternLambda = 0.90
# Optional - pay attention only to moves made by players with this name.
# For example, set it to the name that your bot's past games will show up
# as in the SGF, so that the bot will only avoid repeating moves that itself
# made in past games, not the moves that its opponents made.
# avoidSgfPatternAllowedNames = my-ogs-bot-name1,my-ogs-bot-name2
# Optional - Ignore moves in SGF files that occurred before this turn number.
# avoidSgfPatternMinTurnNumber = 0
# For more avoid patterns:
# You can also specify a second set of parameters, and a third, fourth,
# etc. by numbering 2,3,4,...
#
# avoidSgf2PatternDirs = ...
# avoidSgf2PatternUtility = ...
# avoidSgf2PatternMaxFiles = ...
# avoidSgf2PatternLambda = ...
# avoidSgf2PatternAllowedNames = ...
# avoidSgf2PatternMinTurnNumber = ...

@ -0,0 +1,216 @@
# Example config for C++ match runner
# This is an example template config for the "match" subcommand of KataGo. e.g:
# ./katago match -config-file configs/match_example.cfg -log-file match.log -sgf-output-dir match_sgfs/
#
# On a good GPU, the match subcommand enables testing of KataGo nets against each other
# or a net against itself with different parameters vastly faster than anything
# else, because multiple games can share GPU batching.
#
# Beware however of using this to test differing numbers of threads or test time-based search limits.
# Because many games will be run simultaneously, they will compete from each other for compute power,
# and although the total will run much faster than if you had run them one by one, you might also get
# substantially different results not reflective of the strength of a configuration when run in a real
# match setting, on a machine by itself. For fixed numbers of visits or playouts instead of fixed time,
# and with numSearchThreads = 1, there should be no problem though, because then the compute time has
# no influence on the result of the computation.
#
# See gtp config for descriptions of most of these params.
#
# For almost any parameter in this config that is related to a bot, rather than to the match as a whole
# (so, visits, search parameters, model files, etc. but NOT the rules, max games, log info, etc)
# you can specify them differentially between different bots by appending the index of the bot.
# For example, if you were testing different numbers of visits, you could try:
#
# numBots = 3
# botName0 = lowVisits
# botName1 = midVisits
# botName2 = highVisits
#
# maxVisits0 = 100
# maxVisits1 = 300
# maxVisits2 = 1000
#
# Or, if you were testing different neural nets, with different search configurations, you could do:
#
# nnModelFile0 = path/to/first/model/file.bin.gz
# nnModelFile1 = path/to/second/model/file.bin.gz
#
# And specify different search parameters for them if you wanted:
# cpuctExploration0 = 1.5
# cpuctExploration1 = 1.3
# Logs------------------------------------------------------------------------------------
logSearchInfo = false
logMoves = false
logGamesEvery = 50
logToStdout = true
# Bots-------------------------------------------------------------------------------------
# For multiple bots, you can specify their names as botName0,botName1, etc.
# If the bots are using different models, specify nnModelFile0, nnModelFile1, etc.
numBots=1
botName=FOO
nnModelFile=PATH_TO_MODEL
# These bots will not play each other, but will still be opponents for other bots
# secondaryBots = 0,1,3
# Only these bots will actually play games. Useful if you have a config file with many more
# bots defined but you want to only selectively enable a few.
# includeBots = 0,2,6
# Match-----------------------------------------------------------------------------------
numGameThreads=8 # How many games to run in parallel at a time?
numGamesTotal=1000000
maxMovesPerGame=1200
allowResignation = true
resignThreshold = -0.95
resignConsecTurns = 6
# Rules------------------------------------------------------------------------------------
# See https://lightvector.github.io/KataGo/rules.html for a description of the rules.
koRules = SIMPLE,POSITIONAL,SITUATIONAL
scoringRules = AREA,TERRITORY
taxRules = NONE,SEKI,ALL
multiStoneSuicideLegals = false,true
hasButtons = false,true
bSizes = 19,13,9
bSizeRelProbs = 90,5,5
komiAuto = True # Automatically adjust komi to what the neural nets think are fair
# komiMean = 7.5 # Specify explicit komi
# policyInitAreaProp = 0
# compensateAfterPolicyInitProb = 1.0 # Additionally make komi fair this often after the high-temperature moves.
# policyInitAreaTemperature = 1
handicapProb = 0.0
handicapCompensateKomiProb = 1.0
# numExtraBlackFixed = 3 # When playing handicap games, always use exactly this many extra black moves
# Search limits-----------------------------------------------------------------------------------
maxVisits = 500
# maxPlayouts = 300
# maxTime = 60
numSearchThreads = 1
# GPU Settings-------------------------------------------------------------------------------
nnMaxBatchSize = 32
nnCacheSizePowerOfTwo = 21
nnMutexPoolSizePowerOfTwo = 17
nnRandomize = true
# How many threads should there be to feed positions to the neural net?
# Server threads are indexed 0,1,...(n-1) for the purposes of the below GPU settings arguments
# that specify which threads should use which GPUs.
# NOTE: This parameter is probably ONLY useful if you have multiple GPUs, since each GPU will need a thread.
# If you're tuning single-GPU performance, use numSearchThreads instead.
numNNServerThreadsPerModel = 1
# TENSORRT GPU settings--------------------------------------
# These only apply when using the TENSORRT version of KataGo.
# IF USING ONE GPU: optionally uncomment and change this if the GPU you want to use turns out to be not device 0
# trtDeviceToUse = 0
# IF USING TWO GPUS: Uncomment these two lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# IF USING THREE GPUS: Uncomment these three lines (AND set numNNServerThreadsPerModel above):
# trtDeviceToUseThread0 = 0 # change this if the first GPU you want to use turns out to be not device 0
# trtDeviceToUseThread1 = 1 # change this if the second GPU you want to use turns out to be not device 1
# trtDeviceToUseThread2 = 2 # change this if the third GPU you want to use turns out to be not device 2
# You can probably guess the pattern if you have four, five, etc. GPUs.
# CUDA GPU settings--------------------------------------
# For the below, "model" refers to a neural net, from the nnModelFile parameter(s) above.
# cudaGpuToUse = 0 #use gpu 0 for all server threads (numNNServerThreadsPerModel) unless otherwise specified per-model or per-thread-per-model
# cudaGpuToUseModel0 = 3 #use gpu 3 for model 0 for all threads unless otherwise specified per-thread for this model
# cudaGpuToUseModel1 = 2 #use gpu 2 for model 1 for all threads unless otherwise specified per-thread for this model
# cudaGpuToUseModel0Thread0 = 3 #use gpu 3 for model 0, server thread 0
# cudaGpuToUseModel0Thread1 = 2 #use gpu 2 for model 0, server thread 1
# cudaUseFP16 = auto
# cudaUseNHWC = auto
# OpenCL GPU settings--------------------------------------
# These only apply when using OpenCL as the backend for inference.
# (For GTP, we only ever have one model, when playing matches, we might have more than one, see match_example.cfg)
# Default behavior is just to always use gpu 0, you will want to uncomment and adjust one or more of these lines
# to take advantage of a multi-gpu machine
# openclGpuToUse = 0 #use gpu 0 for all server threads (numNNServerThreadsPerModel) unless otherwise specified per-model or per-thread-per-model
# openclGpuToUseModel0 = 3 #use gpu 3 for model 0 for all threads unless otherwise specified per-thread for this model
# openclGpuToUseModel1 = 2 #use gpu 2 for model 1 for all threads unless otherwise specified per-thread for this model
# openclGpuToUseModel0Thread0 = 3 #use gpu 3 for model 0, server thread 0
# openclGpuToUseModel0Thread1 = 2 #use gpu 2 for model 0, server thread 1
# Uncomment to tune OpenCL for every board size separately, rather than only the largest possible size
# openclReTunePerBoardSize = true
# openclUseFP16 = auto
# Eigen-specific settings--------------------------------------
# These only apply when using the Eigen (pure CPU) version of KataGo.
# This is the number of CPU threads for evaluating the neural net on the Eigen backend.
# It defaults to numSearchThreads.
# numEigenThreadsPerModel = X
# Root move selection and biases------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Values in this section can be specified per-bot as well
chosenMoveTemperatureEarly = 0.60
# chosenMoveTemperatureHalflife = 19
chosenMoveTemperature = 0.20
# chosenMoveSubtract = 0
# chosenMovePrune = 1
# rootNumSymmetriesToSample = 1
# useLcbForSelection = true
# lcbStdevs = 5.0
# minVisitPropForLCB = 0.15
# Internal params------------------------------------------------------------------------------
# Uncomment and edit any of the below values to change them from their default.
# Values in this section can be specified per-bot as well
# winLossUtilityFactor = 1.0
# staticScoreUtilityFactor = 0.10
# dynamicScoreUtilityFactor = 0.30
# dynamicScoreCenterZeroWeight = 0.20
# dynamicScoreCenterScale = 0.75
# noResultUtilityForWhite = 0.0
# drawEquivalentWinsForWhite = 0.5
# cpuctExploration = 0.9
# cpuctExplorationLog = 0.4
# fpuReductionMax = 0.2
# rootFpuReductionMax = 0.1
# fpuParentWeightByVisitedPolicy = true
# valueWeightExponent = 0.25
# rootEndingBonusPoints = 0.5
# rootPruneUselessMoves = true
# subtreeValueBiasFactor = 0.45
# subtreeValueBiasWeightExponent = 0.85
# useGraphSearch = true
# nodeTableShardsPowerOfTwo = 16
# numVirtualLossesPerThread = 1

@ -37,7 +37,7 @@ func testSingleGtpEngine() {
gtpEngine.Start(gtpName, gtpArgs...)
gtpEngine.SetLevel(10)
if !gtpEngine.Sync(13, 6.5, []string{}, gtp2) {
if !gtpEngine.Sync(13, 2.75, 6.5, []string{}, gtp2) {
return
}
@ -60,7 +60,7 @@ func testMultipleGtpEngines() {
testNgin := func(ngin *gtp.GtpEngine, plays [][]string) {
ngin.SetLevel(1)
if !ngin.Sync(13, 6.5, []string{}, plays) {
if !ngin.Sync(13, 2.75, 6.5, []string{}, plays) {
return
}

Loading…
Cancel
Save