forked from leela-zero/leela-zero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds Eigen as a default matrix/vector library via a submodule. This has a load of advantages: * It can be used as a replacement for a cBLAS library when it is not available, cannot be found, or is outdated compared to the compiler or CPU. * Because Eigen is header only, it significantly eases the build prequisite requirements. * The Eigen code paths are much more readable from a mathematical perspective. * Eigen can optimize more heavily for known matrix sizes. The current code doesn't yet take advantage of this, though. The downsides: * Eigen might be a bit slower than other BLAS libraries. (Nevertheless, on my system it is faster than OpenBLAS) * Binaries built with Eigen are optimized for the CPU it was compiled on and don't port as well to other CPUs. So you need seperate binaries for wider client support. * Default Eigen in CMake, add tests. Default the Eigen library in CMake, as it's the fastest for most contemporary CPUs and configurations, and the easiest to build. We can optionally use BLAS by adding the USE_BLAS define, and will try to locate BLAS/OpenBLAS if so. This is useful for binaries for distribution such as our releases or distros. Split all tests to cover both Eigen and BLAS. Update build instructions to remove BLAS as a dependency, use CMake on all Unixy platforms, and use HTTPS. Pull request leela-zero#1692.
- Loading branch information
Showing
14 changed files
with
176 additions
and
64 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
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 |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM leela-zero:base | ||
|
||
# CPU build | ||
RUN CXX=g++ CC=gcc cmake -DUSE_CPU_ONLY=1 -DUSE_BLAS=1 .. | ||
|
||
CMD cmake --build . --target leelaz --config Release -- -j2 |
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,6 @@ | ||
FROM leela-zero:base | ||
|
||
# GPU build | ||
RUN CXX=g++ CC=gcc cmake -DUSE_BLAS=1 .. | ||
|
||
CMD cmake --build . --target leelaz --config Release -- -j2 |
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,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 | ||
|
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
Oops, something went wrong.