-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from killerducky/v0p8rc1
v0.8 RC1
- Loading branch information
Showing
83 changed files
with
7,882 additions
and
1,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
build/ | ||
testdata/ | ||
LC0VSProj/ | ||
CUDA_NN/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26430.15 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LC0VSProj", "LC0VSProj.vcxproj", "{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|x64 = Debug|x64 | ||
Release|x64 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}.Debug|x64.ActiveCfg = Debug|x64 | ||
{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}.Debug|x64.Build.0 = Debug|x64 | ||
{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}.Release|x64.ActiveCfg = Release|x64 | ||
{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}.Release|x64.Build.0 = Release|x64 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\src\chess\bitboard.cc" /> | ||
<ClCompile Include="..\src\chess\board.cc" /> | ||
<ClCompile Include="..\src\engine.cc" /> | ||
<ClCompile Include="..\src\main.cc" /> | ||
<ClCompile Include="..\src\mcts\node.cc" /> | ||
<ClCompile Include="..\src\mcts\search.cc" /> | ||
<ClCompile Include="..\src\neural\cache.cc" /> | ||
<ClCompile Include="..\src\neural\factory.cc" /> | ||
<ClCompile Include="..\src\neural\loader.cc" /> | ||
<ClCompile Include="..\src\neural\network_mux.cc" /> | ||
<ClCompile Include="..\src\neural\network_random.cc" /> | ||
<ClCompile Include="..\src\neural\writer.cc" /> | ||
<ClCompile Include="..\src\optionsparser.cc" /> | ||
<ClCompile Include="..\src\selfplay\game.cc" /> | ||
<ClCompile Include="..\src\selfplay\loop.cc" /> | ||
<ClCompile Include="..\src\selfplay\tournament.cc" /> | ||
<ClCompile Include="..\src\uciloop.cc" /> | ||
<ClCompile Include="..\src\utils\commandline.cc" /> | ||
<ClCompile Include="..\src\utils\optionsdict.cc" /> | ||
<ClCompile Include="..\src\utils\random.cc" /> | ||
<ClCompile Include="..\src\utils\transpose.cc" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="..\src\chess\bitboard.h" /> | ||
<ClInclude Include="..\src\chess\board.h" /> | ||
<ClInclude Include="..\src\engine.h" /> | ||
<ClInclude Include="..\src\mcts\callbacks.h" /> | ||
<ClInclude Include="..\src\mcts\node.h" /> | ||
<ClInclude Include="..\src\mcts\search.h" /> | ||
<ClInclude Include="..\src\neural\cache.h" /> | ||
<ClInclude Include="..\src\neural\factory.h" /> | ||
<ClInclude Include="..\src\neural\loader.h" /> | ||
<ClInclude Include="..\src\neural\network.h" /> | ||
<ClInclude Include="..\src\neural\network_cudnn.h" /> | ||
<ClInclude Include="..\src\neural\network_mux.h" /> | ||
<ClInclude Include="..\src\neural\network_random.h" /> | ||
<ClInclude Include="..\src\neural\network_tf.h" /> | ||
<ClInclude Include="..\src\neural\writer.h" /> | ||
<ClInclude Include="..\src\optionsparser.h" /> | ||
<ClInclude Include="..\src\selfplay\game.h" /> | ||
<ClInclude Include="..\src\selfplay\loop.h" /> | ||
<ClInclude Include="..\src\selfplay\tournament.h" /> | ||
<ClInclude Include="..\src\uciloop.h" /> | ||
<ClInclude Include="..\src\utils\bititer.h" /> | ||
<ClInclude Include="..\src\utils\cache-old.h" /> | ||
<ClInclude Include="..\src\utils\cache.h" /> | ||
<ClInclude Include="..\src\utils\commandline.h" /> | ||
<ClInclude Include="..\src\utils\cppattributes.h" /> | ||
<ClInclude Include="..\src\utils\exception.h" /> | ||
<ClInclude Include="..\src\utils\hashcat.h" /> | ||
<ClInclude Include="..\src\utils\mutex.h" /> | ||
<ClInclude Include="..\src\utils\optional.h" /> | ||
<ClInclude Include="..\src\utils\optionsdict.h" /> | ||
<ClInclude Include="..\src\utils\random.h" /> | ||
<ClInclude Include="..\src\utils\transpose.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<CudaCompile Include="..\src\neural\network_cudnn.cu" /> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{CBA46B8C-63B8-4F7F-A35D-E1464246DC72}</ProjectGuid> | ||
<RootNamespace>LC0VSProj</RootNamespace> | ||
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
<PlatformToolset>v141</PlatformToolset> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | ||
<ConfigurationType>Application</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>MultiByte</CharacterSet> | ||
<PlatformToolset>v141</PlatformToolset> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.1.props" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<LinkIncremental>true</LinkIncremental> | ||
<IncludePath>$(ProjectDir)\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\CUDA_NN\7.1</IncludePath> | ||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;..\CUDA_NN\7.1</LibraryPath> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<IncludePath>$(ProjectDir)\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath);..\CUDA_NN\7.1</IncludePath> | ||
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;..\CUDA_NN\7.1</LibraryPath> | ||
<TargetName>lc0-cudnn</TargetName> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>Disabled</Optimization> | ||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> | ||
</ClCompile> | ||
<Link> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<SubSystem>Console</SubSystem> | ||
<AdditionalDependencies>cublas.lib;cudnn.lib;cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
</Link> | ||
<PostBuildEvent> | ||
<Command>echo copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)" | ||
copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command> | ||
</PostBuildEvent> | ||
<CudaCompile> | ||
<TargetMachinePlatform>64</TargetMachinePlatform> | ||
</CudaCompile> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<Optimization>MaxSpeed</Optimization> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> | ||
</ClCompile> | ||
<Link> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<SubSystem>Console</SubSystem> | ||
<AdditionalDependencies>cublas.lib;cudnn.lib;cudart.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
</Link> | ||
<PostBuildEvent> | ||
<Command>echo copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)" | ||
copy "$(CudaToolkitBinDir)\cudart*.dll" "$(OutDir)"</Command> | ||
</PostBuildEvent> | ||
<CudaCompile> | ||
<TargetMachinePlatform>64</TargetMachinePlatform> | ||
</CudaCompile> | ||
</ItemDefinitionGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 9.1.targets" /> | ||
</ImportGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Building and running this version of lc0. | ||
|
||
Building is not very streightforward, but here's roughly the process: | ||
|
||
## Linux | ||
|
||
1. (if you want version with tensorflow) Install tensorflow_cc by following steps described [here](https://github.com/FloopCZ/tensorflow_cc). | ||
2. (if you want cuDNN version) Install CUDA and cuDNN. | ||
3. Install ninja and meson | ||
4. Go to lc0/ | ||
5. If you decided not to install tensorflow or CUDA, comment out building network_tf.cc and/or network_cudnn.cu from meson.build. | ||
6. Run ./build.sh | ||
|
||
## Windows | ||
|
||
Building for windows is currently complicated, you can try executeing steps listed [here](https://github.com/glinscott/leela-chess/issues/334#issuecomment-382848569). | ||
|
||
Alternatively, you can use pre-built binary: | ||
|
||
1. Install CUDA v9.0 (not 9.1) | ||
2. Inscall cuDNN for CUDA v9.0 | ||
3. Take latest binary from [here](https://crem.xyz/lc0/) | ||
|
||
That's it. | ||
|
||
For the cudnn (non-TF) version, building is much simpler. Install latest CUDA toolkit and compatible cuDNN, and build using the visual studio project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/usr/bin/bash | ||
#!/bin/bash | ||
|
||
rm -fr build | ||
CC=clang CXX=clang++ meson build --buildtype release # -Db_ndebug=true | ||
# CC=clang CXX=clang++ meson build --buildtype debugoptimized -Db_asneeded=false | ||
# CC=clang CXX=clang++ meson build --buildtype debug | ||
cp testdata/* build | ||
cd build | ||
ninja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
project('lc0', 'cpp') | ||
# default_options : ['cpp_std=c++17']) | ||
|
||
add_global_arguments('-std=c++17', language : 'cpp') | ||
add_global_arguments('-std=c++17', '-Wthread-safety', language : 'cpp') | ||
cc = meson.get_compiler('cpp') | ||
|
||
# Installed from https://github.com/FloopCZ/tensorflow_cc | ||
|
@@ -26,21 +26,44 @@ tensorflow_cc = declare_dependency( | |
deps = [] | ||
deps += tensorflow_cc | ||
deps += cc.find_library('stdc++fs') | ||
deps += cc.find_library('libcublas', dirs: ['/opt/cuda/lib64/', '/usr/local/cuda/lib64/']) | ||
deps += cc.find_library('libcudnn', dirs: ['/opt/cuda/lib64/', '/usr/local/cuda/lib64/']) | ||
deps += cc.find_library('libcudart', dirs: ['/opt/cuda/lib64/', '/usr/local/cuda/lib64/']) | ||
# deps += dependency('libprofiler') | ||
|
||
nvcc = find_program('nvcc') | ||
cuda_files = [ | ||
'src/neural/network_cudnn.cu', | ||
] | ||
|
||
cuda_gen = generator(nvcc, | ||
output: '@[email protected]', | ||
arguments: ['--std=c++14', '-c', '@INPUT@', '-o', '@OUTPUT@', '-I', '../src'], | ||
) | ||
|
||
files = [ | ||
'src/chess/bitboard.cc', | ||
'src/chess/board.cc', | ||
'src/mcts/node.cc', | ||
'src/mcts/search.cc', | ||
'src/neural/cache.cc', | ||
'src/neural/factory.cc', | ||
'src/neural/loader.cc', | ||
'src/neural/network_tf.cc', | ||
'src/neural/writer.cc', | ||
'src/neural/network_mux.cc', | ||
'src/neural/network_random.cc', | ||
'src/neural/cache.cc', | ||
'src/mcts/search.cc', | ||
'src/mcts/node.cc', | ||
'src/neural/network_tf.cc', | ||
'src/utils/transpose.cc', | ||
'src/utils/commandline.cc', | ||
'src/utils/optionsdict.cc', | ||
'src/utils/random.cc', | ||
'src/engine.cc', | ||
'src/optionsparser.cc', | ||
'src/selfplay/game.cc', | ||
'src/selfplay/tournament.cc', | ||
'src/selfplay/loop.cc', | ||
'src/uciloop.cc', | ||
'src/ucioptions.cc', | ||
'src/utils/transpose.cc', | ||
cuda_gen.process(cuda_files) | ||
] | ||
|
||
includes = [] | ||
|
@@ -60,11 +83,6 @@ test('ChessBoard', | |
files, include_directories: includes, dependencies: test_deps | ||
)) | ||
|
||
test('Network', | ||
executable('network_test', 'src/neural/network_test.cc', | ||
files, include_directories: includes, dependencies: test_deps | ||
)) | ||
|
||
test('HashCat', | ||
executable('hashcat_test', 'src/utils/hashcat_test.cc', | ||
files, include_directories: includes, dependencies: test_deps | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.