Skip to content

Commit

Permalink
Merge pull request LeelaChessZero#10 from LeelaChessZero/master
Browse files Browse the repository at this point in the history
get latest
  • Loading branch information
ankan-ban authored Jan 15, 2019
2 parents 80ac4a1 + 2cecd70 commit 0f7bc50
Show file tree
Hide file tree
Showing 26 changed files with 900 additions and 275 deletions.
11 changes: 6 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ install:
- cmd: IF %NAME%==opencl set OPENCL=true
- cmd: IF %NAME%==blas set BLAS=true
- cmd: IF %NAME%==blas set GTEST=true
- cmd: IF %BLAS%==true nuget install OpenBLAS -Version 0.2.14.1 -OutputDirectory C:\cache
- cmd: IF %BLAS%==true IF NOT EXIST C:\cache\OpenBLAS appveyor DownloadFile https://sjeng.org/ftp/OpenBLAS-0.3.3-win-oldthread.zip
- cmd: IF %BLAS%==true IF NOT EXIST C:\cache\OpenBLAS 7z x OpenBLAS-0.3.3-win-oldthread.zip -oC:\cache\OpenBLAS
- cmd: IF %OPENCL%==true nuget install opencl-nug -Version 0.777.12 -OutputDirectory C:\cache
- cmd: IF %BLAS%==true IF NOT EXIST C:\cache\ispc-v1.9.2-windows appveyor DownloadFile https://sourceforge.net/projects/ispcmirror/files/v1.9.2/ispc-v1.9.2-windows.zip
- cmd: IF %BLAS%==true IF NOT EXIST C:\cache\ispc-v1.9.2-windows 7z x ispc-v1.9.2-windows.zip -oC:\cache
Expand Down Expand Up @@ -52,12 +53,12 @@ cache:
- C:\projects\lc0\subprojects\packagecache
before_build:
- cmd: git submodule update --init --recursive
- cmd: meson build --backend vs2017 --buildtype release -Dgtest=%GTEST% -Dopencl=%OPENCL% -Dblas=%BLAS% -Dcudnn=%CUDA% -Dispc_native_only=false -Dpopcnt=false -Dcudnn_include="%CUDA_PATH%\include","%PKG_FOLDER%\cuda\include" -Dcudnn_libdirs="%CUDA_PATH%\lib\x64","%PKG_FOLDER%\cuda\lib\x64" -Dprotobuf_include="%PKG_FOLDER%\protobuf\include" -Dprotobuf_libdir="%PKG_FOLDER%\protobuf\lib" -Dopenblas_include="%PKG_FOLDER%\OpenBLAS.0.2.14.1\lib\native\include" -Dopenblas_libdirs="%PKG_FOLDER%\OpenBLAS.0.2.14.1\lib\native\lib\x64" -Dopencl_include="%PKG_FOLDER%\opencl-nug.0.777.12\build\native\include" -Dopencl_libdirs="%PKG_FOLDER%\opencl-nug.0.777.12\build\native\lib\x64" -Ddefault_library=static
- cmd: meson build --backend vs2017 --buildtype release -Dgtest=%GTEST% -Dopencl=%OPENCL% -Dblas=%BLAS% -Dcudnn=%CUDA% -Dispc_native_only=false -Dpopcnt=false -Dcudnn_include="%CUDA_PATH%\include","%PKG_FOLDER%\cuda\include" -Dcudnn_libdirs="%CUDA_PATH%\lib\x64","%PKG_FOLDER%\cuda\lib\x64" -Dprotobuf_include="%PKG_FOLDER%\protobuf\include" -Dprotobuf_libdir="%PKG_FOLDER%\protobuf\lib" -Dopenblas_include="%PKG_FOLDER%\OpenBLAS\dist64\include" -Dopenblas_libdirs="%PKG_FOLDER%\OpenBLAS\dist64\lib" -Dopencl_include="%PKG_FOLDER%\opencl-nug.0.777.12\build\native\include" -Dopencl_libdirs="%PKG_FOLDER%\opencl-nug.0.777.12\build\native\lib\x64" -Ddefault_library=static
build_script:
- cmd: IF %APPVEYOR_REPO_TAG%==false msbuild "C:\projects\lc0\build\lc0.sln" /m /p:WholeProgramOptimization=true /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cmd: IF %APPVEYOR_REPO_TAG%==true msbuild "C:\projects\lc0\build\lc0.sln" /m /p:WholeProgramOptimization=PGInstrument /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
- cmd: cd build
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %BLAS%==true copy C:\cache\OpenBLAS.0.2.14.1\lib\native\bin\x64\*.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %BLAS%==true copy C:\cache\OpenBLAS\dist64\bin\libopenblas.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %OPENCL%==true copy C:\cache\opencl-nug.0.777.12\build\native\bin\OpenCL.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %CUDA%==true copy "%CUDA_PATH%"\bin\*.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %CUDA%==true copy %PKG_FOLDER%\cuda\bin\cudnn64_7.dll
Expand All @@ -68,7 +69,7 @@ after_build:
- cmd: IF %APPVEYOR_REPO_TAG%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip %APPVEYOR_BUILD_FOLDER%\build\lc0.exe
- cmd: IF %APPVEYOR_REPO_TAG%==true appveyor DownloadFile "https://ci.appveyor.com/api/projects/LeelaChessZero/lczero-client/artifacts/client.exe?branch=release&pr=false&job=Environment%%3A%%20NAME%%3D.exe%%2C%%20GOOS%%3Dwindows"
- cmd: IF %APPVEYOR_REPO_TAG%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip client.exe
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %BLAS%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\OpenBLAS.0.2.14.1\lib\native\bin\x64\*.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %BLAS%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\OpenBLAS\dist64\bin\libopenblas.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %OPENCL%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip C:\cache\opencl-nug.0.777.12\build\native\bin\OpenCL.dll
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %CUDA%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%CUDA_PATH%\bin\cudart64_100.dll" "%CUDA_PATH%\bin\cublas64_100.dll"
- cmd: IF %APPVEYOR_REPO_TAG%==true IF %CUDA%==true 7z a lc0-%APPVEYOR_REPO_TAG_NAME%-windows-%NAME%.zip "%PKG_FOLDER%\cuda\bin\cudnn64_7.dll"
Expand All @@ -91,7 +92,7 @@ deploy:
appveyor_repo_tag: true
test_script:
- cmd: cd build
- cmd: IF %GTEST%==true copy C:\cache\OpenBLAS.0.2.14.1\lib\native\bin\x64\*.dll
- cmd: IF %GTEST%==true copy C:\cache\OpenBLAS\dist64\bin\libopenblas.dll
- cmd: IF %GTEST%==true xcopy /s /i C:\cache\syzygy syzygy
- cmd: IF %GTEST%==true meson test --print-errorlogs
- cmd: cd ..
Expand Down
69 changes: 69 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,72 @@
v0.20.0-rc1 (2018-12-22)
~~~~~~~~~~~

* Squeeze-and-Excitation Networks are now supported! (lc0.org/se)
* Older text network files are no longer supported.
* Various performance fixes (most major being having fast approximate math
functions).
* For systems with multiple GPUs, in addition to "multiplexing" backend
we now also have "demux" backend and "roundrobin" backend.
* Compiler settings tweaks (use VS2017 for windows builds, always have LTO
enabled, windows releases have PGO enabled).
* Benchmark mode has more options now (e.g. movetime) and saner defaults.
* Added an option to prevent engine to resign too early (used in training).
* Fixed a bug when number of visits could be too high in collision nodes.
The fix is pretty hacky, there will be better fix later.
* 32-bit version compiles again.

v0.19.1 (2018-12-10)
~~~~~~~

(no changes relative to v0.19.1-rc2)

v0.19.1-rc2 (2018-12-07)
~~~~~~~~~~~

* Temperature and FPU related params. (#568)
* Rework Cpuct related params. (#567)

v0.19.1-rc1 (2018-12-06)
~~~~~~~~~~~

* Updated cpuct formula from alphazero paper. (#563)
* remove UpdateFromUciOptions() from EnsureReady() (#558)
* revert IsSearchActive() and better fix for one of #500 crashes (#555)

v0.19.0 (2018-11-19)
~~~~~~~

* remove Wait() from EngineController::Stop() (#522)

v0.19.0-rc5 (2018-11-17)
~~~~~~~~~~~

* OpenCL: replace thread_local with a resource pool. (#516)
* optional wtime and btime (#515)
* Make convolve1 work with workgroup size of 128 (#514)
* adjust average depth calculation for multivisits (#510)

v0.19.0-rc4 (2018-11-12)
~~~~~~~~~~~

* Microseconds have 6 digits, not 3! (#505)
* use bestmove_is_sent_ for Search::IsSearchActive() (#502)

v0.19.0-rc3 (2018-11-07)
~~~~~~~~~~~

* Fix OpenCL tuner always loading the first saved tuning (#491)
* Do not show warning when ComputeBlocking() takes too much time. (#494)
* Output microseconds in log rather than milliseconds. (#495)
* Add benchmark features (#483)
* Fix EncodePositionForNN test failure (#490)

v0.19.0-rc2 (2018-11-03)
~~~~~~~~~~~

* Version v0.19.0-rc1 reported it's version as v0.19.0-dev
Therefore v0.19.0-rc2 is released with this issue fixed.

v0.19.0-rc1 (2018-11-03)
~~~~~~~~~~~

Expand Down
20 changes: 14 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# along with Leela Chess. If not, see <http://www.gnu.org/licenses/>.

project('lc0', 'cpp',
default_options : ['cpp_std=c++14', 'b_ndebug=if-release', 'b_lto=true'],
default_options : ['cpp_std=c++14', 'b_ndebug=if-release'],
meson_version: '>=0.45')

cc = meson.get_compiler('cpp')
Expand All @@ -26,7 +26,6 @@ endif
if cc.get_id() == 'clang' or cc.get_id() == 'gcc'
add_project_arguments('-Wextra', language : 'cpp')
add_project_arguments('-pedantic', language : 'cpp')
add_project_arguments('-ffast-math', language : 'cpp')

if get_option('buildtype') == 'release'
add_project_arguments('-march=native', language : 'cpp')
Expand All @@ -51,7 +50,10 @@ else
endif
protoc = find_program('protoc', required : false)
# For tensorflow skip system protobuf, chances are it will not work.
if not protobuf_dep.found() or not protoc.found() or get_option('tensorflow')
if get_option('protobuf-3-6-0')
deps += subproject('protobuf-3.6.0').get_variable('protobuf_dep')
protoc = subproject('protobuf-3.6.0').get_variable('protoc')
elif not protobuf_dep.found() or not protoc.found() or get_option('tensorflow')
deps += subproject('protobuf').get_variable('protobuf_dep')
protoc = subproject('protobuf').get_variable('protoc')
else
Expand Down Expand Up @@ -98,9 +100,11 @@ files += [
'src/neural/factory.cc',
'src/neural/loader.cc',
'src/neural/network_check.cc',
'src/neural/network_demux.cc',
'src/neural/network_legacy.cc',
'src/neural/network_mux.cc',
'src/neural/network_random.cc',
'src/neural/network_rr.cc',
'src/neural/network_st_batch.cc',
'src/neural/writer.cc',
'src/selfplay/game.cc',
Expand Down Expand Up @@ -155,6 +159,7 @@ if get_option('build_backends')
tensorflow_include,
tensorflow_include[0] + '/bazel-genfiles',
tensorflow_include[0] + '/tensorflow/contrib/makefile/downloads',
tensorflow_include[0] + '/tensorflow/contrib/makefile/downloads/absl',
tensorflow_include[0] + '/tensorflow/contrib/makefile/downloads/eigen',
tensorflow_include[0] + '/tensorflow/contrib/makefile/downloads/gemmlowp',
tensorflow_include[0] + '/tensorflow/contrib/makefile/downloads/nsync/public',
Expand All @@ -179,6 +184,9 @@ if get_option('build_backends')

mkl_libdirs = get_option('mkl_libdirs')
mkl_lib = cc.find_library('mkl_rt', dirs: mkl_libdirs, required: false)
if not mkl_lib.found()
mkl_lib = cc.find_library('mklml', dirs: mkl_libdirs, required: false)
endif

openblas_libdirs = get_option('openblas_libdirs')
openblas_lib = cc.find_library('openblas.dll', dirs: openblas_libdirs, required: false)
Expand Down Expand Up @@ -394,9 +402,9 @@ endif # if get_option('build_backends')
if not has_backends and get_option('build_backends')
error('''
No usable computation backends (cudnn/tensorflow/etc) are found.
If you want to build it with random only backend, pass
-D build_backends=false to a meson build.''')
No usable computation backends (cudnn/opencl/blas/etc) enabled.
If you want to build with the random backend only, add
-Dbuild_backends=false to the build command line.''')
endif


Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,8 @@ option('gtest',
type: 'boolean',
value: true,
description: 'Build gtest tests')

option('protobuf-3-6-0',
type: 'boolean',
value: false,
description: 'Use the protobuf 3.6.0 subproject')
11 changes: 0 additions & 11 deletions src/benchmark/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@ void Benchmark::Run() {
options.Add<IntOption>(kNNCacheSizeId, 0, 999999999) = 200000;
options.Add<IntOption>(kThreadsOptionId, 1, 128) = kDefaultThreads;

auto defaults = options.GetMutableDefaultsOptions();

defaults->Set<int>(SearchParams::kMiniBatchSizeId.GetId(), 256);
defaults->Set<float>(SearchParams::kFpuReductionId.GetId(), 1.2f);
defaults->Set<float>(SearchParams::kCpuctId.GetId(), 3.4f);
defaults->Set<float>(SearchParams::kPolicySoftmaxTempId.GetId(), 2.2f);
defaults->Set<int>(SearchParams::kMaxCollisionVisitsId.GetId(), 9999);
defaults->Set<int>(SearchParams::kMaxCollisionEventsId.GetId(), 32);
defaults->Set<int>(SearchParams::kCacheHistoryLengthId.GetId(), 0);
defaults->Set<bool>(SearchParams::kOutOfOrderEvalId.GetId(), true);

if (!options.ProcessAllFlags()) return;

try {
Expand Down
Loading

0 comments on commit 0f7bc50

Please sign in to comment.