Skip to content

Commit

Permalink
Parametrized default network and updated to new default network
Browse files Browse the repository at this point in the history
  • Loading branch information
Simske committed Jun 16, 2021
1 parent ef85374 commit ee2ecf5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ docker run -i --gpus=all -a STDIN -a STDOUT simske/lc0:latest
The networks are in the directory `/lc0/weights`, a docker volume can be mounted to this location to cache the downloaded networks.
To use a volume mount:
```
docker run -i --gpus=all -a STDIN -a STDOUT -v /lc0/weights -e NETWORK_HASH= simske/lc0:latest
docker run -i --gpus=all -a STDIN -a STDOUT -v /lc0/weights -e NETWORK= simske/lc0:latest
```
Or for a directory mount (such that a weights directory is connected to a folder on the host machine):
```
docker run -i --gpus=all -a STDIN -a STDOUT -v /path/on/host:/lc0/weights -e NETWORK_HASH= simske/lc0:latest
docker run -i --gpus=all -a STDIN -a STDOUT -v /path/on/host:/lc0/weights -e NETWORK= simske/lc0:latest
```


Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ COPY --from=builder /root/lc0/build/release/lc0 .
ENV PATH /lc0:$PATH

# Download default network
RUN wget -4 -O /lc0/weights/591226.pb.gz "https://training.lczero.org/get_network?sha=47e3f899519dc1bc95496a457b77730fce7b0b89b6187af5c01ecbbd02e88398"

RUN echo "NETWORK_NAME={{ network['name'] }}\nNETWORK_URL={{ network['url']}}" > /lc0/default_network.env && \
/lc0/download_network {{ network["url"] }} {{ network["name"] }}
{% if stockfish %}
# Copy stockfish executable
RUN mkdir /stockfish
Expand Down
3 changes: 3 additions & 0 deletions docker/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ default:
imagename: docker.io/simske/lc0
stockfish: False
march: ivybridge
network:
name: 703810.pb.gz
url: https://training.lczero.org/get_network?sha=b30e742bcfd905815e0e7dbd4e1bafb41ade748f85d006b8e28758f1a3107ae3
build:
image: nvcr.io/nvidia/cuda:11.0.3-cudnn8-devel-ubuntu20.04
apt_prerequisites: >-
Expand Down
5 changes: 2 additions & 3 deletions docker/scripts/network_parse
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ fi
if [[ -z "$NETWORK_NAME" ]]
then
echoerr "No network provided. Set it as environment variable \$NETWORK or write it to file /lc0/network"
echoerr "Using default network 591226"
NETWORK_NAME="591226.pb.gz"
NETWORK_URL="${base_weight_url}47e3f899519dc1bc95496a457b77730fce7b0b89b6187af5c01ecbbd02e88398"
source /lc0/default_network.env
echoerr "Using default network $NETWORK_NAME"
fi

echoerr $NETWORK_URL
Expand Down

0 comments on commit ee2ecf5

Please sign in to comment.