From eef97c88b5bac280803ebb3c3b7bb09f89b0fd88 Mon Sep 17 00:00:00 2001 From: Oliver Simons Date: Thu, 6 Aug 2026 17:27:34 +0200 Subject: [PATCH] Add temp validations to CI --- .github/workflows/build-cpu.yml | 56 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 39 +++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/.github/workflows/build-cpu.yml b/.github/workflows/build-cpu.yml index 036f733b7b..3ea0397a42 100644 --- a/.github/workflows/build-cpu.yml +++ b/.github/workflows/build-cpu.yml @@ -214,6 +214,20 @@ jobs: $dest = ".\build\bin\Release" Copy-Item (Join-Path $root "bin\libomp.dll") $dest + - name: Validate LLVM OpenMP imports + if: ${{ matrix.openmp }} + run: | + $dest = ".\build\bin\Release" + $imports = Get-ChildItem (Join-Path $dest "*") -File -Include *.dll,*.exe | + ForEach-Object { (& llvm-readobj --coff-imports $_.FullName) -join "`n" } | + Out-String + if ($imports -notmatch "(?im)^\s*Name: libomp\.dll$") { + throw "No built binary imports libomp.dll" + } + if ($imports -match "(?i)libomp140") { + throw "A built binary imports the non-redistributable libomp140 runtime" + } + - name: Add libopenblas.dll id: add_libopenblas_dll if: ${{ matrix.build == 'x64-openblas' }} @@ -221,6 +235,15 @@ jobs: cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt + - name: Validate embedded LLVM license + if: ${{ matrix.arch == 'x64' }} + run: | + $licenses = (& .\build\bin\Release\llama.exe licenses) -join "`n" + $expected = "${{ matrix.openmp }}" -eq "true" + if (($licenses -match "License for LLVM") -ne $expected) { + throw "Unexpected LLVM license embedding state" + } + - name: Test id: cmake_test if: ${{ matrix.arch == 'x64' }} @@ -228,6 +251,13 @@ jobs: cd build ctest -L main -C Release --verbose --timeout 900 + - name: Upload Windows ARM64 test binaries + if: ${{ matrix.build == 'arm64' }} + uses: actions/upload-artifact@v6 + with: + name: windows-arm64-openmp-ci + path: build/bin/Release/* + # TODO: disabled for now, consider adding tests for all CPU variants instead # - name: Test (Intel SDE) # id: cmake_test_sde @@ -241,3 +271,29 @@ jobs: # cd build # $env:LLAMA_SKIP_TESTS_SLOW_ON_EMULATOR = 1 # & $sde -future -- ctest -L main -C Release --verbose --timeout 900 + + windows-arm64-openmp: + needs: [windows] + runs-on: windows-11-arm + + steps: + - name: Download Windows ARM64 test binaries + uses: actions/download-artifact@v7 + with: + name: windows-arm64-openmp-ci + path: bin + + - name: Test LLVM OpenMP runtime + run: | + $env:OMP_NUM_THREADS = 2 + $imports = Get-ChildItem .\bin\* -File -Include *.dll,*.exe | + ForEach-Object { (& llvm-readobj --coff-imports $_.FullName) -join "`n" } | + Out-String + if ($imports -notmatch "(?im)^\s*Name: libomp\.dll$") { + throw "No ARM64 test binary imports libomp.dll" + } + $licenses = (& .\bin\llama.exe licenses) -join "`n" + if ($licenses -notmatch "License for LLVM") { + throw "LLVM license is not embedded in llama.exe" + } + & .\bin\test-quantize-fns.exe diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a6b389067..c2ead88006 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -757,6 +757,17 @@ jobs: $dest = ".\build\bin\Release" Copy-Item (Join-Path $root "bin\libomp.dll") $dest Copy-Item LICENSE $dest + + $imports = Get-ChildItem (Join-Path $dest "*") -File -Include *.dll,*.exe | + ForEach-Object { (& llvm-readobj --coff-imports $_.FullName) -join "`n" } | + Out-String + if ($imports -notmatch "(?im)^\s*Name: libomp\.dll$") { + throw "No packaged binary imports libomp.dll" + } + if ($imports -match "(?i)libomp140") { + throw "A packaged binary imports the non-redistributable libomp140 runtime" + } + 7z a -snl llama-bin-win-cpu-${{ matrix.arch }}.zip .\build\bin\Release\* - name: Upload artifacts @@ -765,6 +776,33 @@ jobs: path: llama-bin-win-cpu-${{ matrix.arch }}.zip name: llama-bin-win-cpu-${{ matrix.arch }}.zip + windows-cpu-arm64-smoke: + needs: [check-release, windows-cpu] + if: ${{ needs.check-release.outputs.should_release == 'true' }} + runs-on: windows-11-arm + + steps: + - name: Download Windows ARM64 package + uses: actions/download-artifact@v7 + with: + name: llama-bin-win-cpu-arm64.zip + + - name: Test Windows ARM64 package + run: | + Expand-Archive .\llama-bin-win-cpu-arm64.zip -DestinationPath bin + $env:OMP_NUM_THREADS = 2 + $imports = Get-ChildItem .\bin\* -File -Include *.dll,*.exe | + ForEach-Object { (& llvm-readobj --coff-imports $_.FullName) -join "`n" } | + Out-String + if ($imports -notmatch "(?im)^\s*Name: libomp\.dll$") { + throw "No packaged ARM64 binary imports libomp.dll" + } + $licenses = (& .\bin\llama.exe licenses) -join "`n" + if ($licenses -notmatch "License for LLVM") { + throw "LLVM license is not embedded in llama.exe" + } + & .\bin\llama-cli.exe --version + windows: needs: [check-release] if: ${{ needs.check-release.outputs.should_release == 'true' }} @@ -1571,6 +1609,7 @@ jobs: - get-version - windows - windows-cpu + - windows-cpu-arm64-smoke - windows-cuda #- windows-sycl - windows-hip