Skip to content

Commit 828e8e5

Browse files
committed
CI: Provide prebuilt windows binary for hip
1 parent 0abc6a2 commit 828e8e5

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

.github/workflows/build.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,10 @@ jobs:
966966
windows-latest-cmake-hip:
967967
runs-on: windows-latest
968968

969+
strategy:
970+
matrix:
971+
gpu_target: [gfx1100, gfx1101, gfx1030]
972+
969973
steps:
970974
- name: Clone
971975
id: checkout
@@ -991,8 +995,38 @@ jobs:
991995
run: |
992996
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
993997
$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
998+
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
999+
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1000+
md "build\bin\rocblas\library\"
1001+
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1002+
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1003+
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1004+
1005+
- name: Determine tag name
1006+
id: tag
1007+
shell: bash
1008+
run: |
1009+
BUILD_NUMBER="$(git rev-list --count HEAD)"
1010+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1011+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1012+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1013+
else
1014+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1015+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1016+
fi
1017+
1018+
- name: Pack artifacts
1019+
id: pack_artifacts
1020+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1021+
run: |
1022+
7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1023+
1024+
- name: Upload artifacts
1025+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1026+
uses: actions/upload-artifact@v4
1027+
with:
1028+
path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1029+
name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
9961030

9971031
ios-xcode-build:
9981032
runs-on: macos-latest
@@ -1057,6 +1091,7 @@ jobs:
10571091
- macOS-latest-cmake
10581092
- windows-latest-cmake
10591093
- windows-latest-cmake-cuda
1094+
- windows-latest-cmake-hip
10601095
- macOS-latest-cmake-arm64
10611096
- macOS-latest-cmake-x64
10621097

0 commit comments

Comments
 (0)