Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/blas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: BLAS Backend Build

on:
workflow_call:
inputs:
os:
required: true
type: string
artifact_name:
required: true
type: string

jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Update submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
- name: Install Build Tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build curl binutils python3-pip
pip3 install meson==1.3.2
meson --version
- name: Install BLAS Dependencies
run: |
sudo apt-get install -y libblas-dev libopenblas-dev
- name: Remove Build Directory
run: |
echo "Cleaning old build..."
rm -rf build
- name: Configure Meson and Build BLAS
run: |
meson setup --buildtype release build -Dblas=true \
-Dgtest=false -Dnative_arch=false
ninja -C build -v
- name: Upload Meson Log on Failure
if: failure()
uses: actions/upload-artifact@v4.4.3
with:
name: build-logs-${{ inputs.artifact_name }}
path: build
- name: Download Network
if: success()
run: |
cd build
curl -L https://training.lczero.org/get_network?sha=195b450999e874d07aea2c09fd0db5eff9d4441ec1ad5a60a140fe8ea94c4f3a -o T79.pb.gz
touch -t 201801010000.00 T79.pb.gz
- name: Run tests
if: success()
run: |
./build/lc0 benchmark --backend=blas --num-positions=2 --task-workers=3 --minibatch-size=7 --threads=2
- name: Upload a Build Artifact
if: success()
uses: actions/upload-artifact@v4.4.3
with:
name: lc0-${{ inputs.artifact_name }}
path: |
build/lc0
build/T79.pb.gz
78 changes: 78 additions & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CUDA Backend Build

on:
workflow_call:
inputs:
os:
required: true
type: string
artifact_name:
required: true
type: string

jobs:
build:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Update submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
- name: Install Build Tools
run: |
sudo apt-get update
sudo apt-get install -y ninja-build curl binutils python3-pip
pip3 install meson==1.3.2
meson --version
- name: Install CUDA.12 Dependencies
run: |
if [ "${{ inputs.os }}" == "ubuntu-22.04" ]; then
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda-repo-ubuntu2204-12-9-local_12.9.1-575.57.08-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2204-12-9-local_12.9.1-575.57.08-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2204-12-9-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-9
else
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-ubuntu2404.pin
sudo mv cuda-ubuntu2404.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda-repo-ubuntu2404-12-9-local_12.9.1-575.57.08-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2404-12-9-local_12.9.1-575.57.08-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2404-12-9-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda-toolkit-12-9
fi
- name: Remove Build Directory
run: |
echo "Cleaning old build..."
rm -rf build
- name: Configure Meson and Build CUDA
run: |
meson setup --buildtype release build \
-Dplain_cuda=true -Dcudnn=false \
-Dgtest=false -Dnative_arch=false
ninja -C build -v
- name: Upload Meson Log on Failure
if: failure()
uses: actions/upload-artifact@v4.4.3
with:
name: build-logs-${{ inputs.artifact_name }}
path: build
- name: Download Network
if: success()
run: |
cd build
curl -L https://training.lczero.org/get_network?sha=195b450999e874d07aea2c09fd0db5eff9d4441ec1ad5a60a140fe8ea94c4f3a -o T79.pb.gz
touch -t 201801010000.00 T79.pb.gz
- name: Upload a Build Artifact
if: success()
uses: actions/upload-artifact@v4.4.3
with:
name: lc0-${{ inputs.artifact_name }}
path: |
build/lc0
build/T79.pb.gz
173 changes: 173 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: Multi-Backend Lc0 Build

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
outputs:
sycl: ${{ steps.filter.outputs.sycl }}
blas: ${{ steps.filter.outputs.blas }}
cuda: ${{ steps.filter.outputs.cuda }}
onnx: ${{ steps.filter.outputs.onnx }}
common_files: ${{ steps.filter.outputs.common_files }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Update submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
- uses: dorny/paths-filter@v3.0.2
id: filter
with:
filters: |
sycl:
- 'src/neural/backends/sycl/**'
blas:
- 'src/neural/backends/blas/**'
cuda:
- 'src/neural/backends/cuda/**'
onnx:
- 'src/neural/backends/network_onnx.cc'
- 'src/neural/onnx/**'
common_files:
# Engine files
- 'src/engine.cc'
- 'src/engine.h'
- 'src/engine_loop.cc'
- 'src/engine_loop.h'
- 'src/engine_test.cc'
- 'src/main.cc'
# Common filders
- 'src/chess/**'
- 'src/trainingdata/**'
- 'src/python/**'
- 'src/utils/**'
- 'src/tools/**'
- 'src/search/**'
- 'src/syzygy/**'
# Shared neural files
- 'src/neural/factory.cc'
- 'src/neural/common.h'
- 'src/neural/common.cc'
- 'src/neural/backend.cc'
- 'src/neural/backend.h'
- 'src/neural/batchsplit.cc'
- 'src/neural/batchsplit.h'
- 'src/neural/decoder.cc'
- 'src/neural/decoder.h'
- 'src/neural/encoder.cc'
- 'src/neural/encoder.h'
- 'src/neural/encoder_test.cc'
- 'src/neural/factory.cc'
- 'src/neural/factory.h'
- 'src/neural/loader.cc'
- 'src/neural/loader.h'
- 'src/neural/memcache.cc'
- 'src/neural/memcache.h'
- 'src/neural/mock_backend.h'
- 'src/neural/network.h'
- 'src/neural/network_legacy.cc'
- 'src/neural/network_legacy.h'
- 'src/neural/register.cc'
- 'src/neural/register.h'
- 'src/neural/shared_params.cc'
- 'src/neural/shared_params.h'
- 'src/neural/wrapper.cc'
- 'src/neural/wrapper.h'
# Shared backend files
- 'src/neural/backends/network_check.cc'
- 'src/neural/backends/network_demux.cc'
- 'src/neural/backends/network_mux.cc'
- 'src/neural/backends/network_random.cc'
- 'src/neural/backends/network_record.cc'
- 'src/neural/backends/network_rr.cc'
- 'src/neural/backends/network_tf_cc.cc'
- 'src/neural/backends/network_trivial.cc'
# Shared Neural folders
- 'src/neural/tables/**'
# Workflow folder
- '.github/workflows/**'
# Build files
- 'meson.build'
- 'meson_options.txt'
# External folders
- 'subprojects/**'
- 'scripts/**'
- 'third_party/**'


sycl-build:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.sycl == 'true' }}
uses: ./.github/workflows/sycl.yml
with:
os: ubuntu-22.04
artifact_name: sycl-ubuntu-22.04

sycl-build-24:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.sycl == 'true' }}
uses: ./.github/workflows/sycl.yml
with:
os: ubuntu-24.04
artifact_name: sycl-ubuntu-24.04

cuda-build:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.cuda == 'true' }}
uses: ./.github/workflows/cuda.yml
with:
os: ubuntu-22.04
artifact_name: cuda-12.9-ubuntu-22.04

cuda-build-24:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.cuda == 'true' }}
uses: ./.github/workflows/cuda.yml
with:
os: ubuntu-24.04
artifact_name: cuda-12.9-ubuntu-24.04

blas-build:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.blas == 'true' }}
uses: ./.github/workflows/blas.yml
with:
os: ubuntu-22.04
artifact_name: blas-ubuntu-22.04

blas-build-24:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.blas == 'true' }}
uses: ./.github/workflows/blas.yml
with:
os: ubuntu-24.04
artifact_name: blas-ubuntu-24.04

onnx-trt-build:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.onnx == 'true' }}
uses: ./.github/workflows/onnx-trt.yml
with:
os: ubuntu-22.04
artifact_name: onnx-trt-ubuntu-22.04

onnx-trt-build-24:
needs: build
if: ${{ needs.build.outputs.common_files == 'true' || needs.build.outputs.onnx == 'true' }}
uses: ./.github/workflows/onnx-trt.yml
with:
os: ubuntu-24.04
artifact_name: onnx-trt-ubuntu-24.04
Loading