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 from head fork #1

Merged
merged 65 commits into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ training/tf/venv
leelaz-model*
*.orig
leelaz_opencl_tuning
/build-autogtp-*
/build-validation-*
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
script:
- 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
- script:
- docker build -f Dockerfiles/Dockerfile.cpu -t leela-zero:cpu .
- docker run leela-zero:cpu
Expand Down
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,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)
6 changes: 0 additions & 6 deletions Dockerfiles/Dockerfile.gpu-half

This file was deleted.

27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,19 @@ The engine supports the [GTP protocol, version 2](https://www.lysator.liu.se/~gu
Leela Zero is not meant to be used directly. You need a graphical interface
for it, which will interface with Leela Zero through the GTP protocol.

[Lizzie](https://github.com/featurecat/lizzie/releases) is a client specifically
for Leela Zero which shows live search probilities, a win rate graph, and has
an automatic game analysis mode. Has binaries for Windows, Mac, and Linux.

[Sabaki](http://sabaki.yichuanshen.de/) is a very nice looking GUI with GTP 2
capability. It should work with this engine. A lot of go software can
interface to an engine via GTP, so look around.
capability.

[LeelaSabaki](https://github.com/SabakiHQ/LeelaSabaki) is modified to
show variations and winning statistics in the game tree, as well as a heatmap
on the game board.

A lot of go software can interface to an engine via GTP,
so look around.

Add the --gtp commandline option on the engine command line to enable Leela
Zero's GTP support. You will need a weights file, specify that with the -w option.
Expand Down Expand Up @@ -281,11 +291,14 @@ If interrupted, training can be resumed with:

# Todo

- [ ] List of package names for more distros
- [ ] Multi-GPU support for training
- [ ] Optimize Winograd transformations
- [ ] CUDA specific version using cuDNN
- [ ] AMD specific version using MIOpen
- [ ] Optimize Winograd transformations.
- [ ] Implement GPU batching.
- [ ] Parameter setting over GTP.
- More backends:
- [ ] Eigen based BLAS backend.
- [ ] MKL-DNN based backend.
- [ ] CUDA specific version using cuDNN.
- [ ] AMD specific version using MIOpen.

# Related links

Expand Down
1 change: 1 addition & 0 deletions autogtp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/*.gz
/moc_*.cpp
/moc_*.h
/autogtp.pro.user

# Weight files
/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]*[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]
20 changes: 16 additions & 4 deletions autogtp/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
#include <QFile>
#include <QTextStream>
#include <QRegularExpression>
#include <QFileInfo>
#include "Game.h"

Game::Game(const QString& weights, const QString& opt, const QString& binary) :
Game::Game(const QString& weights, const QString& opt, const QString& binary,
const QStringList& commands) :
QProcess(),
m_cmdLine(""),
m_binary(binary),
m_timeSettings("time_settings 0 1 0"),
m_commands(commands),
m_resignation(false),
m_blackToMove(true),
m_blackResigned(false),
Expand All @@ -36,6 +38,9 @@ Game::Game(const QString& weights, const QString& opt, const QString& binary) :
#ifdef WIN32
m_binary.append(".exe");
#endif
if (!QFileInfo::exists(m_binary)) {
m_binary.remove(0, 2); // ./leelaz -> leelaz
}
m_cmdLine = m_binary + " " + opt + " " + weights;
m_fileName = QUuid::createUuid().toRfc4122().toHex();
}
Expand Down Expand Up @@ -175,8 +180,15 @@ bool Game::gameStart(const VersionTuple &min_version) {
// check any return values.
checkVersion(min_version);
QTextStream(stdout) << "Engine has started." << endl;
sendGtpCommand(m_timeSettings);
QTextStream(stdout) << "Infinite thinking time set." << endl;
for (auto command : m_commands) {
QTextStream(stdout) << command << endl;
if (!sendGtpCommand(command))
{
QTextStream(stdout) << "GTP failed on: " << command << endl;
exit(EXIT_FAILURE);
}
}
QTextStream(stdout) << "Thinking time set." << endl;
return true;
}

Expand Down
5 changes: 3 additions & 2 deletions autogtp/Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class Game : QProcess {
public:
Game(const QString& weights,
const QString& opt,
const QString& binary = QString("./leelaz"));
const QString& binary = QString("./leelaz"),
const QStringList& commands = QStringList("time_settings 0 1 0"));
~Game() = default;
bool gameStart(const VersionTuple& min_version);
void move();
Expand Down Expand Up @@ -69,7 +70,7 @@ class Game : QProcess {
};
QString m_cmdLine;
QString m_binary;
QString m_timeSettings;
QStringList m_commands;
QString m_winner;
QString m_fileName;
QString m_moveDone;
Expand Down
6 changes: 3 additions & 3 deletions autogtp/Job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Job(gpu, parent)

Result ProductionJob::execute(){
Result res(Result::Error);
Game game("networks/" + m_network, m_option);
Game game("networks/" + m_network + ".gz", m_option);
if (!game.gameStart(m_leelazMinVersion)) {
return res;
}
Expand Down Expand Up @@ -131,7 +131,7 @@ void ProductionJob::init(const Order &o) {

Result ValidationJob::execute(){
Result res(Result::Error);
Game first("networks/" + m_firstNet, m_option);
Game first("networks/" + m_firstNet + ".gz", m_option);
if (!first.gameStart(m_leelazMinVersion)) {
return res;
}
Expand All @@ -140,7 +140,7 @@ Result ValidationJob::execute(){
first.setMovesCount(m_moves);
QFile::remove(m_sgfFirst + ".sgf");
}
Game second("networks/" + m_secondNet, m_option);
Game second("networks/" + m_secondNet + ".gz", m_option);
if (!second.gameStart(m_leelazMinVersion)) {
return res;
}
Expand Down
41 changes: 0 additions & 41 deletions autogtp/Keypress.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions autogtp/Keypress.h

This file was deleted.