@@ -19,10 +19,18 @@ concurrency:
1919 group : ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
2020 cancel-in-progress : true
2121
22+ # Fine-grant permission
23+ # https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
24+ permissions :
25+ contents : write # for creating release
26+
2227env :
2328 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
2429 GGML_NLOOP : 3
2530 GGML_N_THREADS : 1
31+ LLAMA_LOG_COLORS : 1
32+ LLAMA_LOG_PREFIX : 1
33+ LLAMA_LOG_TIMESTAMPS : 1
2634
2735jobs :
2836 macOS-latest-cmake-arm64 :
@@ -953,6 +961,7 @@ jobs:
953961 cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl7.dll" ./build/bin
954962 cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin
955963 cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin
964+ cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin
956965 echo "cp oneAPI running time dll files to ./build/bin done"
957966 7z a llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip ./build/bin/*
958967
@@ -964,8 +973,45 @@ jobs:
964973 name : llama-bin-win-sycl-x64.zip
965974
966975 windows-latest-cmake-hip :
976+ if : ${{ github.event.inputs.create_release != 'true' }}
977+ runs-on : windows-latest
978+
979+ steps :
980+ - name : Clone
981+ id : checkout
982+ uses : actions/checkout@v4
983+
984+ - name : Install
985+ id : depends
986+ run : |
987+ $ErrorActionPreference = "Stop"
988+ write-host "Downloading AMD HIP SDK Installer"
989+ Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
990+ write-host "Installing AMD HIP SDK"
991+ Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -Wait
992+ write-host "Completed AMD HIP SDK installation"
993+
994+ - name : Verify ROCm
995+ id : verify
996+ run : |
997+ & 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
998+
999+ - name : Build
1000+ id : cmake_build
1001+ run : |
1002+ $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
1003+ $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
1004+ cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DGGML_RPC=ON
1005+ cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1006+
1007+ windows-latest-cmake-hip-release :
1008+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
9671009 runs-on : windows-latest
9681010
1011+ strategy :
1012+ matrix :
1013+ gpu_target : [gfx1100, gfx1101, gfx1030]
1014+
9691015 steps :
9701016 - name : Clone
9711017 id : checkout
@@ -991,8 +1037,36 @@ jobs:
9911037 run : |
9921038 $env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
9931039 $env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
994- cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIPBLAS=ON
995- cmake --build build --config Release
1040+ cmake -G "Unix Makefiles" -B build -S . -DCMAKE_C_COMPILER="${env:HIP_PATH}\bin\clang.exe" -DCMAKE_CXX_COMPILER="${env:HIP_PATH}\bin\clang++.exe" -DGGML_HIPBLAS=ON -DCMAKE_BUILD_TYPE=Release -DAMDGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON
1041+ cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1042+ md "build\bin\rocblas\library\"
1043+ cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1044+ cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1045+ cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1046+
1047+ - name : Determine tag name
1048+ id : tag
1049+ shell : bash
1050+ run : |
1051+ BUILD_NUMBER="$(git rev-list --count HEAD)"
1052+ SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1053+ if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1054+ echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1055+ else
1056+ SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1057+ echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1058+ fi
1059+
1060+ - name : Pack artifacts
1061+ id : pack_artifacts
1062+ run : |
1063+ 7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1064+
1065+ - name : Upload artifacts
1066+ uses : actions/upload-artifact@v4
1067+ with :
1068+ path : llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1069+ name : llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
9961070
9971071 ios-xcode-build :
9981072 runs-on : macos-latest
@@ -1057,6 +1131,7 @@ jobs:
10571131 - macOS-latest-cmake
10581132 - windows-latest-cmake
10591133 - windows-latest-cmake-cuda
1134+ - windows-latest-cmake-hip-release
10601135 - macOS-latest-cmake-arm64
10611136 - macOS-latest-cmake-x64
10621137
0 commit comments