Giter Club home page Giter Club logo

leela-zero-server's Introduction

Linux Build Status Windows Build Status

What

A Go program with no human provided knowledge. Using MCTS (but without Monte Carlo playouts) and a deep residual convolutional neural network stack.

This is a fairly faithful reimplementation of the system described in the Alpha Go Zero paper "Mastering the Game of Go without Human Knowledge". For all intents and purposes, it is an open source AlphaGo Zero.

Wait, what?

If you are wondering what the catch is: you still need the network weights. No network weights are in this repository. If you manage to obtain the AlphaGo Zero weights, this program will be about as strong, provided you also obtain a few Tensor Processing Units. Lacking those TPUs, I'd recommend a top of the line GPU - it's not exactly the same, but the result would still be an engine that is far stronger than the top humans.

Gimme the weights

Recomputing the AlphaGo Zero weights will take about 1700 years on commodity hardware.

One reason for publishing this program is that we are running a public, distributed effort to repeat the work. Working together, and especially when starting on a smaller scale, it will take less than 1700 years to get a good network (which you can feed into this program, suddenly making it strong).

I want to help

Using your own hardware

You need a PC with a GPU, i.e. a discrete graphics card made by NVIDIA or AMD, preferably not too old, and with the most recent drivers installed.

It is possible to run the program without a GPU, but performance will be much lower. If your CPU is not very recent (Haswell or newer, Ryzen or newer), performance will be outright bad, and it's probably of no use trying to join the distributed effort. But you can still play, especially if you are patient.

Windows

Head to the Github releases page at https://github.com/leela-zero/leela-zero/releases, download the latest release, unzip, and launch autogtp.exe. It will connect to the server automatically and do its work in the background, uploading results after each game. You can just close the autogtp window to stop it.

macOS and Linux

Follow the instructions below to compile the leelaz and autogtp binaries in the build subdirectory. Then run autogtp as explained in the contributing instructions below. Contributing will start when you run autogtp.

Using a Cloud provider

Many cloud companies offer free trials (or paid solutions, not discussed here) that are usable for helping the leela-zero project.

There are community maintained instructions available here:

I just want to play with Leela Zero right now

Download the best known network weights file from here, or, if you prefer a more human style, a (weaker) network trained from human games here.

If you are on Windows, download an official release from here and head to the Usage section of this README.

If you are on macOS, Leela Zero is available through Homebrew, the de facto standard package manager. You can install it with:

brew install leela-zero

If you are on Unix, you have to compile the program yourself. Follow the compilation instructions below and then read the Usage section.

Compiling AutoGTP and/or Leela Zero

Requirements

  • GCC, Clang or MSVC, any C++14 compiler
  • Boost 1.58.x or later, headers and program_options, filesystem and system libraries (libboost-dev, libboost-program-options-dev and libboost-filesystem-dev on Debian/Ubuntu)
  • zlib library (zlib1g & zlib1g-dev on Debian/Ubuntu)
  • Standard OpenCL C headers (opencl-headers on Debian/Ubuntu, or at https://github.com/KhronosGroup/OpenCL-Headers/tree/master/CL)
  • OpenCL ICD loader (ocl-icd-libopencl1 on Debian/Ubuntu, or reference implementation at https://github.com/KhronosGroup/OpenCL-ICD-Loader)
  • An OpenCL capable device, preferably a very, very fast GPU, with recent drivers is strongly recommended (OpenCL 1.1 support is enough). Don't forget to install the OpenCL driver if this part is packaged seperately by the Linux distribution (e.g. nvidia-opencl-icd). If you do not have a GPU, add the define "USE_CPU_ONLY", for example by adding -DUSE_CPU_ONLY=1 to the cmake command line.
  • Optional: BLAS Library: OpenBLAS (libopenblas-dev) or Intel MKL
  • The program has been tested on Windows, Linux and macOS.

Example of compiling - Ubuntu & similar

# Test for OpenCL support & compatibility
sudo apt install clinfo && clinfo

# Clone github repo
git clone https://github.com/leela-zero/leela-zero
cd leela-zero
git submodule update --init --recursive

# Install build depedencies
sudo apt install cmake g++ libboost-dev libboost-program-options-dev libboost-filesystem-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev zlib1g-dev

# Use a stand alone build directory to keep source dir clean
mkdir build && cd build

# Compile leelaz and autogtp in build subdirectory with cmake
cmake ..
cmake --build .

# Optional: test if your build works correctly
./tests

Example of compiling - macOS

# Clone github repo
git clone https://github.com/leela-zero/leela-zero
cd leela-zero
git submodule update --init --recursive

# Install build depedencies
brew install boost cmake zlib

# Use a stand alone build directory to keep source dir clean
mkdir build && cd build

# Compile leelaz and autogtp in build subdirectory with cmake
cmake ..
cmake --build .

# Optional: test if your build works correctly
./tests

Example of compiling - Windows

# Clone github repo
git clone https://github.com/leela-zero/leela-zero
cd leela-zero
git submodule update --init --recursive

cd msvc
Double-click the leela-zero2015.sln or leela-zero2017.sln corresponding
to the Visual Studio version you have.
# Build from Visual Studio 2015 or 2017

Contributing

For Windows, you can use a release package, see "I want to help".

Unix and macOS, after finishing the compile and while in the build directory:

# Copy leelaz binary to autogtp subdirectory
cp leelaz autogtp

# Run AutoGTP to start contributing
./autogtp/autogtp

Usage for playing or analyzing games

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.

The engine supports the GTP protocol, version 2.

Lizzie 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 is a very nice looking GUI with GTP 2 capability.

LeelaSabaki is modified to show variations and winning statistics in the game tree, as well as a heatmap on the game board.

GoReviewPartner is a tool for automated review and analysis of games using bots (saved as .rsgf files), Leela Zero is supported.

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.

All required commands are supported, as well as the tournament subset, and "loadsgf". The full set can be seen with "list_commands". The time control can be specified over GTP via the time_settings command. The kgs-time_settings extension is also supported. These have to be supplied by the GTP 2 interface, not via the command line!

Weights format

The weights file is a text file with each line containing a row of coefficients. The layout of the network is as in the AlphaGo Zero paper, but any number of residual blocks is allowed, and any number of outputs (filters) per layer, as long as the latter is the same for all layers. The program will autodetect the amounts on startup. The first line contains a version number.

  • Convolutional layers have 2 weight rows:
    1. convolution weights
    2. channel biases
  • Batchnorm layers have 2 weight rows:
    1. batchnorm means
    2. batchnorm variances
  • Innerproduct (fully connected) layers have 2 weight rows:
    1. layer weights
    2. output biases

The convolution weights are in [output, input, filter_size, filter_size] order, the fully connected layer weights are in [output, input] order. The residual tower is first, followed by the policy head, and then the value head. All convolution filters are 3x3 except for the ones at the start of the policy and value head, which are 1x1 (as in the paper).

There are 18 inputs to the first layer, instead of 17 as in the paper. The original AlphaGo Zero design has a slight imbalance in that it is easier for the black player to see the board edge (due to how padding works in neural networks). This has been fixed in Leela Zero. The inputs are:

1) Side to move stones at time T=0
2) Side to move stones at time T=-1  (0 if T=0)
...
8) Side to move stones at time T=-7  (0 if T<=6)
9) Other side stones at time T=0
10) Other side stones at time T=-1   (0 if T=0)
...
16) Other side stones at time T=-7   (0 if T<=6)
17) All 1 if black is to move, 0 otherwise
18) All 1 if white is to move, 0 otherwise

Each of these forms a 19 x 19 bit plane.

In the training/caffe directory there is a zero.prototxt file which contains a description of the full 40 residual block design, in (NVIDIA)-Caffe protobuff format. It can be used to set up nv-caffe for training a suitable network. The zero_mini.prototxt file describes a smaller 12 residual block case. The training/tf directory contains the network construction in TensorFlow format, in the tfprocess.py file.

Expert note: the channel biases seem redundant in the network topology because they are followed by a batchnorm layer, which is supposed to normalize the mean. In reality, they encode "beta" parameters from a center/scale operation in the batchnorm layer, corrected for the effect of the batchnorm mean/variance adjustment. At inference time, Leela Zero will fuse the channel bias into the batchnorm mean, thereby offsetting it and performing the center operation. This roundabout construction exists solely for backwards compatibility. If this paragraph does not make any sense to you, ignore its existence and just add the channel bias layer as you normally would, output will be correct.

Training

Getting the data

At the end of the game, you can send Leela Zero a "dump_training" command, followed by the winner of the game (either "white" or "black") and a filename, e.g:

dump_training white train.txt

This will save (append) the training data to disk, in the format described below, and compressed with gzip.

Training data is reset on a new game.

Supervised learning

Leela can convert a database of concatenated SGF games into a datafile suitable for learning:

dump_supervised sgffile.sgf train.txt

This will cause a sequence of gzip compressed files to be generated, starting with the name train.txt and containing training data generated from the specified SGF, suitable for use in a Deep Learning framework.

Training data format

The training data consists of files with the following data, all in text format:

  • 16 lines of hexadecimal strings, each 361 bits longs, corresponding to the first 16 input planes from the previous section
  • 1 line with 1 number indicating who is to move, 0=black, 1=white, from which the last 2 input planes can be reconstructed
  • 1 line with 362 (19x19 + 1) floating point numbers, indicating the search probabilities (visit counts) at the end of the search for the move in question. The last number is the probability of passing.
  • 1 line with either 1 or -1, corresponding to the outcome of the game for the player to move

Running the training

For training a new network, you can use an existing framework (Caffe, TensorFlow, PyTorch, Theano), with a set of training data as described above. You still need to contruct a model description (2 examples are provided for Caffe), parse the input file format, and outputs weights in the proper format.

There is a complete implementation for TensorFlow in the training/tf directory.

Supervised learning with TensorFlow

This requires a working installation of TensorFlow 1.4 or later:

src/leelaz -w weights.txt
dump_supervised bigsgf.sgf train.out
exit
training/tf/parse.py 6 128 train.out

This will run and regularly dump Leela Zero weight files (of networks with 6 blocks and 128 filters) to disk, as well as snapshots of the learning state numbered by the batch number. If interrupted, training can be resumed with:

training/tf/parse.py 6 128 train.out leelaz-model-batchnumber

Todo

  • Further optimize Winograd transformations.
  • Improve GPU batching in the search.
  • Root filtering for handicap play.
  • More backends:
  • MKL-DNN based backend.
  • CUDA specific version using cuDNN or cuBLAS.
  • AMD specific version using MIOpen/ROCm.

Related links

License

The code is released under the GPLv3 or later, except for ThreadPool.h, cl2.hpp, half.hpp and the eigen and clblast_level3 subdirs, which have specific licenses (compatible with GPLv3) mentioned in those files.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with NVIDIA Corporation's libraries from the NVIDIA CUDA Toolkit and/or the NVIDIA CUDA Deep Neural Network library and/or the NVIDIA TensorRT inference library (or a modified version of those libraries), containing parts covered by the terms of the respective license agreement, the licensors of this Program grant you additional permission to convey the resulting work.

leela-zero-server's People

Contributors

dependabot[bot] avatar dorus avatar konaeakira avatar kyrias avatar mardak avatar ricksu978 avatar roy7 avatar tfifie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leela-zero-server's Issues

Promotions cause a server OOM & crash

The server crashed again the moment 545ca6d6 promoted.

SPRT: Early pass unshift: {"network1":"545ca6d6d67169785598ec0185a9210190631916234d11441f75c781194c7114","network2":"b3a80524d2c510ff135e9206b695cd4569ab21e9fb4b459d411e6d99d743b62e","network1_losses":176,"network1_wins":224,"game_count":400,"number_to_play":400,"options":{"resignation_percent":"10","randomcnt":"0","noise":"false","visits":"3200","playouts":"0"},"options_hash":"8e437d","_id":"5aa290ead673c13e086bea2d","requests":[{"timestamp":1520606259370,"seed":"15426959040761963065"},{"timestamp":1520606404067,"seed":"9746325423087964562"},{"timestamp":1520606571763,"seed":"16580710657720491257"},{"timestamp":1520606580447,"seed":"16803210646367956948"},{"timestamp":1520606730150,"seed":"11804692162579541323"},{"timestamp":1520606793332,"seed":"16792455889284891974"},{"timestamp":1520606800411,"seed":"17074950341021423086"},{"timestamp":1520606873443,"seed":"1363047869884431541"},{"timestamp":1520606912647,"seed":"13186829878514647212"},{"timestamp":1520606948105,"seed":"4876221839255503293"},{"timestamp":1520607209621,"seed":"13294983390378473327"},{"timestamp":1520607264205,"seed":"2072352293509791474"},{"timestamp":1520607324071,"seed":"7433034460698712929"},{"timestamp":1520607426391,"seed":"10925498146026071810"},{"timestamp":1520607453177,"seed":"11059906593898246272"},{"timestamp":1520607550908,"seed":"15738329820082264744"},{"timestamp":1520607641343,"seed":"17607041420013328261"},{"timestamp":1520607641804,"seed":"10299091724745074389"},{"timestamp":1520607647771,"seed":"3963822521222219833"},{"timestamp":1520607676241,"seed":"8280106471766603624"},{"timestamp":1520607746434,"seed":"17399650952629161304"},{"timestamp":1520607746768,"seed":"6321507196950574429"},{"timestamp":1520607751569,"seed":"11101163797199046942"},{"timestamp":1520607790973,"seed":"4916541775844161777"},{"timestamp":1520607798754,"seed":"18195082795667119871"},{"timestamp":1520607806399,"seed":"15415386411179661320"}],"game_color":false}
New best network copied from (fast check): /home/jroy/code/leela-zero-server/network/545ca6d6d67169785598ec0185a9210190631916234d11441f75c781194c7114.gz

....

ip_addr Sending index.html
ip_addr Sending index.html
ip_addr Sending index.html
[nodemon] app crashed - waiting for file changes before starting...

System logs indicate node used up all memory and got killed:

[8380894.117249] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
[8380894.117334] [15880]  1001 15880  1093307   457510    1681      78   337986             0 node
[8380894.117341] Out of memory: Kill process 15880 (node) score 656 or sacrifice child
[8380894.118034] Killed process 15880 (node) total-vm:4373228kB, anon-rss:1830040kB, file-rss:0kB

Nodemon did not want to restart the server as the source hadn't changed, so I "touched" it.

Test hash-stream

https://www.npmjs.com/package/hash-stream

Could perhaps be used when we zlib.unzib gzip data to calculate a hash on. Instead of unzip the whole file into a string to calculate the hash on the string, have the hash read the stream so it use less memory, assuming hash is faster than unzip.

RSS feed

From this request: leela-zero/leela-zero#1065 (comment) it might be useful to have a network.rss feed for network info, maybe a matches.rss as well. So people who want to watch for new networks can do so using RSS based tools easily with no scraping/etc.

May want to cache the results and only purge cache when appropriate.

Cache the elograph.json result

Move all of the work being done in elograph.json to a function instead, so we can cache the result using cacheman. Clear the elograph cache whenever a match arrives like cachematches. This way the graph is generated fresh as needed any time a match has come in since the last graph, but will cache for as long as no new matches arrive to change the results.

Showing all test matches

Can we get a table somewhere showing all the test matches, not just the most recent ones? Given its size, just put it on a separate page.

Consider Pootle for translations

OGS uses https://pootle.translatehouse.org/ for their multi-language support.

We could consider doing the same, to eventually have a full multi-language web site translated by community volunteers. If we had native Korean, Chinese, and Japanese options it might help attract additional volunteers?

The tool could also be used on the Leela Zero side to offer the client software in other languages as well.

Re: #25

No ELF self-play for `task/0`

Tried several times of curl http://zero.sjeng.org/get-task/0
No ELF self-play is returned.

> curl http://zero.sjeng.org/get-task/0
{"cmd":"selfplay","hash":"ecab83bb611574a6a3139ae0f9734c172167997a843fbb034dac88246cfd7199","required_client_version":"15","random_seed":"8641093934871031854","leelaz_version":"0.13","options_hash":"7aaaeb","options":{"playouts":"0","visits":"3201","resignation_percent":"0","noise":"true","randomcnt":"999"}}

I wish I can use this to avoid match, I don't want to waste time downloading networks frequently since my network is slow.

Can't upload large networks

Uploading the 256x20 network from the leela-zero/leela-zero#884 keeps failing.

curl -F'key=blah' -F'[email protected]' -F'training_steps=3008000' -F'training_count=0' http://zero.sjeng.org/submit-network

<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the <a href="http://nginx.org/r/error_log">error log</a> for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>

I tried increasing all relevant nginx configuration (size, timeout), no dice.

I tried ssh'ing the file over, and doing the upload on the machine itself (which should avoid transmission speed issues). It's still very slow, and eventually gives the same error.

So I think the issue is at the node level.

Selfplay vs matches, etc

With the new slower networks we're really lagging behind on network matches getting done. I wonder if we should reduce the impact of "fast clients only" or go the other way and increase it further. I also wonder if we need to adjust the # of games buffer size.

Right now server says we've done 171 match games in the past hour and log file shows we have about 38 matches running. This is with stats 28 : 45 (38.36%). There are 5 nets in networks/ that haven't started yet. Current match running was put into the queue 7 hours ago.

Someone like Big Red can't run match games but we are assigning self play games to multiple IP addresses. So we could be assigning more matches presently than we are if that's wise.

Add SGF endpoint

So we can add an easy way for people to download an SGF on a view game page, we'd need a simple endpoint to just send out the SGF file by itself upon request.

Add network sizes blocks x filters to "networks"

I believe you should be able to update the tables just by ids.

largest TBD network id training_count hash blocks filters
1 9000 e6779c9b 1 8
4 107000 857b975e 4 32
57 2669812 c83e1b6e 5 64
91 4710167 b3b00c6d 6 128
111 6182848 e9c2c70b 10 128

If it were SQL:

UPDATE networks
SET blocks = 4, filters = 32
WHERE training_count > 9000 AND training_count <= 107000

Replace eidogo_html with a pug view

I got rid of wgo_html when first implementing the pug render engine instead, so the html would be in a separate file (in views/) for editing without needing to edit the server. Port the html from this function to a pug view as well. (See the wgo.pug for an example, it's pretty straight forward but some custom changes are needed for pug to render properly.)

Eventually might want to move all html generated by the web site into pug files. (Main front page, match list web pages, etc.)

not in gzip format

After I started my own server, and then run ./autogtp, it says the following error on the client side:

AutoGTP v15
Using 1 thread(s) for GPU(s).
Starting tuning process, please wait...

gzip: networks/3f6c8dd85e888bec8b0bcc3006c33954e4be5df8a24660b03fcf3e128fd54338.gz: not in gzip format
Net filename: networks/3f6c8dd85e888bec8b0bcc3006c33954e4be5df8a24660b03fcf3e128fd54338
Network connection to server failed.
NetworkException: Failed to fetch the network
Retrying in 30 s.

On client side, all zero.sjeng.org have already been changed to 127.0.0.1:8080 to point to my server. I noticed that README said there should be a dummy auth_key file on server side. I created this file with empty content. Is it correct? And I don't know what's the meaning of this file. It can't find anything of putting auth_key in the http request in the client-side code.

Wiki

Since Leela Zero is getting a lot of duplicate questions and all information is too spread out I would like to request to add something like MediaWiki to the site(For example zero.sjeng.org/wiki). I would be willing to create pages with information on it from past questions.

Wins to PASS after match leaves queue don't promote?

See discussion at leela-zero/leela-zero#1229 (comment) and leela-zero/leela-zero#1228 (comment).

It appears a network that had sent out all pages and left pending matches queue had enough wins arrive to show PASS on the web site, but it didn't actually promote. The same SPRT()===true test is used to promote a late arrival match win and to decide to show PASS on web site. So I wonder if this is a bug that matches after the match has ended can't promote a network for some reason?

Just looking at https://github.com/gcp/leela-zero-server/blob/next/server.js#L883 I don't see why it would fail however.

Match network name sanity check

When a match is queued, check that the network being queued is in network/. If not, ignore the request to add match and throw an error back. This will prevent typos from putting illegal networks into the match queue.

Sortable column headers

I started on this and got distracted and forgot about it. Someone requested the headers be click-sortable. I found some code maybe I linked in an earlier thread I'd have to re-locate.

Add hash of gzip file to task requests?

See discussion here.

leela-zero/leela-zero#1429 (comment)

It would allow autogtp to check for valid gzip file of a network hash without decompressing the file. If we calculate them on server as needed and store in a Map, we'd only need to do it once per gzip (per server restart) which is much less than once per autogtp startup/download.

Discussion: SPRT early fail/pass result affected by late matches received.

The network 02e663b0 had a SPRT early fail around 39x games.

The late matches received have pushed the result to a pass, it didn't get promoted (as expected).

image

However, leaving the SPRT showing pass (in fact an early fail) would confuse the crowd.

I would suggest to store SPRT early pass/fail result in database, so that the late matches received wouldn't affect the SPRT result.

Any thoughts?

Edit:
@roy manually promoted 02e663b0, further late matches received have push the result back to fail

Required # of matches < 0

@Dorus
[13:23]KillerDucky: roy7 where is the next match? 2995 is in the network list already
[13:24]roy7: hm
[13:25]roy7: Match is in queue vs null
[13:28]KillerDucky: also why did d996 do 521 games?
[13:28]roy7: Need -9 match games. Requested 0, deleted 0. Oldest 0.00m ago. Will schedule selfplay.
[13:28]KillerDucky: heh
[13:29]roy7: Hmm.
[13:29]roy7: Need 26 match games. Requested 27, deleted 0. Oldest 28.70m ago. Will schedule selfplay.
[13:29]roy7: Cleared match cache.
[13:29]roy7: SPRT: Early fail pop: {
[13:30]roy7: Need -9 match games. Requested 0, deleted 0. Oldest 0.00m ago. Will schedule selfplay.
[13:32]roy7: I'll have to restart server.
[13:33]roy7: Something isn't getting cleared properly I guess when match cache is cleared.

I didn't look into the one that had 521 games but if the # requested is drifting into the negatives somehow, then perhaps it's queuing more and more over time.

Only give match games to new clients

Based on jkiliani commented the new clients gave the recent promotion (63.5%) and the old clients gave the new promotion (45.56%) win.

Until upgrading is required for old clients, i suggest we do not send matches to old clients. They throw off the result too much it seems.

Add network descriptions

It would be useful if networks got an additional description. Displayed for example when you mouse-over on the network. Currently this only shows the network training games+steps, but some explanation or motivation why this network is uploaded would be nice. This applies mostly for the hbest network and the 6x128 experiments.

SGF validation would be needed.

leela-zero/leela-zero#1210

For '/submit' and '/submit-match', there are no safeguard code before updating db.
Minimal validation of sgf file would be great to avoid bad results.

Validation rules could be :

  • move count > 90
  • never pass before move 10 (no consecutive moves of black / white)
  • handicap must not be used. ( HA[] )
  • komi must be 7.5 ( KM[7.5] )
  • Leela Zero options should be valid

PUG type errors

Found these in the log. Appears that sometimes there are matches with no training_count defined so .abbr fails. Maybe that's when a new network is uploaded before it is assigned and network2 is null?

http://termbin.com/xsm4

Cannot read property 'abbr' of undefined
    at eval (eval at wrap (/home/jroy/code/leela-zero-server/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:267:47)
    at template (eval at wrap (/home/jroy/code/leela-zero-server/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:426:96)
    at Object.exports.renderFile (/home/jroy/code/leela-zero-server/node_modules/pug/lib/index.js:427:38)
    at Object.exports.renderFile (/home/jroy/code/leela-zero-server/node_modules/pug/lib/index.js:417:21)
    at View.exports.__express [as engine] (/home/jroy/code/leela-zero-server/node_modules/pug/lib/index.js:464:11)
    at View.render (/home/jroy/code/leela-zero-server/node_modules/express/lib/view.js:135:8)
    at tryRender (/home/jroy/code/leela-zero-server/node_modules/express/lib/application.js:640:10)
    at Function.render (/home/jroy/code/leela-zero-server/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/home/jroy/code/leela-zero-server/node_modules/express/lib/response.js:1008:7)
    at app.get.asyncMiddleware (/home/jroy/code/leela-zero-server/server.js:946:9)

now the best network list table is ordered by hash?

Times are in GMT+0100 (CET)
Best Network Hash

Upload Date Hash Architecture Games Training

131 2018/1/8 20:19 ffc1e51b 64x5 148665 2002537
130 2017/12/11 18:59 fe7a6c28 64x5 20389 955000
129 2017/11/17 8:09 fe3f6afd 32x4 44001 19000
128 2018/1/7 5:14 fca07541 64x5 62034 1883473
127 2018/3/6 18:53 fc2b9ac3 128x10 62153 4873768

what is the meaning of self-game lists?

View most recent self-play games: b6337c69/176b WGo, b6337c69/143w WGo, b6337c69/491b WGo, 62b5417b/92b WGo, b6337c69/228b WGo, 62b5417b/93w WGo, b6337c69/114b WGo, 62b5417b/101w WGo, b6337c69/157w WGo, 62b5417b/110b WGo

I guess hash/total moves_winnercolor

We need Chinese language website

Sine Leela rise to 9dan grading(九段) in FOXWQ(野狐),more and more chinese notice Leela-zero.They are potential people to join us training Leela.However most of chinese are confused by the English website.I think a Chinese language website can let them easy to get the information.So how can I help you to make a Chinese website?

SPRT returned null where expecting result to be certain (Pass/Failed)

For 400 games with 55% gating, I would expect the SPRT result to be

  • True/Pass when win >= 220
  • False/Failed when lose >= 181
Here are test cases found to be faulty

Win Lose SPRT returned Expect
214 181 null FALSE
215 181 null FALSE
216 181 null FALSE
217 181 null FALSE
218 181 null FALSE
220 172 null TRUE
220 173 null TRUE
220 174 null TRUE
220 175 null TRUE
220 176 null TRUE
220 177 null TRUE
220 178 null TRUE
220 179 null TRUE
221 173 null TRUE
221 174 null TRUE
221 175 null TRUE
221 176 null TRUE
221 177 null TRUE
221 178 null TRUE
222 174 null TRUE
222 175 null TRUE
222 176 null TRUE
222 177 null TRUE
223 175 null TRUE
223 176 null TRUE

Script to generate test cases

var util = require('./classes/utilities.js');
var tests = [
    { win: 214, lose: 181 },
    { win: 215, lose: 181 },
    { win: 216, lose: 181 },
    { win: 217, lose: 181 },
    { win: 218, lose: 181 },
    { win: 220, lose: 172 },
    { win: 220, lose: 173 },
    { win: 220, lose: 174 },
    { win: 220, lose: 175 },
    { win: 220, lose: 176 },
    { win: 220, lose: 177 },
    { win: 220, lose: 178 },
    { win: 220, lose: 179 },
    { win: 221, lose: 173 },
    { win: 221, lose: 174 },
    { win: 221, lose: 175 },
    { win: 221, lose: 176 },
    { win: 221, lose: 177 },
    { win: 221, lose: 178 },
    { win: 222, lose: 174 },
    { win: 222, lose: 175 },
    { win: 222, lose: 176 },
    { win: 222, lose: 177 },
    { win: 223, lose: 175 },
    { win: 223, lose: 176 },
];

tests.forEach(t => console.log(`SPRT(${t.win},${t.lose})=${util.SPRT(t.win, t.lose)}`));

@roy7
Have I misinterpret how SPRT should work? or maybe we need to hard code the boundaries to fix this.

Problems with the graph

I use 3 different machines (2 different Internet providers) to access http://zero.sjeng.org/
with different browsers
Several weeks ago I could not see graph on one, then after some enhancement on two,
then with the last was gone with the latest changes.

Good news - I can see it with a specific browser that is not my default or preferred one.
And the new graph is excellent.

It is not a big problem for me, as I can live without the graph :) or use yandex browser with
home page at zero.sjeng.org

But I think that a growing segment of visitors, might never see the graph,
what would cripple the promotion of LZ.

Make the FAIL network arrows a bit transparent

As the title says, what do you think about making the red down-arrows for the failed networks a bit transparent to make the promoted networks more visible?

I tried to look at the code but I'm not familiar with JavaScript or Json, so, I don't think I can do it myself.

your most recent self-play games shows wrong order

View your most recent self-play games: 9056/183w, 9056/116b, 62b5/164b, 62b5/93w, b633/153w, b633/228b, 62b5/95w, b633/178b

but I print the log on my computer, the recent finished games don't include 62b5 game or b633 game


C:\Users\lutao\Downloads>type zeros.txt | find "Game data"
Game data 5145759e7f173f075842175a248927a68f8f170ae00237212e064ccae9a93478 stored in

database
Game data 42f651e19f0a01e23e1ff831b28d3abd5321dac5d57a7badeb086152f28b117c stored in

database
Game data 4ad4630661a8e27e20420cbce408355d937be6a9f38c23134bcf0d27b6d780b5 stored in

database
Game data 4bf59ecd63e4a5e55fa40897a3d74c19f1a7ad3befb752fbee3d29a62ff50d9e stored in

database
Game data 0617474d6fdacb30c90f4a591796fd147f9b6c4870f4a02cae678b9dedb7e2af stored in

database
Game data b407d5b4c6e9c46897e1f94d9fae8c62efb0cd1c55163596c538b7a1d75668ae stored in

database
Game data ff70c18312e1af59ba0a7033e254fb71d3b6e8798759d72794cafdab0a3f59e5 stored in

database
Game data ef1af8e951773b8418fc4c3e89a2b6fce30c128fb63cd4600a012ce40c1f54f9 stored in

database
Game data e5862d3ea4a5943553516d5e76afa783fa880e816c4caf20c279a66cc39b7458 stored in

database
Game data 0775ff22bbb75facae53a69b2932c94fa47067ceb87f3b66e79f02beac7fb447 stored in

database
Game data 8cb4ce4c8660bcc96b53a67d073314b44e0ae767258b9e96b053988f8873704a stored in

database
Game data 89b8ba763667b9245d00acd04153ba530fe1d972de1fa3a1ad9b69874f00b66b stored in

database
Game data a6f0058c760c6e4923e3b337456c2faf910d4fa1267394820fe7bc6785f7b863 stored in

database
Game data 12fe694b4e555d6869e5922b4a191dcf52f74954a06b558c4044fc2de793e1df stored in

database
Game data 650aff69bc2dfbb3f90061dbf264c253455953e12846dfc5e31f795c89259aee stored in

database
Game data 73dc6c823d9f10a99cd8021852cf7390fe9aa1bed3f0d96bf289d3398f9c8b9d stored in

database
Game data cdf405a6de43c14544da079208453ce23534c65c502aabe5c917a444d671821a stored in

database
Game data f83a0f31905250879566420313c1799537135ac89885cab2f8755d4be283bab5 stored in

database
Game data e0aaa016c605e79209ead1f67c2080599f63ce985172974b9da448940c0dca37 stored in

database
Game data 62af51005729cb7381ff84008e4886973210f07e60947afeab3a12bb2c8f7c78 stored in

database
Game data 192399a9b5a9b755c0826930c6edd822db046b3580235227e2729016d8e6c69a stored in

database
Game data 91b806466c57e4d441d8320c4145831bc28bec5f71548dd66bfaa51ec8c4e87b stored in

database

C:\Users\lutao\Downloads>type zeros.txt | find "Score:"
Score: B+Resign
Score: W+Resign
Score: B+Resign
Score: W+Resign
Score: B+Resign
Score: B+Resign
Score: W+Resign
Score: W+Resign
Score: W+Resign
Score: W+Resign
Score: B+Resign
Score: W+Resign
Score: B+Resign
Score: B+Resign
Score: B+Resign
Score: B+Resign
Score: B+Resign
Score: W+Resign
Score: W+Resign
Score: B+Resign
Score: B+Resign
Score: W+Resign

C:\Users\lutao\Downloads>type zeros.txt | find "resign)"
(W L12) 175 (B L11) 176 (W L14) 177 (B M15) 178 (W resign) Game has ended.
13) 92 (W A17) 93 (B A10) 94 (W C16) 95 (B resign) Game has ended.
W L8) 115 (B J9) 116 (W resign) Game has ended.
46 (W M5) 147 (B L4) 148 (W B18) 149 (B resign) Game has ended.
resign) Game has ended.
) 92 (W K12) 93 (B J10) 94 (W J5) 95 (B L12) 96 (W resign) Game has ended.
A18) 197 (B resign) Game has ended.
6 (W H11) 147 (B G14) 148 (W G10) 149 (B E15) 150 (W M13) 151 (B N14) 152 (W Q18) 153 (B

resign) Game has ended.
B5) 92 (W F5) 93 (B resign) Game has ended.
(B resign) Game has ended.
) 157 (B G4) 158 (W F3) 159 (B Q14) 160 (W S13) 161 (B H13) 162 (W E3) 163 (B G6) 164 (W

resign) Game has ended.
W G11) 95 (B A12) 96 (W H10) 97 (B resign) Game has ended.
) 113 (B A13) 114 (W K8) 115 (B A15) 116 (W resign) Game has ended.
P9) 146 (W resign) Game has ended.
6 (W J7) 127 (B K7) 128 (W resign) Game has ended.
M11) 137 (B M12) 138 (W K13) 139 (B L14) 140 (W K14) 141 (B M13) 142 (W resign) Game has

ended.
) 197 (B C19) 198 (W H16) 199 (B Q5) 200 (W P5) 201 (B T3) 202 (W H11) 203 (B E12) 204 (W

D11) 205 (B resign) Game has e

) 115 (B L10) 116 (W G16) 117 (B H2) 118 (W G17) 119 (B resign) Game has ended.
17) 137 (B E8) 138 (W resign) Game has ended.
) 177 (B T15) 178 (W H6) 179 (B F13) 180 (W E13) 181 (B F12) 182 (W F11) 183 (B resign)

Game has ended.

C:\Users\lutao\Downloads>type zeros.txt | find "net: "
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: b6337c693d5cc6e6bace8c3107520df97e23f61f2c25a264e1e558b1021c3f2f.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 90560d926216c9842add40913a023fd59fde761a64014c48d8246648ddd272a3.
net: 62b5417b64c46976795d10a6741801f15f857e5029681a42d02c9852097df4b9.

Dummy server data for local testing

We have the mongo indexes stored in mongodb.indexes but adding some dummy sample rows for each database table and storing them in a file for easy import would be helpful. This way anyone doing local testing doesn't just have a totally empty database, if they import the dummy data first. Real networks in /networks/ wouldn't be required, but a few in the database table and a few matches and match-games would give you something to look at when testing...

Strange behaviour in best-network.gz headers since last promote.

Hi,

cfb2ce28 was promoted approx half an hour ago, and I'm seeing some strange output when checking the headers of zero.sjeng.org/networks/best-network.gz with curl:

[simon@simon-laptop][10:45:49]
[~/tmp/DONTSYNC/windows-qemu]>curl -I zero.sjeng.org/networks/best-network.gz
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Sun, 29 Apr 2018 09:45:50 GMT
Content-Type: application/octet-stream
Content-Length: 39966151
Last-Modified: Sun, 29 Apr 2018 09:45:02 GMT
Connection: keep-alive
ETag: "5ae5941e-261d5c7"
Accept-Ranges: bytes

[simon@simon-laptop][10:45:50]
[~/tmp/DONTSYNC/windows-qemu]>curl -I zero.sjeng.org/networks/best-network.gz
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Sun, 29 Apr 2018 09:45:51 GMT
Content-Type: application/octet-stream
Content-Length: 39966151
Last-Modified: Sun, 29 Apr 2018 09:45:02 GMT
Connection: keep-alive
ETag: "5ae5941e-261d5c7"
Accept-Ranges: bytes

[simon@simon-laptop][10:45:51]
[~/tmp/DONTSYNC/windows-qemu]>curl -I zero.sjeng.org/networks/best-network.gz
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Sun, 29 Apr 2018 09:46:40 GMT
Content-Type: application/octet-stream
Content-Length: 39944857
Last-Modified: Sun, 29 Apr 2018 09:46:33 GMT
Connection: keep-alive
ETag: "5ae59479-2618299"
Accept-Ranges: bytes

[simon@simon-laptop][10:47:17]
[~/tmp/DONTSYNC/windows-qemu]>curl -I zero.sjeng.org/networks/best-network.gz
HTTP/1.1 200 OK
Server: nginx/1.13.12
Date: Sun, 29 Apr 2018 09:51:13 GMT
Content-Type: application/octet-stream
Content-Length: 39966151
Last-Modified: Sun, 29 Apr 2018 09:49:27 GMT
Connection: keep-alive
ETag: "5ae59527-261d5c7"
Accept-Ranges: bytes

It's like best-network.gz is continuously overwritten and, more disturbingly, the Content-Length seems to alternate between 39944857 and 39966151.

I'm guessing it's not causing any problems as cfb2ce28 games seem to be being uploaded OK, but it's definitely odd new behaviour :)

Edit: the two Content-Lengths correspond to cfb2 and the previous best, 1586, so if autogtp uses the best-network.gz (I don't know if it does) this might actually cause problems :/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.