Skip to content

Commit e9a3ff1

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

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

.github/workflows/build.yml

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

10001047
ios-xcode-build:
10011048
runs-on: macos-latest
@@ -1060,6 +1107,7 @@ jobs:
10601107
- macOS-latest-cmake
10611108
- windows-latest-cmake
10621109
- windows-latest-cmake-cuda
1110+
- windows-latest-cmake-hip
10631111
- macOS-latest-cmake-arm64
10641112
- macOS-latest-cmake-x64
10651113

0 commit comments

Comments
 (0)