From 13210d1a16eb8a31347c4cf9e6b2b5931bfbdfce Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 14 Mar 2024 22:18:32 +0700 Subject: [PATCH 1/6] feat: CI - Add avx, avx512 and arm64 --- .github/workflows/build.yml | 256 +++++++++++------------------------- 1 file changed, 80 insertions(+), 176 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be924d3d8..fc87472e5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,21 @@ jobs: timeout-minutes: 20 permissions: contents: write + + strategy: + matrix: + include: + - build: "amd64-avx2" + defines: "-DLLAMA_NATIVE=OFF" + - build: "amd64-avx" + defines: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF" + # - build: "amd64-avx512" + # defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" + - build: "amd64-vulkan" + defines: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF" + - build: "arm64" + defines: "-A ARM64 -DLLAMA_NATIVE=OFF" + steps: - name: Clone id: checkout @@ -135,13 +150,21 @@ jobs: with: submodules: recursive + - name: Prepare Vulkan SDK + if: ${{ matrix.build == 'amd64-vulkan' }} + uses: humbletim/setup-vulkan-sdk@v1.2.0 + with: + vulkan-query-version: 1.3.275.0 + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true + - name: Build id: make_build run: | ldd --version ./install_deps.sh mkdir build && cd build - cmake -DLLAMA_NATIVE=OFF -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. + cmake ${{ matrix.defines }} -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. make -j $(nproc) ls -la @@ -156,11 +179,12 @@ jobs: uses: actions/upload-artifact@v2 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: - name: nitro-linux-amd64 + name: nitro-linux-${{ matrix.build }} path: ./nitro - name: Run e2e testing - LLama.CPP shell: bash + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} run: | # run e2e testing cd nitro @@ -169,6 +193,7 @@ jobs: - name: Run e2e testing - Whisper.CPP shell: bash + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} run: | # run e2e testing cd nitro @@ -182,65 +207,7 @@ jobs: with: upload_url: ${{ needs.create-draft-release.outputs.upload_url }} asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-linux-amd64.tar.gz - asset_content_type: application/gzip - - ubuntu-amd64-vulkan-build: - runs-on: ubuntu-18-04-cuda-11-7 - needs: [create-draft-release, set-nitro-version] - if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' - timeout-minutes: 20 - permissions: - contents: write - steps: - - name: Clone - id: checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install pkg-config - run: sudo apt-get install -y pkg-config - - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.275.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - - - name: Build - id: make_build - run: | - ldd --version - ./install_deps.sh - mkdir build && cd build - cmake -DLLAMA_NATIVE=OFF -DLLAMA_VULKAN=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} .. - make -j $(nproc) - ls -la - - - name: Package - shell: bash - run: | - mkdir -p nitro - cp build/nitro nitro/ - tar -czvf nitro.tar.gz nitro - - - name: Upload Artifact - uses: actions/upload-artifact@v2 - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' - with: - name: nitro-linux-amd64-vulkan - path: ./nitro - - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-linux-amd64-vulkan.tar.gz + asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-linux-${{ matrix.build }}.tar.gz asset_content_type: application/gzip ubuntu-amd64-cuda-build: @@ -284,22 +251,6 @@ jobs: name: nitro-linux-amd64-cuda-${{ matrix.cuda }} path: ./nitro - # - name: Run e2e testing - LLama.CPP - # shell: bash - # run: | - # # run e2e testing - # cd nitro - # chmod +x ../.github/scripts/e2e-test-llama-linux-and-mac.sh && ../.github/scripts/e2e-test-llama-linux-and-mac.sh ./nitro ${{ env.LLM_MODEL_URL }} - # rm -rf uploads/ - - # - name: Run e2e testing - Whisper.CPP - # shell: bash - # run: | - # # run e2e testing - # cd nitro - # chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }} - # rm -rf uploads/ - - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -464,6 +415,21 @@ jobs: needs: [create-draft-release, set-nitro-version] if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' timeout-minutes: 20 + + strategy: + matrix: + include: + - build: "amd64-avx2" + defines: "-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "amd64-avx" + defines: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "amd64-avx512" + defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "amd64-vulkan" + defines: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "arm64" + defines: "-A ARM64 -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON" + permissions: contents: write @@ -495,6 +461,15 @@ jobs: - name: actions-setup-cmake uses: jwlawson/actions-setup-cmake@v1.14.1 + - name: Install Vulkan SDK + id: get_vulkan + if: ${{ matrix.build == 'amd64-vulkan' }} + run: | + curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe" + & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install + Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}" + Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin" + - name: Build id: cmake_build shell: cmd @@ -503,7 +478,7 @@ jobs: cmake --build ./build_deps/nitro_deps --config Release mkdir -p build cd build - cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} + cmake .. ${{ matrix.defines }} -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%" - name: Pack artifacts @@ -522,8 +497,22 @@ jobs: 7z a -ttar temp.tar .\build\Release\* 7z a -tgzip nitro.tar.gz temp.tar + # - name: Check AVX512F support + # id: check_avx512f + # if: ${{ matrix.build == 'avx512' }} + # continue-on-error: true + # run: | + # cd build + # $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) + # $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim())) + # $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe') + # echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c + # & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main + # .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO" + - name: Run e2e testing - Llama.cpp shell: cmd + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} run: | cd build\Release ..\..\.github\scripts\e2e-test-llama-windows.bat nitro.exe ${{ env.LLM_MODEL_URL }} @@ -531,6 +520,7 @@ jobs: - name: Run e2e testing - Whisper.cpp shell: cmd + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} run: | cd build\Release ..\..\.github\scripts\e2e-test-whisper-windows.bat nitro.exe ${{ env.WHISPER_MODEL_URL }} @@ -540,94 +530,7 @@ jobs: uses: actions/upload-artifact@v2 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: - name: nitro-win-amd64 - path: ./build/Release - - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64.tar.gz - asset_content_type: application/gzip - - windows-amd64-vulkan-build: - runs-on: windows-latest - needs: [create-draft-release, set-nitro-version] - if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' - timeout-minutes: 20 - permissions: - contents: write - - steps: - - name: Clone - - id: checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Setup VSWhere.exe - uses: warrenbuckley/Setup-VSWhere@v1 - with: - version: latest - silent: true - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1 - - - name: Fetch SDL2 and set SDL2_DIR version 2.28.5 - run: | - C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip - 7z x sdl2.zip - echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-2.28.5/cmake" >> $env:GITHUB_ENV - - - name: actions-setup-cmake - uses: jwlawson/actions-setup-cmake@v1.14.1 - - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.275.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - - - name: Build - id: cmake_build - shell: cmd - run: | - cmake -S ./nitro_deps -B ./build_deps/nitro_deps - cmake --build ./build_deps/nitro_deps --config Release - mkdir -p build - cd build - cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_VULKAN=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} - cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%" - - - name: Pack artifacts - id: pack_artifacts - shell: cmd - run: | - robocopy build_deps\_install\bin\ .\build\Release\ zlib.dll - robocopy build\bin\Release\ .\build\Release\ llama.dll - robocopy build\bin\Release\ .\build\Release\ whisper.dll - robocopy .github\patches\windows\ .\build\Release\ msvcp140.dll - robocopy .github\patches\windows\ .\build\Release\ vcruntime140_1.dll - robocopy .github\patches\windows\ .\build\Release\ vcruntime140.dll - robocopy "$env:SDL2_DIR\..\lib\2.28.5\" .\build\Release\ SDL2.dll - dotnet tool install --global AzureSignTool - azuresigntool.exe sign -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" -kvi "${{ secrets.AZURE_CLIENT_ID }}" -kvt "${{ secrets.AZURE_TENANT_ID }}" -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\build\Release\nitro.exe" - 7z a -ttar temp.tar .\build\Release\* - 7z a -tgzip nitro.tar.gz temp.tar - - - name: Upload Artifact - uses: actions/upload-artifact@v2 - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' - with: - name: nitro-win-amd64-vulkan + name: nitro-win-${{ matrix.build }} path: ./build/Release - uses: actions/upload-release-asset@v1.0.1 @@ -637,7 +540,7 @@ jobs: with: upload_url: ${{ needs.create-draft-release.outputs.upload_url }} asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-vulkan.tar.gz + asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-${{ matrix.build }}.tar.gz asset_content_type: application/gzip windows-amd64-cuda-build: @@ -651,6 +554,13 @@ jobs: strategy: matrix: cuda: ["12-0", "11-7"] + include: + - build: "amd64" + defines: "-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "amd64-avx" + defines: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + - build: "amd64-avx512" + defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" steps: - name: Setup VSWhere.exe @@ -699,7 +609,7 @@ jobs: cmake --build ./build_deps/nitro_deps --config Release mkdir -p build cd build - cmake .. -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CUBLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DWHISPER_CUBLAS=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} + cmake .. ${{ matrix.defines }} -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%" - name: Pack artifacts @@ -723,7 +633,7 @@ jobs: uses: actions/upload-artifact@v2 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: - name: nitro-win-amd64-cuda-${{ matrix.cuda }} + name: nitro-win-${{ matrix.build }}-cuda-${{ matrix.cuda }} path: ./build/Release - uses: actions/upload-release-asset@v1.0.1 @@ -733,7 +643,7 @@ jobs: with: upload_url: ${{ needs.create-draft-release.outputs.upload_url }} asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-cuda-${{ matrix.cuda }}.tar.gz + asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-${{ matrix.build }}-cuda-${{ matrix.cuda }}.tar.gz asset_content_type: application/gzip update_release_draft: @@ -747,8 +657,6 @@ jobs: macOS-amd64-build, windows-amd64-build, windows-amd64-cuda-build, - ubuntu-amd64-vulkan-build, - windows-amd64-vulkan-build, ] permissions: contents: write @@ -771,8 +679,6 @@ jobs: macOS-amd64-build, windows-amd64-build, windows-amd64-cuda-build, - ubuntu-amd64-vulkan-build, - windows-amd64-vulkan-build, ] runs-on: ubuntu-latest steps: @@ -810,8 +716,6 @@ jobs: macOS-amd64-build, windows-amd64-build, windows-amd64-cuda-build, - ubuntu-amd64-vulkan-build, - windows-amd64-vulkan-build, ] runs-on: ubuntu-latest steps: From 03d1b9592bde39b87a52e541d3ac32a02ebee9fa Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 14 Mar 2024 22:47:30 +0700 Subject: [PATCH 2/6] fix: CI - update windows conditional check for instructions --- .github/workflows/build.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc87472e5..a0e7910b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -554,13 +554,7 @@ jobs: strategy: matrix: cuda: ["12-0", "11-7"] - include: - - build: "amd64" - defines: "-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" - - build: "amd64-avx" - defines: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" - - build: "amd64-avx512" - defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" + instructions: ["amd64-avx2", "amd64-avx", "amd64-avx512"] steps: - name: Setup VSWhere.exe @@ -601,6 +595,18 @@ jobs: with: dotnet-version: "6.0.x" + # Conditional instruction check and set environment variable + - name: Set INSTRUCTION Based on Instructions + shell: cmd + run: | + IF "${{ matrix.instructions }}" == "amd64-avx2" ( + echo "INSTRUCTION=-DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + ) ELSE IF "${{ matrix.instructions }}" == "amd64-avx" ( + echo "INSTRUCTION=-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + ) ELSE IF "${{ matrix.instructions }}" == "amd64-avx512" ( + echo "INSTRUCTION=-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + ) + - name: Build id: cmake_build shell: cmd @@ -609,7 +615,7 @@ jobs: cmake --build ./build_deps/nitro_deps --config Release mkdir -p build cd build - cmake .. ${{ matrix.defines }} -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} + cmake .. %DEFINES% -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%" - name: Pack artifacts @@ -633,7 +639,7 @@ jobs: uses: actions/upload-artifact@v2 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: - name: nitro-win-${{ matrix.build }}-cuda-${{ matrix.cuda }} + name: nitro-win-${{ matrix.instructions }}-cuda-${{ matrix.cuda }} path: ./build/Release - uses: actions/upload-release-asset@v1.0.1 @@ -643,7 +649,7 @@ jobs: with: upload_url: ${{ needs.create-draft-release.outputs.upload_url }} asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-${{ matrix.build }}-cuda-${{ matrix.cuda }}.tar.gz + asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-${{ matrix.instructions }}-cuda-${{ matrix.cuda }}.tar.gz asset_content_type: application/gzip update_release_draft: From a5571711caaa7c65f24b3f5873390f37f7b5585a Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 14 Mar 2024 23:15:48 +0700 Subject: [PATCH 3/6] fix: Update windows cuda runner and some bugs --- .github/workflows/build.yml | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0e7910b8..2c5411851 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -140,8 +140,8 @@ jobs: # defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" - build: "amd64-vulkan" defines: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF" - - build: "arm64" - defines: "-A ARM64 -DLLAMA_NATIVE=OFF" + # - build: "arm64" + # defines: "-A ARM64 -DLLAMA_NATIVE=OFF" steps: - name: Clone @@ -461,14 +461,13 @@ jobs: - name: actions-setup-cmake uses: jwlawson/actions-setup-cmake@v1.14.1 - - name: Install Vulkan SDK - id: get_vulkan + - name: Prepare Vulkan SDK + uses: humbletim/setup-vulkan-sdk@v1.2.0 if: ${{ matrix.build == 'amd64-vulkan' }} - run: | - curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/VulkanSDK-${env:VULKAN_VERSION}-Installer.exe" - & "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install - Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}" - Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin" + with: + vulkan-query-version: 1.3.275.0 + vulkan-components: Vulkan-Headers, Vulkan-Loader + vulkan-use-cache: true - name: Build id: cmake_build @@ -544,7 +543,7 @@ jobs: asset_content_type: application/gzip windows-amd64-cuda-build: - runs-on: windows-cuda-${{ matrix.cuda }} + runs-on: windows-latest needs: [create-draft-release, set-nitro-version] if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' timeout-minutes: 20 @@ -568,6 +567,13 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1 + - uses: Jimver/cuda-toolkit@v0.2.11 + id: cuda-toolkit + with: + cuda: ${{ matrix.cuda }} + method: "network" + sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]' + - name: Fetch SDL2 and set SDL2_DIR version 2.28.5 run: | curl -L -o sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip @@ -596,15 +602,18 @@ jobs: dotnet-version: "6.0.x" # Conditional instruction check and set environment variable - - name: Set INSTRUCTION Based on Instructions + - name: Set INSTRUCTION Based on Instructions ${{ matrix.instructions }} shell: cmd run: | IF "${{ matrix.instructions }}" == "amd64-avx2" ( echo "INSTRUCTION=-DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + echo "INSTRUCTION=-DLLAMA_NATIVE=OFF" ) ELSE IF "${{ matrix.instructions }}" == "amd64-avx" ( echo "INSTRUCTION=-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + echo "INSTRUCTION=-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF" ) ELSE IF "${{ matrix.instructions }}" == "amd64-avx512" ( echo "INSTRUCTION=-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" >> $env:GITHUB_ENV + echo "INSTRUCTION=-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" ) - name: Build @@ -615,7 +624,7 @@ jobs: cmake --build ./build_deps/nitro_deps --config Release mkdir -p build cd build - cmake .. %DEFINES% -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} + cmake .. %INSTRUCTION% -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} cmake --build . --config Release -j "%NUMBER_OF_PROCESSORS%" - name: Pack artifacts From b887b8bd93fb99c8e2f94030b40786eb10193497 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 14 Mar 2024 23:19:27 +0700 Subject: [PATCH 4/6] fix: Update correct cuda version pin --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c5411851..9b1b0e13b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -552,7 +552,7 @@ jobs: strategy: matrix: - cuda: ["12-0", "11-7"] + cuda: ["12.2.0", "11.7.1"] instructions: ["amd64-avx2", "amd64-avx", "amd64-avx512"] steps: From 87a8a8e399407f86963acaef28257e4bb666d467 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 14 Mar 2024 23:45:32 +0700 Subject: [PATCH 5/6] fix: remove arm64 and use self hosted windows cuda --- .github/workflows/build.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9b1b0e13b..ddeb53ff4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -427,8 +427,8 @@ jobs: defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" - build: "amd64-vulkan" defines: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DWHISPER_SDL2=ON" - - build: "arm64" - defines: "-A ARM64 -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON" + # - build: "arm64" + # defines: "-A ARM64 -DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON" permissions: contents: write @@ -543,7 +543,7 @@ jobs: asset_content_type: application/gzip windows-amd64-cuda-build: - runs-on: windows-latest + runs-on: windows-cuda-${{ matrix.cuda }} needs: [create-draft-release, set-nitro-version] if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' timeout-minutes: 20 @@ -552,7 +552,7 @@ jobs: strategy: matrix: - cuda: ["12.2.0", "11.7.1"] + cuda: ["12-0", "11-7"] instructions: ["amd64-avx2", "amd64-avx", "amd64-avx512"] steps: @@ -567,13 +567,6 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1 - - uses: Jimver/cuda-toolkit@v0.2.11 - id: cuda-toolkit - with: - cuda: ${{ matrix.cuda }} - method: "network" - sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]' - - name: Fetch SDL2 and set SDL2_DIR version 2.28.5 run: | curl -L -o sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-devel-2.28.5-VC.zip From ff4a216b636b77c5bad704601d98fe07f7d67db7 Mon Sep 17 00:00:00 2001 From: hiro Date: Fri, 15 Mar 2024 00:01:51 +0700 Subject: [PATCH 6/6] fixL CI - Update regarding avx512 --- .github/workflows/build.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ddeb53ff4..b1edf9aa5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,8 +136,8 @@ jobs: defines: "-DLLAMA_NATIVE=OFF" - build: "amd64-avx" defines: "-DLLAMA_AVX2=OFF -DLLAMA_NATIVE=OFF" - # - build: "amd64-avx512" - # defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" + - build: "amd64-avx512" + defines: "-DLLAMA_AVX512=ON -DLLAMA_NATIVE=OFF" - build: "amd64-vulkan" defines: "-DLLAMA_VULKAN=ON -DLLAMA_NATIVE=OFF" # - build: "arm64" @@ -184,7 +184,7 @@ jobs: - name: Run e2e testing - LLama.CPP shell: bash - if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' && matrix.build != 'amd64-avx512' }} run: | # run e2e testing cd nitro @@ -193,7 +193,7 @@ jobs: - name: Run e2e testing - Whisper.CPP shell: bash - if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' && matrix.build != 'amd64-avx512' }} run: | # run e2e testing cd nitro @@ -496,22 +496,9 @@ jobs: 7z a -ttar temp.tar .\build\Release\* 7z a -tgzip nitro.tar.gz temp.tar - # - name: Check AVX512F support - # id: check_avx512f - # if: ${{ matrix.build == 'avx512' }} - # continue-on-error: true - # run: | - # cd build - # $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) - # $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim())) - # $cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe') - # echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c - # & $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main - # .\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO" - - name: Run e2e testing - Llama.cpp shell: cmd - if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' && matrix.build != 'amd64-avx512' }} run: | cd build\Release ..\..\.github\scripts\e2e-test-llama-windows.bat nitro.exe ${{ env.LLM_MODEL_URL }} @@ -519,7 +506,7 @@ jobs: - name: Run e2e testing - Whisper.cpp shell: cmd - if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' }} + if: ${{ matrix.build != 'arm64' && matrix.build != 'amd64-vulkan' && matrix.build != 'amd64-avx512' }} run: | cd build\Release ..\..\.github\scripts\e2e-test-whisper-windows.bat nitro.exe ${{ env.WHISPER_MODEL_URL }}