Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update squeeze-excitation + ladder/legality/liberty to gcp/next #97

Open
wants to merge 102 commits into
base: patch-31
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
488de43
Use L2-norm in self check.
Ttl Aug 6, 2018
d2ad525
OpenCL tuner fixes.
Ttl Aug 9, 2018
87c95c4
Change policy vector to array.
TFiFiE Aug 10, 2018
e72496d
Fall back to single precision net on breakage.
ihavnoid Aug 14, 2018
681229a
AutoGTP: use compressed weights networks.
marcocalignano Aug 14, 2018
07c908e
Fix OpenCL buffer sizes.
Ttl Aug 14, 2018
f85a685
Script for quantizing weights.
Ttl Aug 16, 2018
ebfe51a
Network initialization restructuring.
ihavnoid Aug 20, 2018
7e889c7
Fix comments, code style.
gcp Aug 20, 2018
8bb0da6
Validation: support GTP commands for each binary.
Hersmunch Aug 20, 2018
bd36100
Don't refer to stone locations as "squares".
TFiFiE Aug 20, 2018
6eecb1e
Don't use "void" as function parameter.
TFiFiE Sep 3, 2018
0549816
Isolate and clean up text-to-vertex conversion.
TFiFiE Sep 5, 2018
73f1f93
Packaging improvements.
infinity0 Sep 5, 2018
f3fbcaa
Improve MTCS a bit.
Sep 5, 2018
1042cb6
Convert string before variadic function call.
TFiFiE Sep 7, 2018
51cba90
Always expect 2 arguments after "play" command.
TFiFiE Sep 7, 2018
b290f47
Update README with new boost dependencies.
jest Sep 7, 2018
5d4bd2f
Fix boost package reference for VS2017 build.
kuba97531 Sep 13, 2018
5bd2ef4
Added missing files to MSVC 2015 projects.
ihavnoid Sep 13, 2018
dd95cab
Make Winograd matrices global.
Ttl Sep 13, 2018
5412e66
OpenCL : Don't copy on weight construction.
ihavnoid Sep 13, 2018
7e13bf0
Winograd filter transform and CPU in transform optimization.
Ttl Sep 13, 2018
15e1bd1
"Lockless" UCTNode.
ihavnoid Sep 13, 2018
cd48427
Pass network weight as a std::shared_ptr class.
ihavnoid Sep 13, 2018
0a0d134
Fix vectorized Winograd transform.
Ttl Sep 14, 2018
c21c8a4
Remove unused lambda capture.
TFiFiE Sep 17, 2018
cff3917
Reduce network memory usage when autodetecting.
ihavnoid Sep 17, 2018
8b628ea
Make maximum memory consumption configurable.
kuba97531 Sep 17, 2018
c6999fc
Assorted style nits and minor bugfixes.
gcp Sep 17, 2018
aaf1038
Fix "NN eval" so it is never the search result.
gcp Sep 17, 2018
71c6a36
Update .gitignore to include ".vs/".
AncalagonX Sep 19, 2018
bf2e767
Add some more const correctness.
nerai Sep 24, 2018
dac5a1f
Fixes assert failure on wait_expanded().
ihavnoid Sep 24, 2018
8abf0d2
Only run assertion logic in debug mode.
gcp Sep 24, 2018
a0f60cb
Make lz-analyze output policy prior.
alreadydone Sep 24, 2018
c64dd2a
Fix up lz-analyse formats.
gcp Sep 24, 2018
142199c
Fix memory estimation for auto-detected gpu.
kuba97531 Sep 25, 2018
72431e2
Include Eigen as BLAS replacement.
gcp Sep 26, 2018
0b3ee48
Add side to move in lz-analyze command.
gcp Sep 26, 2018
04aeb54
Autoselect half mode for fp16 compute.
gcp Sep 26, 2018
720d5af
Don't let printsgf output consecutive newlines.
gcp Sep 26, 2018
8f6f830
Add Eigen include path to MSVC 2017 solution.
gcp Sep 26, 2018
e2d16fa
Remove set SDK in MSVC 2017 solution.
gcp Sep 26, 2018
408efbb
Appveyor jobs for msbuild in MSVC 2015/2017.
ChinChangYang Oct 1, 2018
a261168
Fix fp16/fp32 autodetection.
ihavnoid Oct 4, 2018
cd1de6e
Update README.md.
gcp Oct 12, 2018
6881787
Add GNUInstallDirs include.
gcp Oct 15, 2018
1c384e1
Implement more options in lz-setoption.
gcp Oct 15, 2018
4830a95
Fix assert-fail when memory is completely full.
ihavnoid Oct 15, 2018
7f5073e
Report tuner errors to stderr.
Ttl Oct 15, 2018
60f0cff
Fixes for various net initialization issues.
ihavnoid Oct 15, 2018
2e079fc
Update OpenCL headers link.
gcp Oct 22, 2018
8a57a85
Add missing GTP terminator for lz-setoption cases.
gcp Oct 22, 2018
4bd7cd4
Switch AutoGTP to HTTPS.
gcp Oct 22, 2018
a1a4af8
Remove COLAB Readme.
gcp Oct 23, 2018
ac88220
Update links and Todo in README.
gcp Oct 23, 2018
fc54323
Remove reference to Colab README.
gcp Oct 23, 2018
82d5f25
Tiny style fix.
gcp Oct 23, 2018
b2a40e4
Separate FPU-reduction variable for root.
TFiFiE Oct 29, 2018
40260b0
Link to instructions for running on the cloud.
wonderingabout Oct 29, 2018
a0baa60
Update FAQ.md.
LL145 Oct 29, 2018
2e4f3e6
Fix Windows flag check for input buffering.
gcp Oct 29, 2018
d1225db
Update AUTHORS.
gcp Oct 31, 2018
4fd6e69
Bump version numbers.
gcp Oct 31, 2018
6d16497
AutoGTP: update build dir of leelaz in README.md.
gcp Nov 2, 2018
1fe59c6
Correctly initialize board when reading SGF.
zliu1022 Nov 5, 2018
5cd4d8f
Increase memory limit for 32-bit builds.
gcp Nov 5, 2018
631b88f
Never select a CPU during OpenCL autodetection.
gcp Nov 5, 2018
6f58159
Fix tuner for heterogeneous GPUs and auto precision.
ihavnoid Nov 15, 2018
32c75e3
Optimized out and out_in kernels.
Ttl Nov 15, 2018
c72cb3a
Update OpenCL C++ headers.
gcp Nov 16, 2018
b833952
CPU-only eval performance optimization.
ihavnoid Nov 17, 2018
304f9c7
Convolve in/out performance optimization.
ihavnoid Nov 17, 2018
fc8d080
Validation: fix -k option.
Hersmunch Nov 17, 2018
6e88b95
Add link to Azure free trial instructions.
gcp Nov 19, 2018
666c0c6
Cleanup atomics and dead if.
sethtroisi Nov 20, 2018
8670a40
Const in SGFTree.
sethtroisi Nov 20, 2018
77582b9
Make the README more clear.
gcp Nov 26, 2018
8daa0cd
Refactor to allow AutoGTP to use Engine.
Hersmunch Nov 29, 2018
64097f0
Fix printf call style.
Dec 4, 2018
c157d0b
Update Khronos OpenCL C++ headers.
gcp Dec 7, 2018
bc3e750
Cleanup loop code.
sethtroisi Nov 20, 2018
d166740
AutoGTP: allow specifying an SGF as initial position.
Hersmunch Dec 19, 2018
08efb53
Support separate options for white in match games.
Hersmunch Dec 24, 2018
39be654
Add O(sqrt(log(n))) scaling to tree search.
Ttl Dec 7, 2018
21e3580
Option to get network output without writing to cache.
TFiFiE Dec 24, 2018
808bb43
Add permission to link with NVIDIA libs. Update year.
gcp Jan 4, 2019
ce41cc1
Add link to GoReviewPartner.
roy7 Jan 15, 2019
4ca0734
Reminder to install OpenCL driver if seperate.
gcp Jan 15, 2019
d4c0380
Fixed leelaz_file on Android.
inclement Jan 15, 2019
f944b97
Fix 'catching polymorphic type by value' warning.
akdtg Jan 15, 2019
4f12925
Fixed converter script for minigo removing bias.
sethtroisi Jan 15, 2019
44d0e6a
Add zlib to the mac OS X build instructions.
gcp Jan 15, 2019
d192fc6
UCTNodePtr rare race condition fix.
ihavnoid Jan 15, 2019
bd0d667
Make sure analysis is printed at least once.
dbosst Jan 15, 2019
1960e93
Don't post if not requested.
gcp Jan 15, 2019
fc83ec7
AutoGTP: Allow specifying initial GTP commands.
Hersmunch Jan 15, 2019
c7feb53
Update Eigen to 3.3.7.
gcp Jan 15, 2019
085d71b
Fix lz-setoption name playouts.
gcp Jan 22, 2019
9831c96
AutoGTP: More info in SGF comments.
Hersmunch Jan 22, 2019
885b9eb
copy branch
alreadydone Jan 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ training/tf/venv
leelaz-model*
*.orig
leelaz_opencl_tuning
/build-autogtp-*
/build-validation-*
.vs/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "gtest"]
path = gtest
url = https://github.com/google/googletest.git
[submodule "src/Eigen"]
path = src/Eigen
url = https://github.com/eigenteam/eigen-git-mirror
11 changes: 10 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ jobs:
script:
- docker build -f Dockerfiles/Dockerfile.gpu -t leela-zero:gpu .
- docker run leela-zero:gpu
- script:
- docker build -f Dockerfiles/Dockerfile.gpu-blas -t leela-zero:gpu-blas .
- docker run leela-zero:gpu-blas
- script:
- docker build -f Dockerfiles/Dockerfile.cpu -t leela-zero:cpu .
- docker run leela-zero:cpu
- script:
- docker build -f Dockerfiles/Dockerfile.cpu-blas -t leela-zero:cpu-blas .
- docker run leela-zero:cpu-blas
- script:
- docker build -f Dockerfiles/Dockerfile.tests -t leela-zero:tests .
- docker run leela-zero:tests
- script:
- docker build -f Dockerfiles/Dockerfile.tests-blas -t leela-zero:tests-blas .
- docker run leela-zero:tests-blas
- stage: style
before_install:
script: find . -regex ".*\.\(cpp\|h\|hpp\)" -not -regex ".*moc_.*.cpp" -not -path "./gtest/*" -not -path "./training/*" -not -path "./src/half/*" -not -path "./src/CL/*" | xargs python2 scripts/cpplint.py --filter=-build/c++11,-build/include,-build/include_order,-build/include_what_you_use,-build/namespaces,-readability/braces,-readability/casting,-readability/fn_size,-readability/namespace,-readability/todo,-runtime/explicit,-runtime/indentation_namespace,-runtime/int,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comma,-whitespace/comments,-whitespace/empty_loop_body,-whitespace/line_length,-whitespace/semicolon
script: find . -regex ".*\.\(cpp\|h\|hpp\)" -not -regex ".*moc_.*.cpp" -not -path "./gtest/*" -not -path "./training/*" -not -path "./src/half/*" -not -path "./src/CL/*" -not -path "./src/Eigen/*" | xargs python2 scripts/cpplint.py --filter=-build/c++11,-build/include,-build/include_order,-build/include_what_you_use,-build/namespaces,-readability/braces,-readability/casting,-readability/fn_size,-readability/namespace,-readability/todo,-runtime/explicit,-runtime/indentation_namespace,-runtime/int,-runtime/references,-whitespace/blank_line,-whitespace/braces,-whitespace/comma,-whitespace/comments,-whitespace/empty_loop_body,-whitespace/line_length,-whitespace/semicolon
28 changes: 21 additions & 7 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
Gian-Carlo Pascutto
Gian-Carlo Pascutto
Henrik Forstén
Seth Troisi
Marco Calignano
Henrik Forstén
Andy Olsen
Junhee Yoo
TFiFiE
Junhee Yoo
Andy Olsen
Bood Qian
Peter Wen
ywrt
Hersmunch
Arseny Krasutsky
earthengine
Mankit Pong
michael
Hersmunch
Barry G Becker
Jonathan Roy
Junyan Xu
Maks Kolman
kuba97531
Antti Korhonen
Mankit Pong
Chin-Chang Yang
Xingcan LAN
bittsitt
tux3
5525345551
Alderi-Tokori
Ancalagon
Ashley Griffiths
Barry Becker
Ed Lee
Eddh
F. Huizinga
FFLaguna
Jiannan Liu
Joe Ren
Jonathan Roy
LL145
Mark Andrew Gerads
Nate
OmnipotentEntity
Przemek Wesołek
Sebastian
Shen-Ta Hsieh(BestSteve)
Virgile Andreani
Ximin Luo
afalturki
cheshirecats
fohristiwhirl
gaieepo
tterava
wonderingabout
zediir
Пахотин Иван
Google LLC
31 changes: 19 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of Leela Zero.
# Copyright (C) 2017 Marco Calignano
# Copyright (C) 2017-2018 Gian-Carlo Pascutto and contributors
# Copyright (C) 2017-2019 Gian-Carlo Pascutto and contributors
# Leela Zero is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -15,14 +15,15 @@
cmake_minimum_required(VERSION 3.1)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
include(GNUInstallDirs)

project(leelaz)
add_subdirectory(gtest EXCLUDE_FROM_ALL) # We don't want to install gtest, exclude it from `all`

# Required Packages
set(Boost_MIN_VERSION "1.58.0")
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.58.0 REQUIRED program_options)
find_package(Boost 1.58.0 REQUIRED program_options filesystem)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(OpenCL REQUIRED)
Expand All @@ -32,14 +33,20 @@ find_package(OpenCL REQUIRED)
if(NOT APPLE)
set(BLA_VENDOR OpenBLAS)
endif()
find_package(BLAS REQUIRED)
find_path(BLAS_INCLUDE_DIRS openblas_config.h
/usr/include
/usr/local/include
/usr/include/openblas
/opt/OpenBLAS/include
/usr/include/x86_64-linux-gnu
$ENV{BLAS_HOME}/include)
if(USE_BLAS)
message(STATUS "Looking for system BLAS/OpenBLAS library.")
find_package(BLAS REQUIRED)
find_path(BLAS_INCLUDE_DIRS openblas_config.h
/usr/include
/usr/local/include
/usr/include/openblas
/opt/OpenBLAS/include
/usr/include/x86_64-linux-gnu
$ENV{BLAS_HOME}/include)
add_definitions(-DUSE_BLAS)
else()
message(STATUS "Using built-in matrix library.")
endif()
find_package(Qt5Core)

set(CMAKE_CXX_STANDARD 14)
Expand Down Expand Up @@ -79,7 +86,7 @@ if(USE_HALF)
add_definitions(-DUSE_HALF)
endif()

set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(IncludePath "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/src/Eigen")
set(SrcPath "${CMAKE_CURRENT_SOURCE_DIR}/src")

include_directories(${IncludePath})
Expand Down Expand Up @@ -108,7 +115,7 @@ target_link_libraries(leelaz ${BLAS_LIBRARIES})
target_link_libraries(leelaz ${OpenCL_LIBRARIES})
target_link_libraries(leelaz ${ZLIB_LIBRARIES})
target_link_libraries(leelaz ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS leelaz DESTINATION bin)
install(TARGETS leelaz DESTINATION ${CMAKE_INSTALL_BINDIR})

if(Qt5Core_FOUND)
if(NOT Qt5Core_VERSION VERSION_LESS "5.3.0")
Expand Down
32 changes: 0 additions & 32 deletions COLAB.md

This file was deleted.

6 changes: 6 additions & 0 deletions Dockerfiles/Dockerfile.cpu-blas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM leela-zero:base

# CPU build
RUN CXX=g++ CC=gcc cmake -DUSE_CPU_ONLY=1 -DUSE_BLAS=1 ..

CMD cmake --build . --target leelaz --config Release -- -j2
6 changes: 6 additions & 0 deletions Dockerfiles/Dockerfile.gpu-blas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM leela-zero:base

# GPU build
RUN CXX=g++ CC=gcc cmake -DUSE_BLAS=1 ..

CMD cmake --build . --target leelaz --config Release -- -j2
8 changes: 8 additions & 0 deletions Dockerfiles/Dockerfile.tests-blas
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM leela-zero:base

# CPU build
RUN CXX=g++ CC=gcc cmake -DUSE_CPU_ONLY=1 -DUSE_BLAS=1 ..
RUN cmake --build . --target tests --config Release -- -j2

CMD ./tests

32 changes: 0 additions & 32 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@

AZ also had this behavior, besides we're testing our approach right now. Please be patient.

## 为什么现在训练的是5/6 block网络,而AZ用的是20block ##
## Why the network size is only 6 blocks comparing to 20 blocks of AZ ##

在项目起步阶段,较小的网络可以在短时间内得到结果,也可以尽早发现/解决问题,

目前的主要目的是为了测试系统的可行性,这对今后的完整重现十分重要(为将来的大网络打好基础)。

This is effectively a testing run to see if the system works, and which things are important for doing a full run. I expected 10 to 100 people to run the client, not 600.

Even so, the 20 block version is 13 times more computationally expensive, and expected to make SLOWER progress early on. I think it's unwise to do such a run unless it's proven that the setup works, because you are going to be in for a very long haul.

## 为什么比较两个网络强弱时经常下十几盘就不下了 ##
## Why only dozens of games are played when comparing two networks ##

Expand All @@ -33,27 +22,6 @@ We use SPRT to decide if a newly trained network is better. A better network is

The MCTS playouts of self-play games is only 3200, and with noise added (For randomness of each move thus training has something to learn from). If you load Leela Zero with Sabaki, you'll probably find it is actually not that weak.

## 自对弈为什么使用1000的模拟次数,而不是AZ的1600 ##
## For self-play, why use 3200 visits instead of 1600 playouts as AZ ##

没人知道AZ的1600是怎么得到的。这里的3200是基于下面几点估计得到的:

1. 对于某一个选点,MCTS需要模拟几次才能得出概率结果。在开始阶段,每个选点的概率不会差太多,所以开始的360次模拟大概会覆盖整个棋盘。所以如果要让某些选点可以做几次模拟的话,大概需要2到3 x 360次的模拟。

2. 在computer-go上有人跑过7x7的实验,看到模拟次数从1000到2000的时候性能有提高。所以如果我们观察到瓶颈的时候,可能是可以考虑增加模拟次数。

3. 模拟次数太多会影响得到数据的速度。

Nobody knows. The Zero paper doesn't mention how they arrive at this number, and I know of no sound background to estimate the optimal. I chose it based on some observations:

a) For the MCTS to feed back search probabilities to the learning, it must be able to achieve a reasonable amount of look-ahead on at least a few variations. In the beginning, when the network is untrained, the move probabilities are not very extreme, and this means that the first 360~ simulations will be spent expanding every answer at the root. So if we want to expand at least a few moves, we probably need 2 to 3 x 360 playouts.

b) One person on computer-go, who ran a similar experiment on 7x7, reported that near the end of the learning, he observed increased performance from increasing the number from 1000 to 2000. So maybe this is worthwhile to try when the learning speed starts to decrease or flatten out. But it almost certainly isn't needed early on.

c) Obviously, the speed of acquiring data is linearly related to this setting.

So, the current number is a best guess based on these observations. To be sure what the best value is, one would have to rerun this experiment several times.

## 有些自对弈对局非常短 ##
## Very short self-play games ends with White win?! ##

Expand Down
Loading