4 files changed
+65
-28
No files matched your search
@@ -80,15 +80,23 @@ maxVisits = 500
|
||||
# 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 doesn't necessarily have much to do with how many cores you
|
||||
# have on your system, and could easily exceed the number of cores. GPU batching is (usually) the dominant consideration.
|
||||
numAnalysisThreads = 8
|
||||
numSearchThreadsPerAnalysisThread = 8
|
||||
numSearchThreads = 8
|
||||
|
||||
|
||||
# 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 = 96
|
||||
nnMaxBatchSize = 64
|
||||
|
||||
# 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
|
||||
|
||||
# Uncomment and set these smaller if you ONLY are going to use the analysis engine for smaller boards (or plan to
|
||||
# run multiple instances, with some instances only handling smaller boards). It should improve performance.
|
||||
@@ -104,7 +112,7 @@ nnMaxBatchSize = 96
|
||||
# Other General GPU Settings-------------------------------------------------------------------------------
|
||||
|
||||
# Cache up to 2 ** this many neural net evaluations in case of transpositions in the tree.
|
||||
nnCacheSizePowerOfTwo = 19
|
||||
nnCacheSizePowerOfTwo = 20
|
||||
# Size of mutex pool for nnCache is 2 ** this
|
||||
nnMutexPoolSizePowerOfTwo = 16
|
||||
# Randomize board orientation when running neural net evals?
|
||||
|
||||
Binary file not shown.
+42
-16
@@ -10,14 +10,14 @@ from kivy.core.window import Window
|
||||
from kivy.graphics.context_instructions import Color
|
||||
from kivy.graphics.vertex_instructions import Ellipse, Line, Rectangle
|
||||
from kivy.metrics import dp
|
||||
from kivy.properties import BooleanProperty, ListProperty, ObjectProperty, NumericProperty
|
||||
from kivy.properties import BooleanProperty, ListProperty, NumericProperty, ObjectProperty
|
||||
from kivy.uix.dropdown import DropDown
|
||||
from kivy.uix.widget import Widget
|
||||
from kivymd.app import MDApp
|
||||
from kivymd.uix.boxlayout import MDBoxLayout
|
||||
from kivymd.uix.floatlayout import MDFloatLayout
|
||||
|
||||
from katrain.core.constants import MODE_PLAY, OUTPUT_DEBUG
|
||||
from katrain.core.constants import MODE_PLAY, OUTPUT_DEBUG, STATUS_TEACHING
|
||||
from katrain.core.game import Move
|
||||
from katrain.core.lang import i18n
|
||||
from katrain.core.utils import evaluation_class, var_to_grid
|
||||
@@ -63,8 +63,7 @@ class BadukPanWidget(Widget):
|
||||
self.draw_hover_contents()
|
||||
|
||||
def on_touch_down(self, touch):
|
||||
self.animating_pv = None # any click kills PV from label/move
|
||||
self.draw_hover_contents()
|
||||
self.set_animating_pv(None, None) # any click kills PV from label/move
|
||||
if "button" in touch.profile and touch.button != "left":
|
||||
return
|
||||
self.check_next_move_ghost(touch)
|
||||
@@ -89,13 +88,11 @@ class BadukPanWidget(Widget):
|
||||
if near_move:
|
||||
self.set_animating_pv(near_move[0][0], near_move[0][1])
|
||||
else:
|
||||
self.animating_pv = None
|
||||
self.draw_hover_contents()
|
||||
self.set_animating_pv(None, None) # any click kills PV from label/move
|
||||
if inside and self.animating_pv is not None:
|
||||
d_sq = (pos[0] - self.animating_pv[3][0]) ** 2 + (pos[1] - self.animating_pv[3][1])
|
||||
if d_sq > 2 * self.stone_size ** 2: # move too far from where it was activated
|
||||
self.animating_pv = None
|
||||
self.draw_hover_contents()
|
||||
self.set_animating_pv(None, None) # any click kills PV from label/move
|
||||
self.last_mouse_pos = pos
|
||||
|
||||
def play_stone_sound(self, *_args):
|
||||
@@ -307,19 +304,40 @@ class BadukPanWidget(Widget):
|
||||
self.draw_stone(1, y, "B", innercol=STONE_COLORS["W"], evalcol=evalcol)
|
||||
self.draw_stone(2, y, "W", evalcol=evalcol, evalscale=y / (board_size_y - 1))
|
||||
self.draw_stone(3, y, "W", innercol=STONE_COLORS["B"], evalcol=evalcol)
|
||||
# self.draw_stone(4, y, evalcol=[*evalcol[:3], 0.5], scale=0.8)
|
||||
|
||||
# ownership - allow one move out of date for smooth animation
|
||||
ownership = current_node.ownership or (current_node.parent and current_node.parent.ownership)
|
||||
if katrain.analysis_controls.ownership.active and ownership:
|
||||
ownership_grid = var_to_grid(ownership, (board_size_x, board_size_y))
|
||||
rsz = self.grid_size * 0.2
|
||||
for y in range(board_size_y - 1, -1, -1):
|
||||
for x in range(board_size_x):
|
||||
ix_owner = "B" if ownership_grid[y][x] > 0 else "W"
|
||||
if ix_owner != (has_stone.get((x, y), -1)):
|
||||
Color(*STONE_COLORS[ix_owner][:3], abs(ownership_grid[y][x]))
|
||||
Rectangle(pos=(self.gridpos_x[x] - rsz / 2, self.gridpos_y[y] - rsz / 2), size=(rsz, rsz))
|
||||
if (
|
||||
current_node.children
|
||||
and katrain.controls.status_state[1] == STATUS_TEACHING
|
||||
and current_node.children[-1].auto_undo
|
||||
and current_node.children[-1].ownership
|
||||
): # loss
|
||||
loss_grid = var_to_grid(
|
||||
[a - b for a, b in zip(current_node.children[-1].ownership, ownership)],
|
||||
(board_size_x, board_size_y),
|
||||
)
|
||||
|
||||
for y in range(board_size_y - 1, -1, -1):
|
||||
for x in range(board_size_x):
|
||||
loss = max(0, (-1 if current_node.children[-1].move.player == "B" else 1) * loss_grid[y][x])
|
||||
if loss > 0:
|
||||
Color(*EVAL_COLORS[self.trainer_config["theme"]][1][:3], loss)
|
||||
Rectangle(
|
||||
pos=(self.gridpos_x[x] - rsz / 2, self.gridpos_y[y] - rsz / 2), size=(rsz, rsz)
|
||||
)
|
||||
else:
|
||||
ownership_grid = var_to_grid(ownership, (board_size_x, board_size_y))
|
||||
for y in range(board_size_y - 1, -1, -1):
|
||||
for x in range(board_size_x):
|
||||
ix_owner = "B" if ownership_grid[y][x] > 0 else "W"
|
||||
if ix_owner != (has_stone.get((x, y), -1)):
|
||||
Color(*STONE_COLORS[ix_owner][:3], abs(ownership_grid[y][x]))
|
||||
Rectangle(
|
||||
pos=(self.gridpos_x[x] - rsz / 2, self.gridpos_y[y] - rsz / 2), size=(rsz, rsz)
|
||||
)
|
||||
|
||||
policy = current_node.policy
|
||||
if (
|
||||
@@ -515,11 +533,19 @@ class BadukPanWidget(Widget):
|
||||
draw_text(pos=board_coords, text=str(i + 1), font_size=self.grid_size * sizefac / 1.45, font_name="Roboto")
|
||||
|
||||
def set_animating_pv(self, pv, node):
|
||||
if pv == None:
|
||||
self.animating_pv = None
|
||||
|
||||
if node is not None and (
|
||||
not self.animating_pv or not (self.animating_pv[0] == pv and self.animating_pv[1] == node)
|
||||
):
|
||||
self.animating_pv = (pv, node, time.time(), self.last_mouse_pos)
|
||||
|
||||
if self.katrain.controls.status_state[1] == STATUS_TEACHING and self.katrain.analysis_controls.ownership.active:
|
||||
self.draw_board_contents() # loss visualization
|
||||
else:
|
||||
self.draw_hover_contents()
|
||||
|
||||
def show_pv_from_comments(self, pv_str):
|
||||
self.set_animating_pv(pv_str[1:].split(" "), self.katrain.controls.active_comment_node.parent)
|
||||
|
||||
|
||||
+12
-9
@@ -445,17 +445,19 @@ class ConfigPopup(QuickConfigGui):
|
||||
|
||||
KATAGOS = {
|
||||
"win": {
|
||||
"Official OpenCL v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-gpu-opencl-windows-x64.zip",
|
||||
"Official OpenCL v1.6.0 (32 bit)": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-gpu-opencl-windows-x32-dont-use-unless-actually-32bit-windows.zip",
|
||||
"Official CUDA v1.6.0 (New NVIDIA cards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-gpu-cuda10.2-windows-x64.zip",
|
||||
"Eigen AVX2 (Modern CPUs) v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-cpu-eigen-avx2-windows-x64.zip",
|
||||
"Eigen (CPU, Non-optimized) v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-cpu-eigen-windows-x64.zip",
|
||||
"OpenCL v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-gpu-opencl-windows-x64.zip",
|
||||
"OpenCL v1.6.1 (32 bit)": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-gpu-opencl-windows-x32-dont-use-unless-actually-32bit-windows.zip",
|
||||
"CUDA v1.6.1 (New NVIDIA cards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-gpu-cuda10.2-windows-x64.zip",
|
||||
"Eigen AVX2 (Modern CPUs) v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-cpu-eigen-avx2-windows-x64.zip",
|
||||
"Eigen (CPU, Non-optimized) v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-cpu-eigen-windows-x64.zip",
|
||||
"OpenCL v1.6.1 (bigger boards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.1%2Bbs29/katago-v1.6.1+bs29-gpu-opencl-windows-x64.zip",
|
||||
},
|
||||
"linux": {
|
||||
"Official OpenCL v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-gpu-opencl-linux-x64.zip",
|
||||
"Official CUDA v1.6.0 (New NVIDIA cards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-gpu-cuda10.2-linux-x64.zip",
|
||||
"Eigen AVX2 (Modern CPUs) v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-cpu-eigen-avx2-linux-x64.zip",
|
||||
"Eigen (CPU, Non-optimized) v1.6.0": "https://github.com/lightvector/KataGo/releases/download/v1.6.0/katago-v1.6.0-cpu-eigen-linux-x64.zip",
|
||||
"OpenCL v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-gpu-opencl-linux-x64.zip",
|
||||
"CUDA v1.6.1 (New NVIDIA cards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-gpu-cuda10.2-linux-x64.zip",
|
||||
"Eigen AVX2 (Modern CPUs) v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-cpu-eigen-avx2-linux-x64.zip",
|
||||
"Eigen (CPU, Non-optimized) v1.6.1": "https://github.com/lightvector/KataGo/releases/download/v1.6.1/katago-v1.6.1-cpu-eigen-linux-x64.zip",
|
||||
"OpenCL v1.6.1 (bigger boards)": "https://github.com/lightvector/KataGo/releases/download/v1.6.1%2Bbs29/katago-v1.6.1+bs29-gpu-opencl-linux-x64.zip",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -525,6 +527,7 @@ class ConfigPopup(QuickConfigGui):
|
||||
if f.lower().endswith("dll"):
|
||||
with open(os.path.join(os.path.split(path)[0], f), "wb") as fout:
|
||||
fout.write(zipObj.read(f))
|
||||
os.remove(tmp_path)
|
||||
else:
|
||||
os.rename(tmp_path, path)
|
||||
self.katrain.log(f"Download of katago binary {binary} model complete -> {path}", OUTPUT_INFO)
|
||||
|
||||
Reference in new issue
Block a user