Skip to content

Commit 4e25dad

Browse files
committed
CI: Provide prebuilt windows binary for hip
1 parent 6026da5 commit 4e25dad

File tree

1 file changed

+52
-3
lines changed

1 file changed

+52
-3
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,10 @@ jobs:
969969
windows-latest-cmake-hip:
970970
runs-on: windows-latest
971971

972+
strategy:
973+
matrix:
974+
gpu_target: [gfx1100, gfx1101, gfx1030]
975+
972976
steps:
973977
- name: Clone
974978
id: checkout
@@ -990,12 +994,56 @@ jobs:
990994
& 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' --version
991995
992996
- name: Build
993-
id: cmake_build
997+
id: cmake_build_ci
998+
if: ${{ github.event.inputs.create_release != 'true' }}
994999
run: |
9951000
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
9961001
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
997-
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
998-
cmake --build build --config Release
1002+
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
1003+
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1004+
md "build\bin\rocblas\library\"
1005+
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1006+
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1007+
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1008+
1009+
- name: Build
1010+
id: cmake_build_release
1011+
if: ${{ github.event.inputs.create_release == 'true' }}
1012+
run: |
1013+
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
1014+
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
1015+
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 -DGPU_TARGETS=${{ matrix.gpu_target }} -DGGML_RPC=ON
1016+
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1017+
md "build\bin\rocblas\library\"
1018+
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1019+
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1020+
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1021+
1022+
- name: Determine tag name
1023+
id: tag
1024+
shell: bash
1025+
run: |
1026+
BUILD_NUMBER="$(git rev-list --count HEAD)"
1027+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1028+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1029+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1030+
else
1031+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1032+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1033+
fi
1034+
1035+
- name: Pack artifacts
1036+
id: pack_artifacts
1037+
if: ${{ github.event.inputs.create_release == 'true' }}
1038+
run: |
1039+
7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1040+
1041+
- name: Upload artifacts
1042+
if: ${{ github.event.inputs.create_release == 'true' }}
1043+
uses: actions/upload-artifact@v4
1044+
with:
1045+
path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1046+
name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
9991047

10001048
ios-xcode-build:
10011049
runs-on: macos-latest
@@ -1060,6 +1108,7 @@ jobs:
10601108
- macOS-latest-cmake
10611109
- windows-latest-cmake
10621110
- windows-latest-cmake-cuda
1111+
- windows-latest-cmake-hip
10631112
- macOS-latest-cmake-arm64
10641113
- macOS-latest-cmake-x64
10651114

0 commit comments

Comments
 (0)