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

Merge /next of 0.15 #25

Open
wants to merge 230 commits into
base: phoenix
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
648b230
Add multi GPU training support.
godmoves May 14, 2018
237b578
Extend GTP to support real time search info.
bittsitt May 14, 2018
6e847e1
Remove virtual loss from eval for live stats.
gcp May 14, 2018
9fd7542
Make analysis output use one move per line.
gcp May 14, 2018
1b64435
Remove versioned clang from Makefile.
gcp May 14, 2018
62ddf58
Fix varargs usage.
gcp May 14, 2018
c822e5e
AutoGTP: send leelaz version to server.
marcocalignano May 16, 2018
8751123
Multi GPU: fix split and variable placement.
godmoves May 17, 2018
0300531
Mutex optimization.
OmnipotentEntity May 17, 2018
8daa7e7
Update leela-zero.vcxproj for VS2015.
alreadydone May 18, 2018
893a078
Add order to analysis data.
bittsitt May 25, 2018
5f8b14b
Fix misleading comments & naming.
gcp May 28, 2018
4c9b41c
Add Lizzie and LeelaSabaki to README.
roy7 Jun 4, 2018
74f82fb
Make Debian package with CMake.
ChinChangYang Jun 4, 2018
dae7011
Look for symmetry on NNCache lookup.
gcp Jun 4, 2018
e919e1c
Symmetry calculation cleanup.
TFiFiE Jun 6, 2018
d362ee8
Non-pruning (simple) time management.
Ttl Jun 6, 2018
06759c1
Clean up some constants.
TFiFiE Jun 11, 2018
bcfdadb
Duplicate line removal.
TFiFiE Jun 11, 2018
54e130e
Script for converting minigo weights.
Ttl Jun 11, 2018
eaf7707
Update README.md.
Nazgand Jun 11, 2018
1f2f3c5
Fix Validation checking on Windows.
Hersmunch Jun 14, 2018
4531693
Constant for the unchanged symmetry index.
TFiFiE Jun 14, 2018
91031bf
Update README.md.
gcp Jun 14, 2018
0c23ac6
Removed unused class KeyPress.
TFiFiE Jun 18, 2018
9480689
Allow 3 AutoGTP quitting conditions.
alreadydone Jun 26, 2018
2b37c69
More draw handling.
TFiFiE Jun 26, 2018
b695170
Suppress upstream warnings in Makefile.
TFiFiE Jul 9, 2018
d0fd3e9
Fix TF update operations.
godmoves Jul 12, 2018
6ec5c58
Code restructuring: less globals.
ihavnoid Jul 12, 2018
8e9ca8e
Removed unused types.
TFiFiE Jul 16, 2018
aaf5392
Resurrect GPU autodetection.
ihavnoid Jul 18, 2018
5596041
Restrict the use of "score".
TFiFiE Jul 20, 2018
8be4576
Code restructuring: Create ForwardPipe interface.
ihavnoid Jul 23, 2018
de01ae8
Coding style consistency cleanups.
gcp Jul 23, 2018
d267299
Remove use of "new".
gcp Jul 23, 2018
eba651f
Give ForwardPipe a virtual destructor.
TFiFiE Jul 23, 2018
6333b66
Replace if-else chain with switch statement.
TFiFiE Jul 23, 2018
7cfbb72
Use Winograd F(4x4, 3x3).
Ttl Jul 24, 2018
8c65b6c
Increase error budget in tuner.
Ttl Jul 24, 2018
90d4ff2
Get rid of more "network" globals and pointers.
gcp Jul 24, 2018
b323d40
Runtime selection of fp16/fp32.
ihavnoid Jul 25, 2018
d814e0f
Minor code cleanups.
gcp Jul 25, 2018
7524a2f
Clean up SGFTree style.
gcp Jul 25, 2018
4b20a12
Remove separate USE_HALF build from CI.
gcp Jul 25, 2018
d5bf982
Don't assume alternating colors in SGF.
gcp Jul 26, 2018
6f8c873
Remove separate half precision kernel.
Ttl Jul 28, 2018
fefa8c6
Compress duplicate evaluation code.
TFiFiE Jul 30, 2018
2ff9539
Consistent header guard naming.
TFiFiE Jul 30, 2018
acf1a3f
Replace macros with proper constants.
TFiFiE Jul 30, 2018
27f43a7
Implement NN eval fp16/fp32 autodetect.
ihavnoid Jul 30, 2018
e23009a
Resign analysis: search for the highest resign threshold.
Hersmunch Jul 30, 2018
5de99db
Half precision compute support.
Ttl Aug 3, 2018
a5f0e5c
Thread scalability improvements.
ihavnoid Aug 3, 2018
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
63af368
Tweak conversion script for ELF v2.
sethtroisi Feb 13, 2019
5eab19e
Correctly initialize board when reading SGF.
zliu1022 Nov 5, 2018
9f2dad2
Increase memory limit for 32-bit builds.
gcp Nov 5, 2018
1e5f8bf
Never select a CPU during OpenCL autodetection.
gcp Nov 5, 2018
0d894e0
Fix tuner for heterogeneous GPUs and auto precision.
ihavnoid Nov 15, 2018
c881ab6
Optimized out and out_in kernels.
Ttl Nov 15, 2018
e149c73
Update OpenCL C++ headers.
gcp Nov 16, 2018
c8388e4
CPU-only eval performance optimization.
ihavnoid Nov 17, 2018
17740ad
Convolve in/out performance optimization.
ihavnoid Nov 17, 2018
58547df
Validation: fix -k option.
Hersmunch Nov 17, 2018
811e238
Add link to Azure free trial instructions.
gcp Nov 19, 2018
ad501dd
Cleanup atomics and dead if.
sethtroisi Nov 20, 2018
672bc34
Const in SGFTree.
sethtroisi Nov 20, 2018
546a7a9
Make the README more clear.
gcp Nov 26, 2018
e82e62f
Refactor to allow AutoGTP to use Engine.
Hersmunch Nov 29, 2018
edfef37
Fix printf call style.
Dec 4, 2018
565671f
Update Khronos OpenCL C++ headers.
gcp Dec 7, 2018
b677d22
Cleanup loop code.
sethtroisi Nov 20, 2018
a9eb2b4
AutoGTP: allow specifying an SGF as initial position.
Hersmunch Dec 19, 2018
cf118fa
Support separate options for white in match games.
Hersmunch Dec 24, 2018
e0d64c3
Add O(sqrt(log(n))) scaling to tree search.
Ttl Dec 7, 2018
68b1964
Option to get network output without writing to cache.
TFiFiE Dec 24, 2018
a2b16eb
Add permission to link with NVIDIA libs. Update year.
gcp Jan 4, 2019
f3d07b2
Add link to GoReviewPartner.
roy7 Jan 15, 2019
d40ddce
Reminder to install OpenCL driver if seperate.
gcp Jan 15, 2019
afb5946
Fixed leelaz_file on Android.
inclement Jan 15, 2019
d10ab94
Fix 'catching polymorphic type by value' warning.
akdtg Jan 15, 2019
406bb61
Fixed converter script for minigo removing bias.
sethtroisi Jan 15, 2019
79beab4
Add zlib to the mac OS X build instructions.
gcp Jan 15, 2019
71ea88e
UCTNodePtr rare race condition fix.
ihavnoid Jan 15, 2019
7b05537
Make sure analysis is printed at least once.
dbosst Jan 15, 2019
cc1785c
Don't post if not requested.
gcp Jan 15, 2019
29b41d8
AutoGTP: Allow specifying initial GTP commands.
Hersmunch Jan 15, 2019
3313da7
Update Eigen to 3.3.7.
gcp Jan 15, 2019
3c576ca
Fix lz-setoption name playouts.
gcp Jan 22, 2019
888156f
AutoGTP: More info in SGF comments.
Hersmunch Jan 22, 2019
a2cfae9
Truncate and compress minigo weights.
sethtroisi Feb 1, 2019
3c59c81
Add gomill-explain_last_move.
sethtroisi Feb 1, 2019
4118164
Add a feature to exclude moves from the search.
betterworld Feb 1, 2019
294285a
Removed --cpu-only option from USE_CPU_ONLY build.
Hersmunch Feb 1, 2019
b2dac9e
Tensor Core support with PTX inline assembly.
ihavnoid Feb 1, 2019
722f240
Update TODO list.
gcp Feb 1, 2019
9aa9337
Remove an unnecessary std::move().
gcp Feb 1, 2019
29db41d
Add contributor (and maintainer) guidelines.
gcp Feb 4, 2019
7e2298b
Add several simple GTP commands.
anoek Feb 4, 2019
d63bc87
Minor style fixups.
gcp Feb 4, 2019
e822aaf
Remark about move assignment in style guideline.
gcp Feb 4, 2019
efdb158
Add lz-analyze minmoves tag.
gcp Feb 4, 2019
1792aa9
Fix style, extra spaces in PV output.
gcp Feb 4, 2019
3b3fd08
Rework test regex for MSVC limits.
gcp Feb 4, 2019
aad47c1
.gitignore: Add build.
ncaq Feb 6, 2019
efa3486
Batched neural net evaluations
ihavnoid Feb 9, 2019
ac6c4ab
Autogtp: Tune for batchsize 1
Ttl Feb 10, 2019
03091be
Update README.md.
roy7 Feb 17, 2019
b648f14
Remove unused lambda capture.
TFiFiE Feb 19, 2019
358a0d2
README.md: link to mentioned pull requests.
TFiFiE Feb 19, 2019
d0aacb8
Minor cleanup involving Network::get_output.
TFiFiE Feb 19, 2019
31b795b
Set up default batch size and threads.
ihavnoid Feb 26, 2019
b1907a4
Shuffle tuner parameters to find good parameters quicker.
nerai Feb 26, 2019
b2fe01d
Refactor tree_stats_helper to lambda.
sethtroisi Feb 26, 2019
9beb22e
Enable batching for self-play.
Ttl Mar 6, 2019
f6c18ac
Allow configuring default komi at compile-time.
apetresc Mar 6, 2019
f5e6e9f
Make chunkparser more robust.
gcp Mar 18, 2019
a1c5918
Fix thread count error message.
zhanzhenzhen Mar 18, 2019
cc11c03
Fix small style nits.
gcp Mar 25, 2019
148f979
Add support for time controls in loadsgf/printsgf.
Hersmunch Mar 25, 2019
e89e1a7
Fix inconsistent default timecontrol.
gcp Mar 25, 2019
f7bf826
Error out if weights are for wrong board size.
gcp Mar 25, 2019
1a4538a
Ignore passing moves unless they make sense.
gcp Mar 26, 2019
57b7f6b
Always allow passing when low on moves.
gcp Mar 26, 2019
aabfecc
Report root visits in gomill-explain_last_move.
gcp Mar 26, 2019
fd23877
Choose move based on normal distribution LCB.
Ttl Mar 26, 2019
1adcc30
Mixed precision training support.
godmoves Apr 2, 2019
085839f
Update AUTHORS.
gcp Apr 2, 2019
62a3269
Don't detect precision with Tensor Cores.
gcp Apr 2, 2019
2474f73
Update README.md.
gcp Apr 2, 2019
da9ed9d
Ignore --batchsize in CPU only compiles.
gcp Apr 3, 2019
f664191
Don't include OpenCL scheduler in CPU build.
gcp Apr 3, 2019
3f29788
Bump version numbers.
gcp Apr 4, 2019
4f1290a
Update README with Homebrew instructions.
apetresc Apr 23, 2019
e542dd0
Add "clear_cache" command.
TFiFiE Apr 23, 2019
bf17515
Fix tuner buffer overflow with small nets.
ihavnoid Apr 29, 2019
db5569c
Take network size in TFProcess constructor.
TFiFiE May 3, 2019
a32716a
Fix a github security warning (#2451)
roy7 Jul 27, 2019
7cbaeef
Don't bother trying tensor core support unless it's an NVIDIA GPU (#2…
ihavnoid Jul 27, 2019
b2ec58a
Assert UCTNode pointer alignment requirement. (#2474)
TFiFiE Aug 23, 2019
f87369d
Tensor core performance optimization
ihavnoid Sep 3, 2019
5f3ed84
Add missing GTP response ID for move_history.
May 14, 2019
a1f3956
Update linux compile intructions (#2536)
Nazgand Nov 15, 2019
4a35f6e
Deal with warnings. (#2531)
TFiFiE Nov 16, 2019
bda2bd8
Replace float with auto.
TFiFiE Nov 16, 2019
e007f11
Fixed UCTNodePointer::get_eval_lcb inefficiency.
TFiFiE Dec 10, 2019
b1c3168
Bump werkzeug from 0.12.2 to 0.15.3 in /training/tf (#2524)
dependabot[bot] Dec 11, 2019
abc68d9
Use get_raw_eval() instead of get_net_eval() for fpu (#2498)
Naphthalin Dec 22, 2019
6f6b094
AutoGTP: training data files in .gitignore.
TFiFiE Dec 26, 2019
a822145
Cancel pending network evaluation when search should stop. (#2508)
ihavnoid Oct 3, 2019
bfd8219
Use BOOST_SCOPE_EXIT instead of custom scope guard.
TFiFiE Jan 11, 2020
a06a464
Fix race condition in create_children. (#2573)
Ttl Jan 17, 2020
030be43
Update LeelaWatcher link (#2588) (#2589)
barrybecker4 Apr 18, 2020
cdc653f
Bump bleach from 1.5.0 to 3.1.4 in /training/tf (#2584)
dependabot[bot] May 13, 2020
220814c
Addressed warnings.
TFiFiE May 17, 2020
c7b8d4b
Removed extraneous const qualifiers in function prototypes. (#2596)
TFiFiE May 17, 2020
a146759
More const correctness. (#2597)
TFiFiE May 21, 2020
d304598
Reformatted C++ code. (#2598)
TFiFiE May 23, 2020
bc22a09
Prefixed GameState::game_history with "m_".
TFiFiE Jun 10, 2020
0cf47fe
"state" parameter of UCTNode::create_children made const.
TFiFiE Apr 26, 2021
cd2c455
Bump bleach from 3.1.4 to 3.3.0 in /training/tf (#2633)
dependabot[bot] Apr 26, 2021
154d17a
Expansions should update node evaluation no more than once. (#2639)
TFiFiE May 4, 2021
e3ed631
Update recompute link (#2641)
MaxVanDijck Aug 24, 2021
3ee6d20
Correcting link to Deepmind publication (#2661)
Oripy Feb 6, 2023
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ training/tf/venv
leelaz-model*
*.orig
leelaz_opencl_tuning
/build-autogtp-*
/build-validation-*
.vs/
build/
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
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,20 @@ jobs:
- docker build -f Dockerfiles/Dockerfile.gpu -t leela-zero:gpu .
- docker run leela-zero:gpu
- script:
- docker build -f Dockerfiles/Dockerfile.gpu-half -t leela-zero:gpu-half .
- docker run leela-zero:gpu-half
- 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
35 changes: 29 additions & 6 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,40 +1,63 @@
Gian-Carlo Pascutto
Seth Troisi
Marco Calignano
Henrik Forstén
Andy Olsen
Junhee Yoo
TFiFiE
Junhee Yoo
Marco Calignano
Andy Olsen
Hersmunch
Bood Qian
Peter Wen
ywrt
Arseny Krasutsky
earthengine
Jonathan Roy
Mankit Pong
michael
Hersmunch
Barry G Becker
Junyan Xu
Maks Kolman
kuba97531
Antti Korhonen
Mankit Pong
Chin-Chang Yang
Xingcan LAN
bittsitt
tux3
5525345551
Adrian Petrescu
Akita Noek
Alderi-Tokori
Alexander Taylor
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 H
Shen-Ta Hsieh(BestSteve)
Virgile Andreani
Ximin Luo
ZenStone
Zhenzhen Zhan
afalturki
betterworld
cheshirecats
dbosst
fohristiwhirl
gaieepo
ncaq
tterava
wonderingabout
zediir
zliu1022
Пахотин Иван
Google LLC
49 changes: 37 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 All @@ -135,3 +142,21 @@ target_link_libraries(tests ${BLAS_LIBRARIES})
target_link_libraries(tests ${OpenCL_LIBRARIES})
target_link_libraries(tests ${ZLIB_LIBRARIES})
target_link_libraries(tests gtest_main ${CMAKE_THREAD_LIBS_INIT})

include(GetGitRevisionDescription)
git_describe(VERSION --tags)
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" MAJOR_VERSION "${VERSION}")
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" MINOR_VERSION "${VERSION}")

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_NAME "leelaz")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}")
SET(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Gian-Carlo Pascutto https://github.com/gcp/leela-zero")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper.")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}")

INCLUDE(CPack)
32 changes: 0 additions & 32 deletions COLAB.md

This file was deleted.

110 changes: 110 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Contributing to Leela Zero

## C++ Usage

Leela Zero is written in C++14, and generally encourages writing in modern C++ style.

This means that:

* The code overwhelmingly uses Almost Always Auto style, and so should you.
* Prefer range based for and non-member (c)begin/(c)end.
* You can rely on boost 1.58.0 or later being present.
* Manipulation of raw pointers is to be avoided as much as possible.
* Prefer constexpr over defines or constants.
* Prefer "using" over typedefs.
* Prefer uniform initialization.
* Prefer default initializers for member variables.
* Prefer emplace_back and making use of move assignment.
* Aim for const-correctness. Prefer passing non-trivial parameters by const reference.
* Use header include guards, not #pragma once (pragma once is non-standard, has issues with detecting identical files, and is slower https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58770)
* config.h is always the first file included.
* Feel free to use templates, but remember that debugging obscure template metaprogramming bugs is not something people enjoy doing in their spare time.
* Using exceptions is allowed.

## Code Style

* Look at the surrounding code and the rest of the project!
* Indentation is 4 spaces. No tabs.
* public/private/protected access modifiers are de-indented
* Maximum line length is 80 characters. There are rare exceptions in the code, usually involving user-visible text strings.
* Ifs are always braced, with very rare exceptions when everything fits on one line and doing it properly makes the code less readable.
* The code generally avoids any pointer passing and allows non-const references for parameters. Still, for new code it should be preferred to a) put input parameters first b) use return values over output parameters.
* Function arguments that wrap are aligned.
* Member variables in a class have an m_ prefix and are private. Members of POD structs don't and aren't.
* Constants and enum values are ALL_CAPS.
* Variables are lowercase.
* Function names are underscore_case.
* Classes are CamelCase.
* Comments are preferably full sentences with proper capitalization and a period.
* Split the includes list into config.h, standard headers and our headers.

If something is not addressed here or there is no similar code, the Google C++ Style Guide is always a good reference.

We might move to enforce clang-format at some point.

## Adding dependencies

C++ does not quite have the package systems JavaScript and Rust have, so some restraint should be excercised when adding dependencies. Dependencies typically complicate the build for new contributors, especially on Windows, and reliance on specific, new versions can be a nuisance on Unix based systems.

The restraints on modern header-only libraries are significantly less because they avoid most of the above problems.

If a library is not mature and well-supported on Windows, Linux *and* macOS, you do not want it.

This is not an excuse to re-invent the wheel.

## Upgrading dependencies

The code and dependencies should target the latest stable versions of Visual Studio/MSVC, and the latest stable/LTS releases of common Linux distros, with some additional delay as not everyone will be able to upgrade to a new stable/LTS right away.

For example, upgrading to C++17 or boost 1.62.0 (oldest version in a Debian stable or Ubuntu LTS release) can be considered if there's a compelling use case and/or we can confirm it is supported on all platforms we reasonably target.

## Merging contributions

Contributions come in the form of pull requests against the "next" branch.

They are rebased or squashed on top of the next branch, so the history will stay linear, i.e. no merge commits.

Commit messages follow Linux kernel style: a summary phrase that is no more than 70-75 characters (but preferably <50) and describes both what the patch changes, as well as why the patch might be necessary.

If the patch is to a specific subsystem (AutoGTP, Validation, ...) then prefix the summary by that subsystem (e.g. AutoGTP: ...).

This is followed by a blank line, and a description that is wrapped at 72 characters. Good patch descriptions can be large time savers when someone has to bugfix the code afterwards.

The end of the commit message should mention which (github) issue the patch fixes, if any, and the pull request it belongs to.

Patches need to be reviewed before merging. Try to find the person who worked on the code last, or who has done work in nearby code (git blame is your friend, and this is why we write proper commit messages...). With some luck that is someone with write access to the repository. If not, you'll have to ping someone who does.

Experience says that the majority of the pull requests won't live up to this ideal, which means that maintainers will have to squash patch series and clean up the commit message to be coherent before merging.

If you are a person with write access to the repo, and are about to merge a commit, ask yourself the following question: am I confident enough that I understand this code, so that I can and am willing to go in and fix it if it turns out to be necessary? If the answer to this question is no, then do not merge the code. Not merging a contribution (quickly) is annoying for the individual contributor. Merging a bad contribution is annoying for everyone who wants to contribute now and in the future.

If a contributor can't be bothered to fix up the trailing whitespace in their patch, odds are they aren't going to be willing to fix the threading bug it introduces either.

## "Improvements" and Automagic

Improvements to the engine that can affect strength should include supporting data. This means no-regression tests for functional changes, and a proof of strength improvement for things which are supposed to increase strength.

The tools in the validation directory are well-fit for this purpose, as
is the python tool "ringmaster".

The number of configurable options should be limited where possible. If it is not possible for the author to make rules of thumb for suitable values for those options, then the majority of users have no hope of getting them right, and may mistakenly make the engine weaker. If you must introduce new ones, consider limiting their exposure to developers only via USE_TUNER and set a good default for them.

## GTP Extensions

GTP makes it possible to connect arbitrary engines to arbitrary interfaces.

Unfortunately GTP 2 isn't extensive enough to realistically fit all needs of analysis GUIs, which means we have had to extend it. The lack of standardization here means that Go software is continously catching up to the chess world, especially after UCI was introduced. We should aim to make this situation better, not worse.

This means that extensions have the possibility of outliving Leela Zero (or any GUIs) provided they are well thought out.

It makes sense to be thoughtful here, consider the responsibilities of both GUI and engine, and try to come up with flexible building blocks rather than a plethora of commands for very specific use cases.

Experience and previous discussions can help understanding:

* lz-analyze "avoid" and "allow" were added in pull request [#1949](https://github.com/leela-zero/leela-zero/pull/1949).
* lz-analyze got a side-to-move option in pull request [#1872](https://github.com/leela-zero/leela-zero/pull/1872) and [#1642](https://github.com/leela-zero/leela-zero/pull/1642).
* lz-analyze got a "prior" tag in pull request [#1836](https://github.com/leela-zero/leela-zero/pull/1836).
* lz-analyze was added in pull request [#1388](https://github.com/leela-zero/leela-zero/pull/1388).
* lz-setoption was added in pull request [#1741](https://github.com/leela-zero/leela-zero/pull/1741).
* Pull request [#2170](https://github.com/leela-zero/leela-zero/pull/2170) has some discussion regarding how to navigate SGF
files that were parsed by the engine via GTP.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM leela-zero:base

# GPU 16-bit (memory storage) build
RUN CXX=g++ CC=gcc cmake -DUSE_HALF=1 ..
# 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

Loading