Skip to content

Commit 80b53c6

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

File tree

1 file changed

+56
-2
lines changed

1 file changed

+56
-2
lines changed

.github/workflows/build.yml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,9 +966,32 @@ jobs:
966966
path: llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip
967967
name: llama-bin-win-sycl-x64.zip
968968

969+
windows-latest-cmake-hip-calculate-target:
970+
runs-on: windows-latest
971+
outputs:
972+
gpu_targets: ${{ steps.set_gpu_targets.outputs.gpu_targets }}
973+
974+
steps:
975+
- name: Set GPU targets
976+
id: set_gpu_targets
977+
if: ${{ github.event.inputs.create_release != 'true' }}
978+
run: |
979+
echo 'gpu_target=["gfx1100", "gfx1101", "gfx1030"]' >> "$GITHUB_OUTPUT"
980+
981+
steps:
982+
- name: Set GPU targets
983+
id: set_gpu_targets
984+
if: ${{ github.event.inputs.create_release == 'true' }}
985+
run: |
986+
echo 'gpu_target=["gfx1100"]' >> "$GITHUB_OUTPUT"
987+
969988
windows-latest-cmake-hip:
970989
runs-on: windows-latest
971990

991+
strategy:
992+
matrix:
993+
gpu_target: ${{ fromJSON(needs.hip_gpu_target_calculate.outputs.gpu_targets) }}
994+
972995
steps:
973996
- name: Clone
974997
id: checkout
@@ -994,8 +1017,38 @@ jobs:
9941017
run: |
9951018
$env:HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)
9961019
$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
1020+
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
1021+
cmake --build build -j ${env:NUMBER_OF_PROCESSORS}
1022+
md "build\bin\rocblas\library\"
1023+
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
1024+
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
1025+
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
1026+
1027+
- name: Determine tag name
1028+
id: tag
1029+
shell: bash
1030+
run: |
1031+
BUILD_NUMBER="$(git rev-list --count HEAD)"
1032+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1033+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1034+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1035+
else
1036+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1037+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1038+
fi
1039+
1040+
- name: Pack artifacts
1041+
id: pack_artifacts
1042+
if: ${{ github.event.inputs.create_release == 'true' }}
1043+
run: |
1044+
7z a llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip .\build\bin\*
1045+
1046+
- name: Upload artifacts
1047+
if: ${{ github.event.inputs.create_release == 'true' }}
1048+
uses: actions/upload-artifact@v4
1049+
with:
1050+
path: llama-${{ steps.tag.outputs.name }}-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
1051+
name: llama-bin-win-hip-x64-${{ matrix.gpu_target }}.zip
9991052

10001053
ios-xcode-build:
10011054
runs-on: macos-latest
@@ -1060,6 +1113,7 @@ jobs:
10601113
- macOS-latest-cmake
10611114
- windows-latest-cmake
10621115
- windows-latest-cmake-cuda
1116+
- windows-latest-cmake-hip
10631117
- macOS-latest-cmake-arm64
10641118
- macOS-latest-cmake-x64
10651119

0 commit comments

Comments
 (0)